From ac9ea8bb4b8d25a787fa4fe8058d15353451642a Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 28 Jun 2023 19:36:49 +0600 Subject: [PATCH 01/63] [+] create tabletApp module --- .../elevator/cloud/server/plugins/Routing.kt | 6 +- .../{common => tablet}/utils/DateUtils.kt | 2 +- .../{common => tablet}/utils/HashUtil.kt | 2 +- .../utils/PropertiesUtil.kt | 2 +- .../plugins/Routing.kt | 2 +- .../utils/ElevatorController.kt | 2 +- settings.gradle.kts | 1 + tabletApp/build.gradle.kts | 59 +++++++++++++++++++ tabletApp/src/androidMain/AndroidManifest.xml | 14 +++++ .../effective/office/tablet/MainActivity.kt | 17 ++++++ .../band/effective/office/tablet/platform.kt | 5 ++ .../band/effective/office/tablet/App.kt | 21 +++++++ .../band/effective/office/tablet/platform.kt | 3 + 13 files changed, 128 insertions(+), 8 deletions(-) rename common/src/main/kotlin/band/effective/office/{common => tablet}/utils/DateUtils.kt (93%) rename common/src/main/kotlin/band/effective/office/{common => tablet}/utils/HashUtil.kt (89%) rename common/src/main/kotlin/band/effective/office/{common => tablet}/utils/PropertiesUtil.kt (70%) create mode 100644 tabletApp/build.gradle.kts create mode 100644 tabletApp/src/androidMain/AndroidManifest.xml create mode 100644 tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt create mode 100644 tabletApp/src/androidMain/kotlin/band/effective/office/tablet/platform.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/platform.kt diff --git a/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt b/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt index cd4cf8e9..64c4b165 100644 --- a/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt +++ b/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt @@ -1,8 +1,8 @@ package band.effective.office.elevator.cloud.server.plugins -import band.effective.office.common.utils.HashUtil -import band.effective.office.common.utils.PropertiesUtil -import band.effective.office.common.utils.toVerifiableDate +import band.effective.office.tablet.utils.HashUtil +import band.effective.office.tablet.utils.PropertiesUtil +import band.effective.office.tablet.utils.toVerifiableDate import band.effective.office.elevator.cloud.server.client.ktorClient import band.effective.office.elevator.cloud.server.utils.TokenVerifier import io.ktor.client.request.* diff --git a/common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt b/common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt similarity index 93% rename from common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt rename to common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt index 6368aa8f..890f0b0e 100644 --- a/common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt +++ b/common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt @@ -1,4 +1,4 @@ -package band.effective.office.common.utils +package band.effective.office.tablet.utils import io.ktor.http.fromHttpToGmtDate import io.ktor.http.toHttpDate diff --git a/common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt b/common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt similarity index 89% rename from common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt rename to common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt index 7ef5e364..890ab206 100644 --- a/common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt +++ b/common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt @@ -1,4 +1,4 @@ -package band.effective.office.common.utils +package band.effective.office.tablet.utils import java.security.MessageDigest diff --git a/common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt b/common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt similarity index 70% rename from common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt rename to common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt index 80383e82..c9ccc3dc 100644 --- a/common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt +++ b/common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt @@ -1,4 +1,4 @@ -package band.effective.office.common.utils +package band.effective.office.tablet.utils object PropertiesUtil { fun read(key: String): String? { diff --git a/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt b/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt index 4ed7a78c..601eba2d 100644 --- a/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt +++ b/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt @@ -1,6 +1,6 @@ package band.effective.office.elevator.plugins -import band.effective.office.common.utils.* +import band.effective.office.tablet.utils.* import band.effective.office.elevator.utils.ElevatorController import io.ktor.http.* import io.ktor.server.application.* diff --git a/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt b/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt index 88e2f8e5..6d3754a3 100644 --- a/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt +++ b/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt @@ -1,6 +1,6 @@ package band.effective.office.elevator.utils -import band.effective.office.common.utils.DateUtils +import band.effective.office.tablet.utils.DateUtils object ElevatorController { fun call() { diff --git a/settings.gradle.kts b/settings.gradle.kts index a9a8dd76..e96ee07b 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,3 +3,4 @@ rootProject.name = "effective-office" include("cloud-server", "rpi-server", "gpio") include("common") include("composeApp") +include("tabletApp") diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts new file mode 100644 index 00000000..3a85bba6 --- /dev/null +++ b/tabletApp/build.gradle.kts @@ -0,0 +1,59 @@ +plugins { + id(Plugins.Android.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) +} + +android { + namespace = "band.effective.office.tablet" + compileSdk = 33 + + defaultConfig { + applicationId = "band.effective.office.tablet" + versionCode = 1 + versionName = "0.0.1" + + minSdk = 26 + targetSdk = 33 + } + sourceSets["main"].apply { + manifest.srcFile("src/androidMain/AndroidManifest.xml") + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } + compileOptions { + sourceCompatibility = JavaVersion.VERSION_1_8 + targetCompatibility = JavaVersion.VERSION_1_8 + } + packagingOptions { + resources.excludes.add("META-INF/**") + } + +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + } + } + val androidMain by getting { + dependencies { + implementation(Dependencies.AndroidX.appCompat) + implementation(Dependencies.AndroidX.activityCompose) + implementation(Dependencies.Compose.uiTooling) + } + } + } +} diff --git a/tabletApp/src/androidMain/AndroidManifest.xml b/tabletApp/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..20603a61 --- /dev/null +++ b/tabletApp/src/androidMain/AndroidManifest.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt new file mode 100644 index 00000000..e1cdf422 --- /dev/null +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -0,0 +1,17 @@ +package band.effective.office.tablet + +import android.os.Bundle +import androidx.appcompat.app.AppCompatActivity +import androidx.compose.material.MaterialTheme +import androidx.activity.compose.setContent + +class MainActivity : AppCompatActivity() { + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + setContent { + MaterialTheme { + App() + } + } + } +} \ No newline at end of file diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/platform.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/platform.kt new file mode 100644 index 00000000..ed60478b --- /dev/null +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/platform.kt @@ -0,0 +1,5 @@ +package band.effective.office.tablet + +actual fun getPlatformName(): String { + return "Android" +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt new file mode 100644 index 00000000..3231d5c4 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -0,0 +1,21 @@ +package band.effective.office.tablet + +import androidx.compose.material.Text +import androidx.compose.material.Button +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue + +@Composable +fun App() { + var text by remember { mutableStateOf("Hello, World!") } + val platformName = getPlatformName() + + Button(onClick = { + text = "Hello, ${platformName}" + }) { + Text(text) + } +} diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/platform.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/platform.kt new file mode 100644 index 00000000..7d5c6066 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/platform.kt @@ -0,0 +1,3 @@ +package band.effective.office.tablet + +expect fun getPlatformName(): String \ No newline at end of file -- GitLab From d4471cfc1f7be2ac38def230154e06117d869627 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 28 Jun 2023 23:31:56 +0600 Subject: [PATCH 02/63] [+] add navigation using decompose --- tabletApp/build.gradle.kts | 5 ++ .../effective/office/tablet/MainActivity.kt | 5 +- .../band/effective/office/tablet/App.kt | 26 ++++----- .../tablet/ui/mainScreen/MainComponent.kt | 24 ++++++++ .../office/tablet/ui/mainScreen/MainScreen.kt | 23 ++++++++ .../tablet/ui/mainScreen/MainScreenEvent.kt | 6 ++ .../tablet/ui/mainScreen/MainScreenState.kt | 9 +++ .../effective/office/tablet/ui/root/Root.kt | 18 ++++++ .../office/tablet/ui/root/RootComponent.kt | 57 +++++++++++++++++++ .../selectRoomScreen/SelectRoomComponent.kt | 7 +++ .../ui/selectRoomScreen/SelectRoomScreen.kt | 14 +++++ 11 files changed, 177 insertions(+), 17 deletions(-) create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index 3a85bba6..031c648f 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -2,6 +2,7 @@ plugins { id(Plugins.Android.plugin) id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) + id(Plugins.Parcelize.plugin) } android { @@ -46,6 +47,10 @@ kotlin { implementation(compose.runtime) implementation(compose.foundation) implementation(compose.material) + + // Decompose + api(Dependencies.Decompose.decompose) + api(Dependencies.Decompose.extensions) } } val androidMain by getting { diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index e1cdf422..1ea93e7c 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -4,14 +4,13 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.compose.material.MaterialTheme import androidx.activity.compose.setContent +import com.arkivanov.decompose.defaultComponentContext class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { - MaterialTheme { - App() - } + App(defaultComponentContext()) } } } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index 3231d5c4..0a2567af 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -1,21 +1,19 @@ package band.effective.office.tablet -import androidx.compose.material.Text -import androidx.compose.material.Button +import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.runtime.setValue +import band.effective.office.tablet.ui.mainScreen.MainComponent +import band.effective.office.tablet.ui.mainScreen.MainScreen +import band.effective.office.tablet.ui.root.Root +import band.effective.office.tablet.ui.root.RootComponent +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomComponent +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen +import com.arkivanov.decompose.ComponentContext @Composable -fun App() { - var text by remember { mutableStateOf("Hello, World!") } - val platformName = getPlatformName() - - Button(onClick = { - text = "Hello, ${platformName}" - }) { - Text(text) +fun App(componentContext: ComponentContext) { + val rootComponent = RootComponent(componentContext) + MaterialTheme { + Root(rootComponent) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt new file mode 100644 index 00000000..aa3532dd --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -0,0 +1,24 @@ +package band.effective.office.tablet.ui.mainScreen + +import band.effective.office.tablet.getPlatformName +import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update + +class MainComponent( + componentContext: ComponentContext, + private val onClick: () -> Unit +) : ComponentContext by componentContext { + private var mutableState = MutableStateFlow(MainScreenState.defaultState) + val state = mutableState.asStateFlow() + + fun sendEvent(event: MainScreenEvent) = + when (event) { + is MainScreenEvent.OnCLick -> { + onClick() + } + + is MainScreenEvent.OnDoubleTub -> {} + } +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt new file mode 100644 index 00000000..82af0dc5 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -0,0 +1,23 @@ +package band.effective.office.tablet.ui.mainScreen + +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue + +@Composable +fun MainScreen(component: MainComponent) { + val state by component.state.collectAsState() + MainScreenView( + buttonText = state.platform, + onClick = { component.sendEvent(MainScreenEvent.OnCLick) } + ) +} + +@Composable +fun MainScreenView(buttonText: String, onClick: () -> Unit) { + Button(onClick = { onClick() }) { + Text(text = "Hello, $buttonText") + } +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt new file mode 100644 index 00000000..24430faa --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt @@ -0,0 +1,6 @@ +package band.effective.office.tablet.ui.mainScreen + +sealed class MainScreenEvent { + object OnCLick: MainScreenEvent() + object OnDoubleTub: MainScreenEvent() +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt new file mode 100644 index 00000000..b7c33e77 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.ui.mainScreen + +data class MainScreenState( + val platform: String +){ + companion object{ + val defaultState = MainScreenState(platform = "world") + } +} diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt new file mode 100644 index 00000000..7fa17300 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -0,0 +1,18 @@ +package band.effective.office.tablet.ui.root + +import androidx.compose.runtime.Composable +import band.effective.office.tablet.ui.mainScreen.MainScreen +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen +import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children + +@Composable +fun Root(component: RootComponent) { + Children( + stack = component.childStack + ) { child -> + when (val instance = child.instance) { + is RootComponent.Child.MainChild -> MainScreen(instance.component) + is RootComponent.Child.SelectRoomChild -> SelectRoomScreen(instance.component) + } + } +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt new file mode 100644 index 00000000..7cabd822 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -0,0 +1,57 @@ +package band.effective.office.tablet.ui.root + +import band.effective.office.tablet.ui.mainScreen.MainComponent +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomComponent +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.decompose.router.stack.ChildStack +import com.arkivanov.decompose.router.stack.StackNavigation +import com.arkivanov.decompose.router.stack.childStack +import com.arkivanov.decompose.router.stack.push +import com.arkivanov.essenty.parcelable.Parcelable +import kotlinx.android.parcel.Parcelize +import kotlinx.coroutines.flow.StateFlow + +class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { + + private val navigation = StackNavigation() + + val childStack = childStack( + source = navigation, + initialConfiguration = Config.Main, + handleBackButton = true, + childFactory = ::createChild + ) + + private fun createChild( + config: Config, + componentContext: ComponentContext + ): Child = when (config) { + + is Config.Main -> { + Child.MainChild(MainComponent( + componentContext = componentContext, + onClick = { + navigation.push(Config.SelectRoom) + } + )) + } + + is Config.SelectRoom -> { + Child.SelectRoomChild(SelectRoomComponent(componentContext)) + } + } + + sealed class Child { + data class SelectRoomChild(val component: SelectRoomComponent) : Child() + data class MainChild(val component: MainComponent) : Child() + } + + sealed class Config : Parcelable { + + @Parcelize + object SelectRoom : Config() + + @Parcelize + object Main : Config() + } +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt new file mode 100644 index 00000000..2e691e36 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.ui.selectRoomScreen + +import com.arkivanov.decompose.ComponentContext + +class SelectRoomComponent(componentContext: ComponentContext) : ComponentContext by componentContext { + +} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt new file mode 100644 index 00000000..7e143aae --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -0,0 +1,14 @@ +package band.effective.office.tablet.ui.selectRoomScreen + +import androidx.compose.material.Text +import androidx.compose.runtime.Composable + +@Composable +fun SelectRoomScreen(component: SelectRoomComponent){ + SelectRoomView() +} + +@Composable +fun SelectRoomView(){ + Text(text = "SelectRoomView") +} \ No newline at end of file -- GitLab From 7f585d57dbea816d7a57b7a49b171049fa5df805 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Sat, 1 Jul 2023 23:43:22 +0600 Subject: [PATCH 03/63] [~] separate tablet application on modules --- buildSrc/buildSrc/src/main/kotlin/Plugins.kt | 5 +++ .../elevator/cloud/server/plugins/Routing.kt | 6 ++-- .../{tablet => common}/utils/DateUtils.kt | 2 +- .../{tablet => common}/utils/HashUtil.kt | 2 +- .../utils/PropertiesUtil.kt | 2 +- .../plugins/Routing.kt | 6 +++- .../utils/ElevatorController.kt | 2 +- settings.gradle.kts | 4 ++- tabletApp/build.gradle.kts | 12 +++---- tabletApp/features/roomInfo/build.gradle.kts | 35 +++++++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 +++ .../tablet/ui/mainScreen/MainComponent.kt | 4 +-- .../office/tablet/ui/mainScreen/MainScreen.kt | 1 + .../tablet/ui/mainScreen/MainScreenEvent.kt | 0 .../tablet/ui/mainScreen/MainScreenState.kt | 0 .../features/selectRoom/build.gradle.kts | 34 ++++++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 +++ .../selectRoomScreen/SelectRoomComponent.kt | 2 +- .../ui/selectRoomScreen/SelectRoomScreen.kt | 2 +- .../effective/office/tablet/MainActivity.kt | 1 - .../band/effective/office/tablet/App.kt | 4 --- .../effective/office/tablet/ui/root/Root.kt | 2 +- .../office/tablet/ui/root/RootComponent.kt | 4 +-- 23 files changed, 109 insertions(+), 29 deletions(-) rename common/src/main/kotlin/band/effective/office/{tablet => common}/utils/DateUtils.kt (93%) rename common/src/main/kotlin/band/effective/office/{tablet => common}/utils/HashUtil.kt (89%) rename common/src/main/kotlin/band/effective/office/{tablet => common}/utils/PropertiesUtil.kt (70%) create mode 100644 tabletApp/features/roomInfo/build.gradle.kts create mode 100644 tabletApp/features/roomInfo/src/androidMain/AndroidManifest.xml rename tabletApp/{ => features/roomInfo}/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt (83%) rename tabletApp/{ => features/roomInfo}/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt (91%) rename tabletApp/{ => features/roomInfo}/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt (100%) rename tabletApp/{ => features/roomInfo}/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt (100%) create mode 100644 tabletApp/features/selectRoom/build.gradle.kts create mode 100644 tabletApp/features/selectRoom/src/androidMain/AndroidManifest.xml rename tabletApp/{src/commonMain/kotlin/band/effective/office => features/selectRoom/src/commonMain/kotlin}/tablet/ui/selectRoomScreen/SelectRoomComponent.kt (72%) rename tabletApp/{src/commonMain/kotlin/band/effective/office => features/selectRoom/src/commonMain/kotlin}/tablet/ui/selectRoomScreen/SelectRoomScreen.kt (80%) diff --git a/buildSrc/buildSrc/src/main/kotlin/Plugins.kt b/buildSrc/buildSrc/src/main/kotlin/Plugins.kt index a01f2dce..e9d10b44 100644 --- a/buildSrc/buildSrc/src/main/kotlin/Plugins.kt +++ b/buildSrc/buildSrc/src/main/kotlin/Plugins.kt @@ -11,6 +11,11 @@ object Plugins { const val plugin = "com.android.application" } + object AndroidLib{ + const val implementation = "com.android.tools.build:gradle:7.3.1" + const val plugin = "com.android.library" + } + object Shadow { const val implementation = "gradle.plugin.com.github.johnrengelman:shadow:7.1.2" const val plugin = "com.github.johnrengelman.shadow" diff --git a/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt b/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt index 64c4b165..cd4cf8e9 100644 --- a/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt +++ b/cloud-server/src/main/kotlin/band/effective/office/elevator/cloud/server/plugins/Routing.kt @@ -1,8 +1,8 @@ package band.effective.office.elevator.cloud.server.plugins -import band.effective.office.tablet.utils.HashUtil -import band.effective.office.tablet.utils.PropertiesUtil -import band.effective.office.tablet.utils.toVerifiableDate +import band.effective.office.common.utils.HashUtil +import band.effective.office.common.utils.PropertiesUtil +import band.effective.office.common.utils.toVerifiableDate import band.effective.office.elevator.cloud.server.client.ktorClient import band.effective.office.elevator.cloud.server.utils.TokenVerifier import io.ktor.client.request.* diff --git a/common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt b/common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt similarity index 93% rename from common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt rename to common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt index 890f0b0e..6368aa8f 100644 --- a/common/src/main/kotlin/band/effective/office/tablet/utils/DateUtils.kt +++ b/common/src/main/kotlin/band/effective/office/common/utils/DateUtils.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.utils +package band.effective.office.common.utils import io.ktor.http.fromHttpToGmtDate import io.ktor.http.toHttpDate diff --git a/common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt b/common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt similarity index 89% rename from common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt rename to common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt index 890ab206..7ef5e364 100644 --- a/common/src/main/kotlin/band/effective/office/tablet/utils/HashUtil.kt +++ b/common/src/main/kotlin/band/effective/office/common/utils/HashUtil.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.utils +package band.effective.office.common.utils import java.security.MessageDigest diff --git a/common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt b/common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt similarity index 70% rename from common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt rename to common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt index c9ccc3dc..80383e82 100644 --- a/common/src/main/kotlin/band/effective/office/tablet/utils/PropertiesUtil.kt +++ b/common/src/main/kotlin/band/effective/office/common/utils/PropertiesUtil.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.utils +package band.effective.office.common.utils object PropertiesUtil { fun read(key: String): String? { diff --git a/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt b/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt index 601eba2d..29f07cb4 100644 --- a/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt +++ b/rpi-server/src/main/kotlin/band.effective.office.elevator/plugins/Routing.kt @@ -1,6 +1,10 @@ package band.effective.office.elevator.plugins -import band.effective.office.tablet.utils.* +import band.effective.office.common.utils.DateUtils +import band.effective.office.common.utils.HashUtil +import band.effective.office.common.utils.PropertiesUtil +import band.effective.office.common.utils.toGMTDate +import band.effective.office.common.utils.toVerifiableDate import band.effective.office.elevator.utils.ElevatorController import io.ktor.http.* import io.ktor.server.application.* diff --git a/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt b/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt index 6d3754a3..88e2f8e5 100644 --- a/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt +++ b/rpi-server/src/main/kotlin/band.effective.office.elevator/utils/ElevatorController.kt @@ -1,6 +1,6 @@ package band.effective.office.elevator.utils -import band.effective.office.tablet.utils.DateUtils +import band.effective.office.common.utils.DateUtils object ElevatorController { fun call() { diff --git a/settings.gradle.kts b/settings.gradle.kts index e96ee07b..70289411 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -3,4 +3,6 @@ rootProject.name = "effective-office" include("cloud-server", "rpi-server", "gpio") include("common") include("composeApp") -include("tabletApp") +include(":tabletApp") +include(":tabletApp:features:selectRoom") +include(":tabletApp:features:roomInfo") \ No newline at end of file diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index 031c648f..deb3bd59 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -19,16 +19,11 @@ android { } sourceSets["main"].apply { manifest.srcFile("src/androidMain/AndroidManifest.xml") - res.srcDirs("src/androidMain/resources") - res.srcDir("build/generated/libres/android/resources") } compileOptions { sourceCompatibility = JavaVersion.VERSION_1_8 targetCompatibility = JavaVersion.VERSION_1_8 } - packagingOptions { - resources.excludes.add("META-INF/**") - } } @@ -49,8 +44,11 @@ kotlin { implementation(compose.material) // Decompose - api(Dependencies.Decompose.decompose) - api(Dependencies.Decompose.extensions) + implementation(Dependencies.Decompose.decompose) + implementation(Dependencies.Decompose.extensions) + + implementation(project(":tabletApp:features:selectRoom")) + implementation(project(":tabletApp:features:roomInfo")) } } val androidMain by getting { diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts new file mode 100644 index 00000000..1d2bbd7e --- /dev/null +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -0,0 +1,35 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) + id(Plugins.Parcelize.plugin) +} + + +android { + compileSdk = 33 +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + + // Decompose + implementation(Dependencies.Decompose.decompose) + implementation(Dependencies.Decompose.extensions) + } + } + } +} diff --git a/tabletApp/features/roomInfo/src/androidMain/AndroidManifest.xml b/tabletApp/features/roomInfo/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..c428412f --- /dev/null +++ b/tabletApp/features/roomInfo/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt similarity index 83% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index aa3532dd..9b39426a 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -1,10 +1,10 @@ package band.effective.office.tablet.ui.mainScreen -import band.effective.office.tablet.getPlatformName +import band.effective.office.tablet.ui.mainScreen.MainScreenEvent +import band.effective.office.tablet.ui.mainScreen.MainScreenState import com.arkivanov.decompose.ComponentContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.update class MainComponent( componentContext: ComponentContext, diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt similarity index 91% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index 82af0dc5..fe7d0ab6 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -5,6 +5,7 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue +import band.effective.office.tablet.ui.mainScreen.MainComponent @Composable fun MainScreen(component: MainComponent) { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt similarity index 100% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt similarity index 100% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts new file mode 100644 index 00000000..f3da50b5 --- /dev/null +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) + id(Plugins.Parcelize.plugin) +} + +android { + compileSdk = 33 +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + + // Decompose + implementation(Dependencies.Decompose.decompose) + implementation(Dependencies.Decompose.extensions) + } + } + } +} diff --git a/tabletApp/features/selectRoom/src/androidMain/AndroidManifest.xml b/tabletApp/features/selectRoom/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..171f5fca --- /dev/null +++ b/tabletApp/features/selectRoom/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt similarity index 72% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index 2e691e36..1e221134 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.selectRoomScreen +package tablet.ui.selectRoomScreen import com.arkivanov.decompose.ComponentContext diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt similarity index 80% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index 7e143aae..b485b41a 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.selectRoomScreen +package tablet.ui.selectRoomScreen import androidx.compose.material.Text import androidx.compose.runtime.Composable diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index 1ea93e7c..136b30e4 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -2,7 +2,6 @@ package band.effective.office.tablet import android.os.Bundle import androidx.appcompat.app.AppCompatActivity -import androidx.compose.material.MaterialTheme import androidx.activity.compose.setContent import com.arkivanov.decompose.defaultComponentContext diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index 0a2567af..1df588dd 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -2,12 +2,8 @@ package band.effective.office.tablet import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable -import band.effective.office.tablet.ui.mainScreen.MainComponent -import band.effective.office.tablet.ui.mainScreen.MainScreen import band.effective.office.tablet.ui.root.Root import band.effective.office.tablet.ui.root.RootComponent -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomComponent -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen import com.arkivanov.decompose.ComponentContext @Composable diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index 7fa17300..0e0fbed1 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -2,8 +2,8 @@ package band.effective.office.tablet.ui.root import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.mainScreen.MainScreen -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children +import tablet.ui.selectRoomScreen.SelectRoomScreen @Composable fun Root(component: RootComponent) { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 7cabd822..03a885d1 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,15 +1,13 @@ package band.effective.office.tablet.ui.root import band.effective.office.tablet.ui.mainScreen.MainComponent -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomComponent import com.arkivanov.decompose.ComponentContext -import com.arkivanov.decompose.router.stack.ChildStack import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import kotlinx.coroutines.flow.StateFlow +import tablet.ui.selectRoomScreen.SelectRoomComponent class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { -- GitLab From a47dc9d2564a996ef48a079e551fc740b0c58fad Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 3 Jul 2023 15:40:35 +0600 Subject: [PATCH 04/63] [+] write main structure --- tabletApp/features/roomInfo/build.gradle.kts | 9 ++++ .../office/tablet/di/InitRoomInfoKoin.kt | 7 ++++ .../office/tablet/di/CommonModule.kt | 12 ++++++ .../office/tablet/domain/RoomInteractor.kt | 7 ++++ .../tablet/domain/RoomInteractorImpl.kt | 8 ++++ .../office/tablet/domain/model/EventInfo.kt | 9 ++++ .../office/tablet/domain/model/RoomInfo.kt | 23 ++++++++++ .../tablet/network/MockRoomInfoRepository.kt | 42 +++++++++++++++++++ .../tablet/network/RoomInfoRepository.kt | 7 ++++ .../tablet/ui/mainScreen/MainComponent.kt | 17 +++++++- .../office/tablet/ui/mainScreen/MainScreen.kt | 27 ++++++++---- .../tablet/ui/mainScreen/MainScreenState.kt | 22 ++++++++-- .../effective/office/tablet/MainActivity.kt | 2 + 13 files changed, 178 insertions(+), 14 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index 1d2bbd7e..67674485 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -29,6 +29,15 @@ kotlin { // Decompose implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + + // Koin + api(Dependencies.Koin.core) + } + } + val androidMain by getting { + dependencies{ + // Koin + api(Dependencies.Koin.android) } } } diff --git a/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt new file mode 100644 index 00000000..d18a61df --- /dev/null +++ b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.di + +import org.koin.core.context.startKoin + +fun initRoomInfoKoin() = startKoin { + modules(commonModule) +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt new file mode 100644 index 00000000..d8003802 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt @@ -0,0 +1,12 @@ +package band.effective.office.tablet.di + +import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.domain.RoomInteractorImpl +import band.effective.office.tablet.network.MockRoomInfoRepository +import band.effective.office.tablet.network.RoomInfoRepository +import org.koin.dsl.module + +val commonModule = module { + single { MockRoomInfoRepository() } + single { RoomInteractorImpl(get()) } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt new file mode 100644 index 00000000..18e21eb4 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.RoomInfo + +interface RoomInteractor { + fun getRoomInfo(name: String): RoomInfo +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt new file mode 100644 index 00000000..78ada386 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.RoomInfoRepository + +class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository): RoomInteractor { + override fun getRoomInfo(name: String): RoomInfo = roomInfoRepository.getRoomInfo(name) +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..c8f9a935 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.domain.model + +import java.util.Calendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt new file mode 100644 index 00000000..a9683647 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt @@ -0,0 +1,23 @@ +package band.effective.office.tablet.domain.model + +data class RoomInfo( + val name: String, + val capacity: Int, + val isHaveTv: Boolean, + val electricSocketCount: Int, + val eventList: List, + //NOTE(Maksim Mishenko): currentEvent is null if room is free + val currentEvent: EventInfo? +){ + companion object{ + val defaultValue = + RoomInfo( + name = "Default", + capacity = 0, + isHaveTv = false, + electricSocketCount = 0, + eventList = listOf(), + currentEvent = null + ) + } +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt new file mode 100644 index 00000000..65cd4ce6 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt @@ -0,0 +1,42 @@ +package band.effective.office.tablet.network + +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.model.RoomInfo +import java.util.GregorianCalendar + +class MockRoomInfoRepository: RoomInfoRepository { + + private val currentEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "Ольга Белозерова" + ) + + private val olyaEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "Ольга Белозерова" + ) + + private val matveyEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "Матвей Авгуль" + ) + + private val lilaEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "Лилия Акентьева" + ) + + override fun getRoomInfo(name: String): RoomInfo = + RoomInfo( + name = "Sirius", + capacity = 8, + isHaveTv = true, + electricSocketCount = 4, + eventList = listOf(olyaEvent,matveyEvent,lilaEvent), + currentEvent = currentEvent + ) +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt new file mode 100644 index 00000000..a26c8f01 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.network + +import band.effective.office.tablet.domain.model.RoomInfo + +interface RoomInfoRepository { + fun getRoomInfo(name: String): RoomInfo +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index 9b39426a..1813ec8e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -1,18 +1,31 @@ package band.effective.office.tablet.ui.mainScreen +import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.domain.RoomInteractorImpl +import band.effective.office.tablet.network.MockRoomInfoRepository import band.effective.office.tablet.ui.mainScreen.MainScreenEvent import band.effective.office.tablet.ui.mainScreen.MainScreenState import com.arkivanov.decompose.ComponentContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject class MainComponent( componentContext: ComponentContext, - private val onClick: () -> Unit -) : ComponentContext by componentContext { + private val onClick: () -> Unit, +) : ComponentContext by componentContext, KoinComponent { + + private val interactor: RoomInteractor by inject() + private var mutableState = MutableStateFlow(MainScreenState.defaultState) val state = mutableState.asStateFlow() + init { + mutableState.update { it.copy(isLoad = false, isData = true, roomInfo = interactor.getRoomInfo("sirius")) } + } + fun sendEvent(event: MainScreenEvent) = when (event) { is MainScreenEvent.OnCLick -> { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index fe7d0ab6..e0cb7486 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -1,24 +1,35 @@ package band.effective.office.tablet.ui.mainScreen +import androidx.compose.foundation.layout.Column import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import band.effective.office.tablet.ui.mainScreen.MainComponent +import band.effective.office.tablet.domain.model.RoomInfo @Composable fun MainScreen(component: MainComponent) { val state by component.state.collectAsState() - MainScreenView( - buttonText = state.platform, - onClick = { component.sendEvent(MainScreenEvent.OnCLick) } - ) + + when{ + state.isError -> {} + state.isLoad -> {} + state.isData -> { + MainScreenView( + room = state.roomInfo, + onSelectOtherRoom = { component.sendEvent(MainScreenEvent.OnCLick) } + ) + } + } } @Composable -fun MainScreenView(buttonText: String, onClick: () -> Unit) { - Button(onClick = { onClick() }) { - Text(text = "Hello, $buttonText") +fun MainScreenView(room: RoomInfo, onSelectOtherRoom: () -> Unit) { + Column{ + Text(text = room.name) + Button(onClick = { onSelectOtherRoom() }) { + Text(text = "SelectOtherRoom") + } } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt index b7c33e77..7371ec82 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt @@ -1,9 +1,23 @@ package band.effective.office.tablet.ui.mainScreen +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.RoomInfoRepository + data class MainScreenState( - val platform: String -){ - companion object{ - val defaultState = MainScreenState(platform = "world") + val isLoad: Boolean, + val isData: Boolean, + val isError: Boolean, + val roomInfo: RoomInfo, + val error: String +) { + companion object { + val defaultState = + MainScreenState( + isLoad = true, + isData = false, + isError = false, + roomInfo = RoomInfo.defaultValue, + error = "" + ) } } diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index 136b30e4..c730b128 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -3,11 +3,13 @@ package band.effective.office.tablet import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.activity.compose.setContent +import band.effective.office.tablet.di.initRoomInfoKoin import com.arkivanov.decompose.defaultComponentContext class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) + initRoomInfoKoin() setContent { App(defaultComponentContext()) } -- GitLab From 7656d2671ac4311834b75f21da58dc7db4357e9d Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 3 Jul 2023 16:35:49 +0600 Subject: [PATCH 05/63] [~] separate view on components --- .../office/tablet/ui/mainScreen/MainScreen.kt | 16 +------- .../mainScreen/components/BookingRoomView.kt | 12 ++++++ .../mainScreen/components/MainScreenView.kt | 24 +++++++++++ .../ui/mainScreen/components/RoomInfoView.kt | 41 +++++++++++++++++++ .../roomInfoComponents/BusyRoomInfoView.kt | 16 ++++++++ .../roomInfoComponents/DateTimeView.kt | 9 ++++ .../roomInfoComponents/FreeRoomInfoView.kt | 16 ++++++++ .../roomInfoComponents/RoomEventListView.kt | 9 ++++ 8 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index e0cb7486..d027b3dd 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -1,17 +1,13 @@ package band.effective.office.tablet.ui.mainScreen -import androidx.compose.foundation.layout.Column -import androidx.compose.material.Button -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.ui.mainScreen.components.MainScreenView @Composable fun MainScreen(component: MainComponent) { val state by component.state.collectAsState() - when{ state.isError -> {} state.isLoad -> {} @@ -22,14 +18,4 @@ fun MainScreen(component: MainComponent) { ) } } -} - -@Composable -fun MainScreenView(room: RoomInfo, onSelectOtherRoom: () -> Unit) { - Column{ - Text(text = room.name) - Button(onClick = { onSelectOtherRoom() }) { - Text(text = "SelectOtherRoom") - } - } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt new file mode 100644 index 00000000..dbd2532e --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt @@ -0,0 +1,12 @@ +package band.effective.office.tablet.ui.mainScreen.components + +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable + +@Composable +fun BookingRoomView(onSelectOtherRoom: () -> Unit){ + Button(onClick = { onSelectOtherRoom() }) { + Text(text = "SelectOtherRoom") + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt new file mode 100644 index 00000000..e37b9588 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -0,0 +1,24 @@ +package band.effective.office.tablet.ui.mainScreen.components + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import band.effective.office.tablet.domain.model.RoomInfo + +@Composable +fun MainScreenView(room: RoomInfo, onSelectOtherRoom: () -> Unit) { + /*NOTE(Maksim Mishenko): + * infoViewWidth is part of the width occupied by roomInfoView + * infoViewWidth = infoViewFrame.width / mainScreenFrame.width + * where infoViewFrame, mainScreenFrame is frames from figma and all width I get from figma*/ + val infoViewWidth = 627f / 1133f + Row(modifier = Modifier.fillMaxSize()) { + RoomInfoView( + modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), + room = room) + BookingRoomView(onSelectOtherRoom) + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt new file mode 100644 index 00000000..13d3db06 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt @@ -0,0 +1,41 @@ +package band.effective.office.tablet.ui.mainScreen.components + +import androidx.compose.foundation.layout.Column +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.BusyRoomInfoView +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.DateTimeView +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.FreeRoomInfoView +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomEventListView + +@Composable +fun RoomInfoView(modifier: Modifier = Modifier, room: RoomInfo) { + Column(modifier = modifier) { + DateTimeView() + when { + room.isFree() -> { + FreeRoomInfoView( + name = room.name, + capacity = room.capacity, + isHaveTv = room.isHaveTv, + electricSocketCount = room.electricSocketCount, + nextEvent = room.eventList.firstOrNull() + ) + } + room.isBusy() -> { + BusyRoomInfoView( + name = room.name, + capacity = room.capacity, + isHaveTv = room.isHaveTv, + electricSocketCount = room.electricSocketCount, + event = room.currentEvent + ) + } + } + RoomEventListView(room.eventList) + } +} + +private fun RoomInfo.isFree() = currentEvent == null +private fun RoomInfo.isBusy() = currentEvent != null \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt new file mode 100644 index 00000000..8211121d --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt @@ -0,0 +1,16 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import band.effective.office.tablet.domain.model.EventInfo + +@Composable +fun BusyRoomInfoView( + name: String, + capacity: Int, + isHaveTv: Boolean, + electricSocketCount: Int, + event: EventInfo? +) { + Text(text = "BusyRoomInfoView") +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt new file mode 100644 index 00000000..1becbba7 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.material.Text +import androidx.compose.runtime.Composable + +@Composable +fun DateTimeView() { + Text(text = "текущее время") +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt new file mode 100644 index 00000000..18b3d807 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt @@ -0,0 +1,16 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import band.effective.office.tablet.domain.model.EventInfo + +@Composable +fun FreeRoomInfoView( + name: String, + capacity: Int, + isHaveTv: Boolean, + electricSocketCount: Int, + nextEvent: EventInfo? +) { + Text(text = "FreeRoomInfoView") +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt new file mode 100644 index 00000000..d45df3d3 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.runtime.Composable +import band.effective.office.tablet.domain.model.EventInfo + +@Composable +fun RoomEventListView(eventsList: List) { + +} \ No newline at end of file -- GitLab From 9b4b41870046263b9ebada3f96706b7692416335 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 3 Jul 2023 16:53:09 +0600 Subject: [PATCH 06/63] [~] design DateTimeView --- .../mainScreen/components/MainScreenView.kt | 7 +++++-- .../ui/mainScreen/components/RoomInfoView.kt | 4 +++- .../roomInfoComponents/DateTimeView.kt | 20 +++++++++++++++++-- 3 files changed, 26 insertions(+), 5 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index e37b9588..acc42b4c 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -1,11 +1,13 @@ package band.effective.office.tablet.ui.mainScreen.components +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.RoomInfo @Composable @@ -15,10 +17,11 @@ fun MainScreenView(room: RoomInfo, onSelectOtherRoom: () -> Unit) { * infoViewWidth = infoViewFrame.width / mainScreenFrame.width * where infoViewFrame, mainScreenFrame is frames from figma and all width I get from figma*/ val infoViewWidth = 627f / 1133f - Row(modifier = Modifier.fillMaxSize()) { + Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { RoomInfoView( modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), - room = room) + room = room + ) BookingRoomView(onSelectOtherRoom) } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt index 13d3db06..10e01dbe 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt @@ -1,8 +1,10 @@ package band.effective.office.tablet.ui.mainScreen.components import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.BusyRoomInfoView import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.DateTimeView @@ -12,7 +14,7 @@ import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents. @Composable fun RoomInfoView(modifier: Modifier = Modifier, room: RoomInfo) { Column(modifier = modifier) { - DateTimeView() + DateTimeView(modifier = Modifier.padding(25.dp)) when { room.isFree() -> { FreeRoomInfoView( diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt index 1becbba7..ca75f913 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt @@ -1,9 +1,25 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.width import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp @Composable -fun DateTimeView() { - Text(text = "текущее время") +fun DateTimeView(modifier: Modifier = Modifier) { + Row( + modifier = modifier, + verticalAlignment = Alignment.Bottom + ) { + Text(text = "17:49", color = Color(0xFFFAFAFA), fontSize = 30.sp) + Spacer(modifier = Modifier.width(10.dp)) + Text(text = "28 июня, среда", color = Color(0xFFFAFAFA), fontSize = 25.sp) + } } \ No newline at end of file -- GitLab From d5ecd1624e741b2bc594fb88d72591d7edc77132 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 3 Jul 2023 21:14:35 +0600 Subject: [PATCH 07/63] [~] design RoomInfoComponents, add Libres --- tabletApp/build.gradle.kts | 4 + tabletApp/features/roomInfo/build.gradle.kts | 18 +++ .../office/tablet/ui/mainScreen/MainScreen.kt | 4 +- ...inScreenView.kt => MainScreenComponent.kt} | 4 +- .../{RoomInfoView.kt => RoomInfoComponent.kt} | 18 +-- .../BusyRoomInfoComponent.kt | 28 ++++ .../roomInfoComponents/BusyRoomInfoView.kt | 16 --- .../{DateTimeView.kt => DateTimeComponent.kt} | 3 +- .../FreeRoomInfoComponent.kt | 30 ++++ .../roomInfoComponents/FreeRoomInfoView.kt | 16 --- ...tListView.kt => RoomEventListComponent.kt} | 2 +- .../roomInfoComponents/RoomInfoComponent.kt | 128 ++++++++++++++++++ .../tablet/utils/CalendarStringConverter.kt | 14 ++ .../office/tablet/utils/CorrectDeclension.kt | 11 ++ .../commonMain/libres/images/power_socket.svg | 5 + .../src/commonMain/libres/images/quantity.svg | 6 + .../src/commonMain/libres/images/tv.svg | 6 + .../src/commonMain/libres/images/usb.svg | 3 + .../commonMain/libres/strings/strings_ru.xml | 11 ++ 19 files changed, 279 insertions(+), 48 deletions(-) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/{MainScreenView.kt => MainScreenComponent.kt} (91%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/{RoomInfoView.kt => RoomInfoComponent.kt} (74%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/{DateTimeView.kt => DateTimeComponent.kt} (88%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/{RoomEventListView.kt => RoomEventListComponent.kt} (77%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CalendarStringConverter.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CorrectDeclension.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/power_socket.svg create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/quantity.svg create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/tv.svg create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/usb.svg create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index deb3bd59..b2017966 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -3,6 +3,7 @@ plugins { id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) id(Plugins.Parcelize.plugin) + id(Plugins.Libres.plugin) } android { @@ -47,6 +48,9 @@ kotlin { implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + //Libres + implementation(Dependencies.Libres.libresCompose) + implementation(project(":tabletApp:features:selectRoom")) implementation(project(":tabletApp:features:roomInfo")) } diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index 67674485..5129e305 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -3,11 +3,17 @@ plugins { id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) id(Plugins.Parcelize.plugin) + id(Plugins.Libres.plugin) } android { compileSdk = 33 + sourceSets["main"].apply { + manifest.srcFile("src/androidMain/AndroidManifest.xml") + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } } kotlin { @@ -32,6 +38,9 @@ kotlin { // Koin api(Dependencies.Koin.core) + + //Libres + implementation(Dependencies.Libres.libresCompose) } } val androidMain by getting { @@ -42,3 +51,12 @@ kotlin { } } } + +libres { + // https://github.com/Skeptick/libres#setup + generatedClassName = "MainRes" // "Res" by default + generateNamedArguments = true // false by default + baseLocaleLanguageCode = "ru" // "en" by default + camelCaseNamesForAppleFramework = true // false by default + +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index d027b3dd..0bc2765e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -3,7 +3,7 @@ package band.effective.office.tablet.ui.mainScreen import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import band.effective.office.tablet.ui.mainScreen.components.MainScreenView +import band.effective.office.tablet.ui.mainScreen.components.MainScreenComponent @Composable fun MainScreen(component: MainComponent) { @@ -12,7 +12,7 @@ fun MainScreen(component: MainComponent) { state.isError -> {} state.isLoad -> {} state.isData -> { - MainScreenView( + MainScreenComponent( room = state.roomInfo, onSelectOtherRoom = { component.sendEvent(MainScreenEvent.OnCLick) } ) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt similarity index 91% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt index acc42b4c..d664e26e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt @@ -11,14 +11,14 @@ import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.RoomInfo @Composable -fun MainScreenView(room: RoomInfo, onSelectOtherRoom: () -> Unit) { +fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit) { /*NOTE(Maksim Mishenko): * infoViewWidth is part of the width occupied by roomInfoView * infoViewWidth = infoViewFrame.width / mainScreenFrame.width * where infoViewFrame, mainScreenFrame is frames from figma and all width I get from figma*/ val infoViewWidth = 627f / 1133f Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { - RoomInfoView( + RoomInfoComponent( modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), room = room ) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt similarity index 74% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt index 10e01dbe..f67da19f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt @@ -6,18 +6,18 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.RoomInfo -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.BusyRoomInfoView -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.DateTimeView -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.FreeRoomInfoView -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomEventListView +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.BusyRoomInfoComponent +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.DateTimeComponent +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.FreeRoomInfoComponent +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomEventListComponent @Composable -fun RoomInfoView(modifier: Modifier = Modifier, room: RoomInfo) { +fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { Column(modifier = modifier) { - DateTimeView(modifier = Modifier.padding(25.dp)) + DateTimeComponent(modifier = Modifier.padding(25.dp)) when { room.isFree() -> { - FreeRoomInfoView( + FreeRoomInfoComponent( name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -26,7 +26,7 @@ fun RoomInfoView(modifier: Modifier = Modifier, room: RoomInfo) { ) } room.isBusy() -> { - BusyRoomInfoView( + BusyRoomInfoComponent( name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -35,7 +35,7 @@ fun RoomInfoView(modifier: Modifier = Modifier, room: RoomInfo) { ) } } - RoomEventListView(room.eventList) + RoomEventListComponent(room.eventList) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt new file mode 100644 index 00000000..73f7fe5b --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt @@ -0,0 +1,28 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.features.roomInfo.MainRes +import band.effective.office.tablet.utils.CalendarStringConverter +import java.util.Calendar + +@Composable +fun BusyRoomInfoComponent( + name: String, capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, event: EventInfo? +) { + RoomInfoComponent( + name = name, + capacity = capacity, + isHaveTv = isHaveTv, + electricSocketCount = electricSocketCount, + roomOccupancy = MainRes.string.room_occupancy.format( + startTime = event?.startTime?.time() ?: "", + finishTime = event?.finishTime?.time() ?: "", + organizer = event?.organizer ?: "" + ), + backgroundColor = Color(0xFFF94C4C) + ) +} + +private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt deleted file mode 100644 index 8211121d..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoView.kt +++ /dev/null @@ -1,16 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents - -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import band.effective.office.tablet.domain.model.EventInfo - -@Composable -fun BusyRoomInfoView( - name: String, - capacity: Int, - isHaveTv: Boolean, - electricSocketCount: Int, - event: EventInfo? -) { - Text(text = "BusyRoomInfoView") -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt similarity index 88% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt index ca75f913..6a2c0b86 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt @@ -1,6 +1,5 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.width @@ -13,7 +12,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp @Composable -fun DateTimeView(modifier: Modifier = Modifier) { +fun DateTimeComponent(modifier: Modifier = Modifier) { Row( modifier = modifier, verticalAlignment = Alignment.Bottom diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt new file mode 100644 index 00000000..e0629679 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt @@ -0,0 +1,30 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.features.roomInfo.MainRes +import band.effective.office.tablet.utils.CalendarStringConverter +import java.util.Calendar + +@Composable +fun FreeRoomInfoComponent( + name: String, + capacity: Int, + isHaveTv: Boolean, + electricSocketCount: Int, + nextEvent: EventInfo? +) { + RoomInfoComponent( + name = name, + capacity = capacity, + isHaveTv = isHaveTv, + electricSocketCount = electricSocketCount, + roomOccupancy = MainRes.string.free_room_occupancy.format( + time = nextEvent?.startTime?.time() ?: "" + ), + backgroundColor = Color(0xFF36C95F) + ) +} + +private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt deleted file mode 100644 index 18b3d807..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoView.kt +++ /dev/null @@ -1,16 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents - -import androidx.compose.material.Text -import androidx.compose.runtime.Composable -import band.effective.office.tablet.domain.model.EventInfo - -@Composable -fun FreeRoomInfoView( - name: String, - capacity: Int, - isHaveTv: Boolean, - electricSocketCount: Int, - nextEvent: EventInfo? -) { - Text(text = "FreeRoomInfoView") -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt similarity index 77% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt index d45df3d3..a634b98f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt @@ -4,6 +4,6 @@ import androidx.compose.runtime.Composable import band.effective.office.tablet.domain.model.EventInfo @Composable -fun RoomEventListView(eventsList: List) { +fun RoomEventListComponent(eventsList: List) { } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt new file mode 100644 index 00000000..7831dd89 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt @@ -0,0 +1,128 @@ +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Surface +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.roomInfo.MainRes +import band.effective.office.tablet.utils.getCorrectDeclension +import io.github.skeptick.libres.compose.painterResource +import io.github.skeptick.libres.images.Image + +@Composable +fun RoomInfoComponent( + name: String, + capacity: Int, + isHaveTv: Boolean, + electricSocketCount: Int, + roomOccupancy: String, + backgroundColor: Color +) { + Surface( + modifier = Modifier.background(color = backgroundColor).padding(25.dp).fillMaxWidth(), + color = backgroundColor + ) { + Column { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = name, + color = Color(0xFFFAFAFA), + fontSize = 60.sp + ) + Button( + modifier = Modifier + .background(color = backgroundColor).border( + width = 3.dp, + color = Color(0xFFFAFAFA), + shape = RoundedCornerShape(20.dp), + ), + colors = ButtonDefaults.buttonColors( + backgroundColor = backgroundColor, + contentColor = backgroundColor + ), + onClick = {}) { + Text(text = MainRes.string.stop_meeting_button, color = Color(0xFFFAFAFA)) + } + } + Spacer(modifier = Modifier.height(20.dp)) + Text( + text = roomOccupancy, + color = Color(0xFFFAFAFA), + fontSize = 27.sp + ) + Spacer(modifier = Modifier.height(40.dp)) + Row(modifier = Modifier.padding(horizontal = 10.dp)) { + val spaceBetweenProperty = 40.dp + RoomPropertyComponent(image = MainRes.image.quantity, text = "$capacity") + if (isHaveTv) { + Spacer(modifier = Modifier.width(spaceBetweenProperty)) + RoomPropertyComponent( + image = MainRes.image.tv, + text = MainRes.string.tv_property + ) + } + //NOTE(Maksim Mishenko): designers have not fully defined all the properties, a condition will appear in if + //TODO(Maksim Mishenko): replace condition in if + if (true) { + Spacer(modifier = Modifier.width(spaceBetweenProperty)) + RoomPropertyComponent( + image = MainRes.image.usb, + text = MainRes.string.usb_property + ) + } + if (electricSocketCount > 0) { + Spacer(modifier = Modifier.width(spaceBetweenProperty)) + RoomPropertyComponent( + image = MainRes.image.power_socket, + text = "$electricSocketCount ${ + getCorrectDeclension( + number = electricSocketCount, + nominativeCase = MainRes.string.electric_socket_property_nominative, + genitive = MainRes.string.electric_socket_property_genitive, + genitivePlural = MainRes.string.electric_socket_property_plural + ) + }" + ) + } + } + } + } +} + +@Composable +fun RoomPropertyComponent(image: Image, text: String) { + Row( + horizontalArrangement = Arrangement.Center, + verticalAlignment = Alignment.CenterVertically + ) { + Image( + modifier = Modifier, + painter = painterResource(image), + contentDescription = null + ) + Spacer(modifier = Modifier.width(8.dp)) + Text(text = text, color = Color(0xFFFAFAFA), fontSize = 16.sp) + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CalendarStringConverter.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CalendarStringConverter.kt new file mode 100644 index 00000000..a471be61 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CalendarStringConverter.kt @@ -0,0 +1,14 @@ +package band.effective.office.tablet.utils + +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.GregorianCalendar + +object CalendarStringConverter { + fun calendarToString(calendar: Calendar,pattern: String): String = SimpleDateFormat(pattern).format(calendar.time) + fun stringToCalendar(str: String, pattern: String): Calendar { + val calendar = GregorianCalendar() + calendar.time = SimpleDateFormat(pattern).parse(str) + return calendar + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CorrectDeclension.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CorrectDeclension.kt new file mode 100644 index 00000000..cc7ce859 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/CorrectDeclension.kt @@ -0,0 +1,11 @@ +package band.effective.office.tablet.utils + +fun getCorrectDeclension( + number: Int, nominativeCase: String, genitive: String, genitivePlural: String +): String = if (number in 10..20) genitivePlural +else when (number % 10) { + 0 -> genitivePlural + 1 -> nominativeCase + 2, 3, 4 -> genitive + else -> genitivePlural +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/power_socket.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/power_socket.svg new file mode 100644 index 00000000..eb6cd537 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/power_socket.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/quantity.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/quantity.svg new file mode 100644 index 00000000..bf3b341d --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/quantity.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/tv.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/tv.svg new file mode 100644 index 00000000..6d9873fb --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/tv.svg @@ -0,0 +1,6 @@ + + + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/usb.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/usb.svg new file mode 100644 index 00000000..e66a800f --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/usb.svg @@ -0,0 +1,3 @@ + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml new file mode 100644 index 00000000..9b0b27ea --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml @@ -0,0 +1,11 @@ + + + Занята c ${startTime} по ${finishTime} · ${organizer} + Свободна до ${time} + Освободить + TV + USB + Розетка + Розетки + Розеток + \ No newline at end of file -- GitLab From ae9b132e1160f18f0f16e71c92d97e0a7ef94976 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 3 Jul 2023 23:04:32 +0600 Subject: [PATCH 08/63] [~] design RoomEventListComponent --- .../components/RoomInfoComponent.kt | 8 +- .../BusyRoomInfoComponent.kt | 11 ++- ...omponent.kt => CommonRoomInfoComponent.kt} | 7 +- .../FreeRoomInfoComponent.kt | 5 +- .../RoomEventListComponent.kt | 89 ++++++++++++++++++- 5 files changed, 112 insertions(+), 8 deletions(-) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/{RoomInfoComponent.kt => CommonRoomInfoComponent.kt} (97%) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt index f67da19f..4bafaee0 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt @@ -1,6 +1,8 @@ package band.effective.office.tablet.ui.mainScreen.components import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -18,6 +20,7 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { when { room.isFree() -> { FreeRoomInfoComponent( + modifier = Modifier.padding(25.dp), name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -25,8 +28,10 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { nextEvent = room.eventList.firstOrNull() ) } + room.isBusy() -> { BusyRoomInfoComponent( + modifier = Modifier.padding(25.dp), name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -35,7 +40,8 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { ) } } - RoomEventListComponent(room.eventList) + Spacer(modifier = Modifier.height(30.dp)) + RoomEventListComponent(modifier = Modifier.padding(25.dp), eventsList = room.eventList) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt index 73f7fe5b..c16c428d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.features.roomInfo.MainRes @@ -9,9 +10,15 @@ import java.util.Calendar @Composable fun BusyRoomInfoComponent( - name: String, capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, event: EventInfo? + modifier: Modifier = Modifier, + name: String, + capacity: Int, + isHaveTv: Boolean, + electricSocketCount: Int, + event: EventInfo? ) { - RoomInfoComponent( + CommonRoomInfoComponent( + modifier = modifier, name = name, capacity = capacity, isHaveTv = isHaveTv, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt similarity index 97% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt index 7831dd89..c46bc2f6 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt @@ -28,7 +28,8 @@ import io.github.skeptick.libres.compose.painterResource import io.github.skeptick.libres.images.Image @Composable -fun RoomInfoComponent( +fun CommonRoomInfoComponent( + modifier: Modifier = Modifier, name: String, capacity: Int, isHaveTv: Boolean, @@ -37,10 +38,10 @@ fun RoomInfoComponent( backgroundColor: Color ) { Surface( - modifier = Modifier.background(color = backgroundColor).padding(25.dp).fillMaxWidth(), + modifier = Modifier.background(color = backgroundColor).fillMaxWidth(), color = backgroundColor ) { - Column { + Column(modifier = modifier) { Row( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.SpaceBetween, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt index e0629679..98b8e1b4 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.features.roomInfo.MainRes @@ -9,13 +10,15 @@ import java.util.Calendar @Composable fun FreeRoomInfoComponent( + modifier: Modifier = Modifier, name: String, capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, nextEvent: EventInfo? ) { - RoomInfoComponent( + CommonRoomInfoComponent( + modifier = modifier, name = name, capacity = capacity, isHaveTv = isHaveTv, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt index a634b98f..18f7dc7e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt @@ -1,9 +1,96 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.lazy.LazyColumn +import androidx.compose.foundation.lazy.LazyListState +import androidx.compose.foundation.lazy.items +import androidx.compose.foundation.lazy.rememberLazyListState +import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.drawWithContent +import androidx.compose.ui.geometry.CornerRadius +import androidx.compose.ui.geometry.Offset +import androidx.compose.ui.geometry.Size +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.Dp +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.utils.CalendarStringConverter +import java.util.Calendar @Composable -fun RoomEventListComponent(eventsList: List) { +fun RoomEventListComponent(modifier: Modifier = Modifier, eventsList: List) { + Column(modifier = modifier) { + Text( + text = "Занятое время", + fontSize = 17.sp, + color = Color(0xFF808080) + ) + Row { + val lazyListState: LazyListState = rememberLazyListState() + LazyColumn( + modifier = Modifier.fillMaxWidth().simpleVerticalScrollbar(lazyListState), + state = lazyListState + ) { + items(eventsList) { event -> + Spacer(modifier = Modifier.height(30.dp)) + Row { + Text( + text = "${event.startTime.time()} - ${event.finishTime.time()}", + fontSize = 18.sp, + color = Color(0xFFFAFAFA) + ) + Text( + text = " · ${event.organizer}", + fontSize = 18.sp, + color = Color(0xFF808080) + ) + } + } + } + } + } +} + +private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") + +//NOTE(Maksim Mishenko): scrollBar: https://stackoverflow.com/questions/66341823/jetpack-compose-scrollbars +//drawRoundRect: https://semicolonspace.com/jetpack-compose-canvas-drawroundrect/ +@Composable +fun Modifier.simpleVerticalScrollbar( + state: LazyListState, + width: Dp = 8.dp +): Modifier { + return drawWithContent { + drawContent() + + val firstVisibleElementIndex = state.layoutInfo.visibleItemsInfo.firstOrNull()?.index + + val elementHeight = this.size.height / state.layoutInfo.totalItemsCount + val scrollbarOffsetY = (firstVisibleElementIndex ?: 0) * elementHeight + val scrollbarHeight = state.layoutInfo.visibleItemsInfo.size * elementHeight + val cornerRadius = CornerRadius(x = 36.dp.toPx(), y = 36.dp.toPx()) + + if (scrollbarHeight != size.height) { + drawRoundRect( + color = Color(0xFF4D4D4D), + topLeft = Offset(this.size.width - width.toPx(), 0f), + size = Size(width.toPx(), size.height), + cornerRadius = cornerRadius + ) + drawRoundRect( + color = Color(0xFF808080), + topLeft = Offset(this.size.width - width.toPx(), scrollbarOffsetY), + size = Size(width.toPx(), scrollbarHeight), + cornerRadius = cornerRadius + ) + } + } } \ No newline at end of file -- GitLab From 27e66752ac73f4feaecb3652080d45ffd94f8f8a Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 11:27:11 +0600 Subject: [PATCH 09/63] [~] make clock update --- .../roomInfoComponents/DateTimeComponent.kt | 29 +++++++++++++++++-- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt index 6a2c0b86..050f7b95 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt @@ -1,5 +1,8 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +import android.os.Build +import android.widget.TextClock +import androidx.annotation.RequiresApi import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.width @@ -10,15 +13,35 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import androidx.compose.ui.viewinterop.AndroidView +@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun DateTimeComponent(modifier: Modifier = Modifier) { Row( modifier = modifier, verticalAlignment = Alignment.Bottom ) { - Text(text = "17:49", color = Color(0xFFFAFAFA), fontSize = 30.sp) + AndroidView( + factory = { context -> + TextClock(context).apply { + format24Hour = "HH:mm" + format12Hour = "hh:mm a" + textSize = 30f + setTextColor(android.graphics.Color.WHITE) + } + } + ) Spacer(modifier = Modifier.width(10.dp)) - Text(text = "28 июня, среда", color = Color(0xFFFAFAFA), fontSize = 25.sp) + AndroidView( + factory = { context -> + TextClock(context).apply { + format24Hour = "d MMMM, EEE" + format12Hour = "d MMMM, EEE" + textSize = 25f + setTextColor(android.graphics.Color.WHITE) + } + } + ) } -} \ No newline at end of file +} -- GitLab From 403387dcd1319abf2dbb1240aa6d8c0edcec44c3 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 12:13:43 +0600 Subject: [PATCH 10/63] [~] add more cases in mock --- .../tablet/network/MockRoomInfoRepository.kt | 56 ++++++++++++++----- .../components/MainScreenComponent.kt | 3 + .../components/RoomInfoComponent.kt | 3 + .../roomInfoComponents/DateTimeComponent.kt | 4 +- 4 files changed, 49 insertions(+), 17 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt index 65cd4ce6..bc98679b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt @@ -2,41 +2,67 @@ package band.effective.office.tablet.network import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo +import java.util.Calendar import java.util.GregorianCalendar -class MockRoomInfoRepository: RoomInfoRepository { +class MockRoomInfoRepository : RoomInfoRepository { + private fun isBusy() = false + private fun isManyEvent() = false - private val currentEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), + private val startCurrentEvent: Calendar + private val finishCurrentEvent: Calendar + private val currentTime: Calendar + + init { + val calendar = GregorianCalendar() + calendar.add(Calendar.MINUTE, -10) + startCurrentEvent = calendar.clone() as Calendar + calendar.add(Calendar.MINUTE, 30) + finishCurrentEvent = calendar.clone() as Calendar + currentTime = calendar.clone() as Calendar + } + + fun getTime(): Calendar{ + currentTime.add(Calendar.MINUTE, 30) + return currentTime.clone() as Calendar + } + + private fun currentEvent() = EventInfo( + startTime = startCurrentEvent, + finishTime = finishCurrentEvent, organizer = "Ольга Белозерова" ) - private val olyaEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), + private fun olyaEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), organizer = "Ольга Белозерова" ) - private val matveyEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), + private fun matveyEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), organizer = "Матвей Авгуль" ) - private val lilaEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), + private fun lilaEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), organizer = "Лилия Акентьева" ) + private fun eventsList() = listOf(olyaEvent(), matveyEvent(), lilaEvent()) + + private fun bigEventList() = + eventsList() + eventsList() + eventsList() + eventsList() + eventsList() + override fun getRoomInfo(name: String): RoomInfo = RoomInfo( name = "Sirius", capacity = 8, isHaveTv = true, electricSocketCount = 4, - eventList = listOf(olyaEvent,matveyEvent,lilaEvent), - currentEvent = currentEvent + eventList = if (isManyEvent()) bigEventList() else eventsList(), + currentEvent = if (isBusy()) currentEvent() else null ) } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt index d664e26e..81dd6727 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt @@ -1,5 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.components +import android.os.Build +import androidx.annotation.RequiresApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight @@ -10,6 +12,7 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.RoomInfo +@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit) { /*NOTE(Maksim Mishenko): diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt index 4bafaee0..ec1badbb 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt @@ -1,5 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.components +import android.os.Build +import androidx.annotation.RequiresApi import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.height @@ -13,6 +15,7 @@ import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents. import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.FreeRoomInfoComponent import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomEventListComponent +@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { Column(modifier = modifier) { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt index 050f7b95..c34feeb7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt @@ -36,8 +36,8 @@ fun DateTimeComponent(modifier: Modifier = Modifier) { AndroidView( factory = { context -> TextClock(context).apply { - format24Hour = "d MMMM, EEE" - format12Hour = "d MMMM, EEE" + format24Hour = "d MMMM, EEEE" + format12Hour = "d MMMM, EEEE" textSize = 25f setTextColor(android.graphics.Color.WHITE) } -- GitLab From eb02fa32a227249414797ab2fc3af267af4ef05b Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 13:57:14 +0600 Subject: [PATCH 11/63] [+] add mock controller to manage mock --- .../office/tablet/di/CommonModule.kt | 2 + .../office/tablet/domain/MockController.kt | 7 ++ .../tablet/network/MockRoomInfoRepository.kt | 27 ++++++-- .../tablet/ui/mainScreen/MainComponent.kt | 39 ++--------- .../office/tablet/ui/mainScreen/MainScreen.kt | 6 +- .../tablet/ui/mainScreen/RealMainComponent.kt | 52 +++++++++++++++ .../components/MainScreenComponent.kt | 11 +++- .../mockComponets/MockSettingView.kt | 51 +++++++++++++++ .../mockComponets/MockSettingsComponent.kt | 8 +++ .../mockComponets/MockSettingsEvent.kt | 7 ++ .../components/mockComponets/MockState.kt | 7 ++ .../RealMockSettingsComponent.kt | 44 +++++++++++++ .../BusyRoomInfoComponent.kt | 65 +++++++++++++++---- .../CommonRoomInfoComponent.kt | 15 +---- .../RoomInfoComponent.kt | 6 +- .../office/tablet/ui/root/RootComponent.kt | 6 +- 16 files changed, 275 insertions(+), 78 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/{ => roomInfoComponents}/RoomInfoComponent.kt (76%) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt index d8003802..e04d1fce 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.di +import band.effective.office.tablet.domain.MockController import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.domain.RoomInteractorImpl import band.effective.office.tablet.network.MockRoomInfoRepository @@ -7,6 +8,7 @@ import band.effective.office.tablet.network.RoomInfoRepository import org.koin.dsl.module val commonModule = module { + single { MockController() } single { MockRoomInfoRepository() } single { RoomInteractorImpl(get()) } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt new file mode 100644 index 00000000..d91805dc --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.domain + +data class MockController( + var isBusy: Boolean = false, + var isManyEvent: Boolean = false, + var isHaveTV: Boolean = false +) \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt index bc98679b..b36cb8a5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt @@ -1,13 +1,18 @@ package band.effective.office.tablet.network +import band.effective.office.tablet.domain.MockController import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject import java.util.Calendar import java.util.GregorianCalendar -class MockRoomInfoRepository : RoomInfoRepository { - private fun isBusy() = false - private fun isManyEvent() = false +class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { + private val mockController: MockController by inject() + private fun isBusy() = mockController.isBusy + private fun isManyEvent() = mockController.isManyEvent + private fun isHaveTv() = mockController.isHaveTV private val startCurrentEvent: Calendar private val finishCurrentEvent: Calendar @@ -22,7 +27,13 @@ class MockRoomInfoRepository : RoomInfoRepository { currentTime = calendar.clone() as Calendar } - fun getTime(): Calendar{ + private fun updateCurrentTime() { + val calendar = GregorianCalendar() + calendar.add(Calendar.MINUTE, 20) + currentTime.time = calendar.time + } + + private fun getTime(): Calendar { currentTime.add(Calendar.MINUTE, 30) return currentTime.clone() as Calendar } @@ -56,13 +67,15 @@ class MockRoomInfoRepository : RoomInfoRepository { private fun bigEventList() = eventsList() + eventsList() + eventsList() + eventsList() + eventsList() - override fun getRoomInfo(name: String): RoomInfo = - RoomInfo( + override fun getRoomInfo(name: String): RoomInfo { + updateCurrentTime() + return RoomInfo( name = "Sirius", capacity = 8, - isHaveTv = true, + isHaveTv = isHaveTv(), electricSocketCount = 4, eventList = if (isManyEvent()) bigEventList() else eventsList(), currentEvent = if (isBusy()) currentEvent() else null ) + } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index 1813ec8e..e9cad36d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -1,37 +1,10 @@ package band.effective.office.tablet.ui.mainScreen -import band.effective.office.tablet.domain.RoomInteractor -import band.effective.office.tablet.domain.RoomInteractorImpl -import band.effective.office.tablet.network.MockRoomInfoRepository -import band.effective.office.tablet.ui.mainScreen.MainScreenEvent -import band.effective.office.tablet.ui.mainScreen.MainScreenState -import com.arkivanov.decompose.ComponentContext -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.update -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject +import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent +import kotlinx.coroutines.flow.StateFlow -class MainComponent( - componentContext: ComponentContext, - private val onClick: () -> Unit, -) : ComponentContext by componentContext, KoinComponent { - - private val interactor: RoomInteractor by inject() - - private var mutableState = MutableStateFlow(MainScreenState.defaultState) - val state = mutableState.asStateFlow() - - init { - mutableState.update { it.copy(isLoad = false, isData = true, roomInfo = interactor.getRoomInfo("sirius")) } - } - - fun sendEvent(event: MainScreenEvent) = - when (event) { - is MainScreenEvent.OnCLick -> { - onClick() - } - - is MainScreenEvent.OnDoubleTub -> {} - } +interface MainComponent { + val state: StateFlow + val mockSettingsComponent: MockSettingsComponent + fun sendEvent(event: MainScreenEvent) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index 0bc2765e..ff634f9e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -1,10 +1,13 @@ package band.effective.office.tablet.ui.mainScreen +import android.os.Build +import androidx.annotation.RequiresApi import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import band.effective.office.tablet.ui.mainScreen.components.MainScreenComponent +@RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreen(component: MainComponent) { val state by component.state.collectAsState() @@ -14,7 +17,8 @@ fun MainScreen(component: MainComponent) { state.isData -> { MainScreenComponent( room = state.roomInfo, - onSelectOtherRoom = { component.sendEvent(MainScreenEvent.OnCLick) } + onSelectOtherRoom = { component.sendEvent(MainScreenEvent.OnCLick) }, + mockComponent = component.mockSettingsComponent ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt new file mode 100644 index 00000000..a3a8d0c9 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -0,0 +1,52 @@ +package band.effective.office.tablet.ui.mainScreen + +import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.decompose.childContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class RealMainComponent( + componentContext: ComponentContext, + private val onClick: () -> Unit +) : ComponentContext by componentContext, KoinComponent, MainComponent { + + private val interactor: RoomInteractor by inject() + + private var mutableState = MutableStateFlow(MainScreenState.defaultState) + override val state = mutableState.asStateFlow() + + override val mockSettingsComponent: MockSettingsComponent = + RealMockSettingsComponent( + componentContext = childContext(key = "mock"), + updateData = { updateData() } + ) + + init { + updateData() + } + + private fun updateData() { + mutableState.update { + it.copy( + isLoad = false, + isData = true, + roomInfo = interactor.getRoomInfo("sirius") + ) + } + } + + override fun sendEvent(event: MainScreenEvent) = + when (event) { + is MainScreenEvent.OnCLick -> { + onClick() + } + + is MainScreenEvent.OnDoubleTub -> {} + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt index 81dd6727..4e62b069 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt @@ -3,6 +3,7 @@ package band.effective.office.tablet.ui.mainScreen.components import android.os.Build import androidx.annotation.RequiresApi import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize @@ -11,10 +12,13 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingView +import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomInfoComponent @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable -fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit) { +fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit, mockComponent: MockSettingsComponent) { /*NOTE(Maksim Mishenko): * infoViewWidth is part of the width occupied by roomInfoView * infoViewWidth = infoViewFrame.width / mainScreenFrame.width @@ -25,6 +29,9 @@ fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit) { modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), room = room ) - BookingRoomView(onSelectOtherRoom) + Column { + MockSettingView(mockComponent) + BookingRoomView(onSelectOtherRoom) + } } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt new file mode 100644 index 00000000..d0b2fcd2 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt @@ -0,0 +1,51 @@ +package band.effective.office.tablet.ui.mainScreen.components.mockComponets + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.material.Checkbox +import androidx.compose.material.CheckboxDefaults +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.graphics.Color + +@Composable +fun MockSettingView(component: MockSettingsComponent) { + val state by component.state.collectAsState() + + Column { + Item( + checked = state.isBusy, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchBusy(it)) }, + text = "Комната занята" + ) + Item( + checked = state.isManyEvent, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchEventCount(it)) }, + text = "Много меропритий" + ) + Item( + checked = state.isHaveTv, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchTv(it)) }, + text = "Есть tv" + ) + } +} + +@Composable +private fun Item(checked: Boolean, onCheckedChange: (Boolean) -> Unit, text: String) { + Row( + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Center + ) { + Checkbox( + checked = checked, + onCheckedChange = { onCheckedChange(it) }, + colors = CheckboxDefaults.colors(uncheckedColor = Color.White), + ) + Text(text = text, color = Color.White) + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt new file mode 100644 index 00000000..fe69efe9 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.ui.mainScreen.components.mockComponets + +import kotlinx.coroutines.flow.StateFlow + +interface MockSettingsComponent { + val state: StateFlow + fun sendEvent(event: MockSettingsEvent) +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt new file mode 100644 index 00000000..78852f06 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.ui.mainScreen.components.mockComponets + +sealed interface MockSettingsEvent{ + data class OnSwitchEventCount(val newState: Boolean): MockSettingsEvent + data class OnSwitchBusy(val newState: Boolean): MockSettingsEvent + data class OnSwitchTv(val newState: Boolean): MockSettingsEvent +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt new file mode 100644 index 00000000..64b789e4 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.ui.mainScreen.components.mockComponets + +data class MockState( + val isBusy: Boolean = false, + val isManyEvent: Boolean = false, + val isHaveTv: Boolean = false +) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt new file mode 100644 index 00000000..a8d1e4bb --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt @@ -0,0 +1,44 @@ +package band.effective.office.tablet.ui.mainScreen.components.mockComponets + +import band.effective.office.tablet.domain.MockController +import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class RealMockSettingsComponent( + componentContext: ComponentContext, + private val updateData: () -> Unit +) : ComponentContext by componentContext, KoinComponent, MockSettingsComponent { + private var mutableState = MutableStateFlow(MockState()) + override val state = mutableState.asStateFlow() + + private val mockController: MockController by inject() + + init { + reloadData() + } + + private fun reloadData(){ + mutableState.update { + MockState( + isBusy = mockController.isBusy, + isManyEvent = mockController.isManyEvent, + isHaveTv = mockController.isHaveTV + ) + } + } + + override fun sendEvent(event: MockSettingsEvent) { + when(event){ + is MockSettingsEvent.OnSwitchBusy -> mockController.isBusy = event.newState + is MockSettingsEvent.OnSwitchEventCount -> mockController.isManyEvent = event.newState + is MockSettingsEvent.OnSwitchTv -> mockController.isHaveTV = event.newState + } + reloadData() + updateData() + } + +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt index c16c428d..87423fe3 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt @@ -1,8 +1,22 @@ package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Surface +import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.features.roomInfo.MainRes import band.effective.office.tablet.utils.CalendarStringConverter @@ -17,19 +31,44 @@ fun BusyRoomInfoComponent( electricSocketCount: Int, event: EventInfo? ) { - CommonRoomInfoComponent( - modifier = modifier, - name = name, - capacity = capacity, - isHaveTv = isHaveTv, - electricSocketCount = electricSocketCount, - roomOccupancy = MainRes.string.room_occupancy.format( - startTime = event?.startTime?.time() ?: "", - finishTime = event?.finishTime?.time() ?: "", - organizer = event?.organizer ?: "" - ), - backgroundColor = Color(0xFFF94C4C) - ) + val backgroundColor = Color(0xFFF94C4C) + Surface { + CommonRoomInfoComponent( + modifier = modifier, + name = name, + capacity = capacity, + isHaveTv = isHaveTv, + electricSocketCount = electricSocketCount, + roomOccupancy = MainRes.string.room_occupancy.format( + startTime = event?.startTime?.time() ?: "", + finishTime = event?.finishTime?.time() ?: "", + organizer = event?.organizer ?: "" + ), + backgroundColor = backgroundColor + ) + Box( + modifier = modifier.fillMaxWidth(), + contentAlignment = Alignment.TopEnd + ){ + Button( + modifier = Modifier + .height(60.dp) + .width(150.dp) + .background(color = backgroundColor).border( + width = 3.dp, + color = Color(0xFFFAFAFA), + shape = RoundedCornerShape(70.dp), + ), + colors = ButtonDefaults.buttonColors( + backgroundColor = backgroundColor, + contentColor = backgroundColor + ), + onClick = {}) { + Text(text = MainRes.string.stop_meeting_button, color = Color(0xFFFAFAFA)) + } + } + } + } private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt index c46bc2f6..0c6e0ad6 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt @@ -52,20 +52,7 @@ fun CommonRoomInfoComponent( color = Color(0xFFFAFAFA), fontSize = 60.sp ) - Button( - modifier = Modifier - .background(color = backgroundColor).border( - width = 3.dp, - color = Color(0xFFFAFAFA), - shape = RoundedCornerShape(20.dp), - ), - colors = ButtonDefaults.buttonColors( - backgroundColor = backgroundColor, - contentColor = backgroundColor - ), - onClick = {}) { - Text(text = MainRes.string.stop_meeting_button, color = Color(0xFFFAFAFA)) - } + } Spacer(modifier = Modifier.height(20.dp)) Text( diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt similarity index 76% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt index ec1badbb..ccd5ab59 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components +package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents import android.os.Build import androidx.annotation.RequiresApi @@ -10,10 +10,6 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.RoomInfo -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.BusyRoomInfoComponent -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.DateTimeComponent -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.FreeRoomInfoComponent -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomEventListComponent @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 03a885d1..48fc00a9 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,6 +1,6 @@ package band.effective.office.tablet.ui.root -import band.effective.office.tablet.ui.mainScreen.MainComponent +import band.effective.office.tablet.ui.mainScreen.RealMainComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack @@ -26,7 +26,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co ): Child = when (config) { is Config.Main -> { - Child.MainChild(MainComponent( + Child.MainChild(RealMainComponent( componentContext = componentContext, onClick = { navigation.push(Config.SelectRoom) @@ -41,7 +41,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co sealed class Child { data class SelectRoomChild(val component: SelectRoomComponent) : Child() - data class MainChild(val component: MainComponent) : Child() + data class MainChild(val component: RealMainComponent) : Child() } sealed class Config : Parcelable { -- GitLab From 38d2c1599f3a443cf4be3bd0e59d79f42a61b283 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 16:03:10 +0600 Subject: [PATCH 12/63] [~] add comments --- .../office/tablet/di/CommonModule.kt | 1 + .../office/tablet/domain/MockController.kt | 1 + .../office/tablet/domain/RoomInteractor.kt | 2 ++ .../tablet/network/MockRoomInfoRepository.kt | 3 +++ .../tablet/network/RoomInfoRepository.kt | 2 ++ .../RealMockSettingsComponent.kt | 1 + .../BusyRoomInfoComponent.kt | 4 +++- .../CommonRoomInfoComponent.kt | 20 +++++++------------ .../roomInfoComponents/DateTimeComponent.kt | 5 +---- .../roomInfoComponents/RoomInfoComponent.kt | 9 +++++---- 10 files changed, 26 insertions(+), 22 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt index e04d1fce..5a4aa86c 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt @@ -7,6 +7,7 @@ import band.effective.office.tablet.network.MockRoomInfoRepository import band.effective.office.tablet.network.RoomInfoRepository import org.koin.dsl.module +/*NOTE(Maksim Mishenko) write one di module because few dependence now*/ val commonModule = module { single { MockController() } single { MockRoomInfoRepository() } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt index d91805dc..e9f011b7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.domain +/**Contain mock's fields*/ data class MockController( var isBusy: Boolean = false, var isManyEvent: Boolean = false, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt index 18e21eb4..19a6747d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt @@ -2,6 +2,8 @@ package band.effective.office.tablet.domain import band.effective.office.tablet.domain.model.RoomInfo +/**Interface for get information about room and send booking request*/ interface RoomInteractor { + /**Get room information by room's name*/ fun getRoomInfo(name: String): RoomInfo } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt index b36cb8a5..3cbc12a3 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt @@ -16,6 +16,7 @@ class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { private val startCurrentEvent: Calendar private val finishCurrentEvent: Calendar + /**It's field contain time for mocks, when it is used it needs to be increment, so that different mocks have different times*/ private val currentTime: Calendar init { @@ -27,12 +28,14 @@ class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { currentTime = calendar.clone() as Calendar } + /**Reset current time field*/ private fun updateCurrentTime() { val calendar = GregorianCalendar() calendar.add(Calendar.MINUTE, 20) currentTime.time = calendar.time } + /**Get and increment current time*/ private fun getTime(): Calendar { currentTime.add(Calendar.MINUTE, 30) return currentTime.clone() as Calendar diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt index a26c8f01..a230bf5f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt @@ -2,6 +2,8 @@ package band.effective.office.tablet.network import band.effective.office.tablet.domain.model.RoomInfo +/**Repository for get information about rooms*/ interface RoomInfoRepository { + /**Get information about room by room's name*/ fun getRoomInfo(name: String): RoomInfo } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt index a8d1e4bb..17f3a727 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt @@ -21,6 +21,7 @@ class RealMockSettingsComponent( reloadData() } + /**Synchronize data in mock controller and in state*/ private fun reloadData(){ mutableState.update { MockState( diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt index 87423fe3..b6621155 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt @@ -15,6 +15,7 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.EventInfo @@ -52,6 +53,7 @@ fun BusyRoomInfoComponent( ){ Button( modifier = Modifier + .clip(shape = RoundedCornerShape(70.dp)) .height(60.dp) .width(150.dp) .background(color = backgroundColor).border( @@ -61,7 +63,7 @@ fun BusyRoomInfoComponent( ), colors = ButtonDefaults.buttonColors( backgroundColor = backgroundColor, - contentColor = backgroundColor + contentColor = Color(0xFFFFFFFF) ), onClick = {}) { Text(text = MainRes.string.stop_meeting_button, color = Color(0xFFFAFAFA)) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt index 0c6e0ad6..02239e73 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt @@ -42,25 +42,18 @@ fun CommonRoomInfoComponent( color = backgroundColor ) { Column(modifier = modifier) { - Row( - modifier = Modifier.fillMaxWidth(), - horizontalArrangement = Arrangement.SpaceBetween, - verticalAlignment = Alignment.CenterVertically - ) { - Text( - text = name, - color = Color(0xFFFAFAFA), - fontSize = 60.sp - ) - - } + Text( + text = name, + color = Color(0xFFFAFAFA), + fontSize = 60.sp + ) Spacer(modifier = Modifier.height(20.dp)) Text( text = roomOccupancy, color = Color(0xFFFAFAFA), fontSize = 27.sp ) - Spacer(modifier = Modifier.height(40.dp)) + Spacer(modifier = Modifier.height(25.dp)) Row(modifier = Modifier.padding(horizontal = 10.dp)) { val spaceBetweenProperty = 40.dp RoomPropertyComponent(image = MainRes.image.quantity, text = "$capacity") @@ -95,6 +88,7 @@ fun CommonRoomInfoComponent( ) } } + Spacer(modifier = Modifier.height(20.dp)) } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt index c34feeb7..0d412a8b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt @@ -6,13 +6,10 @@ import androidx.annotation.RequiresApi import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.width -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import androidx.compose.ui.viewinterop.AndroidView @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @@ -44,4 +41,4 @@ fun DateTimeComponent(modifier: Modifier = Modifier) { } ) } -} +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt index ccd5ab59..42ac5c3f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt @@ -14,12 +14,13 @@ import band.effective.office.tablet.domain.model.RoomInfo @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { + val paddings = 30.dp Column(modifier = modifier) { - DateTimeComponent(modifier = Modifier.padding(25.dp)) + DateTimeComponent(modifier = Modifier.padding(paddings)) when { room.isFree() -> { FreeRoomInfoComponent( - modifier = Modifier.padding(25.dp), + modifier = Modifier.padding(paddings), name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -30,7 +31,7 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { room.isBusy() -> { BusyRoomInfoComponent( - modifier = Modifier.padding(25.dp), + modifier = Modifier.padding(paddings), name = room.name, capacity = room.capacity, isHaveTv = room.isHaveTv, @@ -40,7 +41,7 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { } } Spacer(modifier = Modifier.height(30.dp)) - RoomEventListComponent(modifier = Modifier.padding(25.dp), eventsList = room.eventList) + RoomEventListComponent(modifier = Modifier.padding(paddings), eventsList = room.eventList) } } -- GitLab From d94b8c72f2a7f6a5d6a2373f5f50153217bd6239 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 18:28:01 +0600 Subject: [PATCH 13/63] [+] separate booking room view --- .../tablet/ui/mainScreen/MainComponent.kt | 2 + .../office/tablet/ui/mainScreen/MainScreen.kt | 8 ++-- .../tablet/ui/mainScreen/RealMainComponent.kt | 5 +++ .../mainScreen/components/BookingRoomView.kt | 12 ------ ...inScreenComponent.kt => MainScreenView.kt} | 19 +++++++-- .../BookingRoomComponent.kt | 13 ++++++ .../bookingRoomComponents/BookingRoomState.kt | 15 +++++++ .../bookingRoomComponents/BookingRoomView.kt | 40 +++++++++++++++++++ .../BookingRoomViewEvent.kt | 6 +++ .../RealBookingRoomComponent.kt | 39 ++++++++++++++++++ .../RealDateTimeComponent.kt | 9 +++++ .../RealEventLengthComponent.kt | 11 +++++ .../RealEventOrganizerComponent.kt | 6 +++ 13 files changed, 165 insertions(+), 20 deletions(-) delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/{MainScreenComponent.kt => MainScreenView.kt} (67%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index e9cad36d..03297ff7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -1,10 +1,12 @@ package band.effective.office.tablet.ui.mainScreen +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import kotlinx.coroutines.flow.StateFlow interface MainComponent { val state: StateFlow val mockSettingsComponent: MockSettingsComponent + val bookingRoomComponent: BookingRoomComponent fun sendEvent(event: MainScreenEvent) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index ff634f9e..1fa780f8 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -5,7 +5,7 @@ import androidx.annotation.RequiresApi import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import band.effective.office.tablet.ui.mainScreen.components.MainScreenComponent +import band.effective.office.tablet.ui.mainScreen.components.MainScreenView @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable @@ -15,10 +15,10 @@ fun MainScreen(component: MainComponent) { state.isError -> {} state.isLoad -> {} state.isData -> { - MainScreenComponent( + MainScreenView( room = state.roomInfo, - onSelectOtherRoom = { component.sendEvent(MainScreenEvent.OnCLick) }, - mockComponent = component.mockSettingsComponent + mockComponent = component.mockSettingsComponent, + bookingRoomComponent = component.bookingRoomComponent ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index a3a8d0c9..7e18beab 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -1,6 +1,8 @@ package band.effective.office.tablet.ui.mainScreen import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealBookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent import com.arkivanov.decompose.ComponentContext @@ -26,6 +28,9 @@ class RealMainComponent( componentContext = childContext(key = "mock"), updateData = { updateData() } ) + override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( + componentContext = childContext(key = "bookingRoom"), + onSelectOtherRoom = { onClick() }) init { updateData() diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt deleted file mode 100644 index dbd2532e..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/BookingRoomView.kt +++ /dev/null @@ -1,12 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components - -import androidx.compose.material.Button -import androidx.compose.material.Text -import androidx.compose.runtime.Composable - -@Composable -fun BookingRoomView(onSelectOtherRoom: () -> Unit){ - Button(onClick = { onSelectOtherRoom() }) { - Text(text = "SelectOtherRoom") - } -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt similarity index 67% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 4e62b069..22a9ee00 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -8,17 +8,25 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomView import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingView import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomInfoComponent @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable -fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit, mockComponent: MockSettingsComponent) { +fun MainScreenView( + room: RoomInfo, + mockComponent: MockSettingsComponent, + bookingRoomComponent: BookingRoomComponent +) { /*NOTE(Maksim Mishenko): * infoViewWidth is part of the width occupied by roomInfoView * infoViewWidth = infoViewFrame.width / mainScreenFrame.width @@ -29,9 +37,12 @@ fun MainScreenComponent(room: RoomInfo, onSelectOtherRoom: () -> Unit, mockCompo modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), room = room ) - Column { - MockSettingView(mockComponent) - BookingRoomView(onSelectOtherRoom) + Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { + BookingRoomView( + modifier = Modifier.fillMaxSize(), + bookingRoomComponent = bookingRoomComponent + ) + //MockSettingView(mockComponent) } } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt new file mode 100644 index 00000000..bfffb1b7 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt @@ -0,0 +1,13 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import kotlinx.coroutines.flow.StateFlow + +interface BookingRoomComponent { + val state: StateFlow + + val dateTimeComponent: RealDateTimeComponent + val eventLengthComponent: RealEventLengthComponent + val eventOrganizerComponent: RealEventOrganizerComponent + + fun sendEvent(event: BookingRoomViewEvent) +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt new file mode 100644 index 00000000..56e5407a --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt @@ -0,0 +1,15 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +data class BookingRoomState( + val length: Int, + val organizer: String, + val organizers: List +){ + companion object{ + val default = BookingRoomState( + length = 0, + organizer = "", + organizers = listOf() + ) + } +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt new file mode 100644 index 00000000..5eee9a6a --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -0,0 +1,40 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView + +@Composable +fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: BookingRoomComponent) { + val state by bookingRoomComponent.state.collectAsState() + Column(modifier = modifier) { + DateTimeView(component = bookingRoomComponent.dateTimeComponent) + EventLengthView( + modifier = Modifier.fillMaxWidth().height(100.dp).padding(25.dp), + component = bookingRoomComponent.eventLengthComponent, + currentLength = state.length + ) + EventOrganizerView(component = bookingRoomComponent.eventOrganizerComponent) + Button(onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { + Text(text = "SelectOtherRoom") + } + } +} + +@Composable +fun DateTimeView(component: RealDateTimeComponent) { + +} + +@Composable +fun EventOrganizerView(component: RealEventOrganizerComponent) { +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt new file mode 100644 index 00000000..2d3b5818 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt @@ -0,0 +1,6 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +sealed interface BookingRoomViewEvent{ + object OnBookingCurrentRoom: BookingRoomViewEvent + object OnBookingOtherOtherRoom: BookingRoomViewEvent +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt new file mode 100644 index 00000000..9c7a1e64 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -0,0 +1,39 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.decompose.childContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update + +class RealBookingRoomComponent( + componentContext: ComponentContext, + private val onSelectOtherRoom: () -> Unit +) : + ComponentContext by componentContext, BookingRoomComponent { + private var mutableState = MutableStateFlow(BookingRoomState.default) + override val state = mutableState.asStateFlow() + + override val dateTimeComponent: RealDateTimeComponent = + RealDateTimeComponent(childContext("dateTime")) + override val eventLengthComponent: RealEventLengthComponent = + RealEventLengthComponent(childContext("length"), + changeLength = { changeLength(it) }) + override val eventOrganizerComponent: RealEventOrganizerComponent = + RealEventOrganizerComponent(childContext("organizer")) + + override fun sendEvent(event: BookingRoomViewEvent) { + when (event) { + is BookingRoomViewEvent.OnBookingCurrentRoom -> {} + is BookingRoomViewEvent.OnBookingOtherOtherRoom -> { + onSelectOtherRoom() + } + } + } + + private fun changeLength(delta: Int) { + if (state.value.length + delta >= 0) { + mutableState.update { it.copy(length = it.length + delta) } + } + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt new file mode 100644 index 00000000..a0a1df6e --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import com.arkivanov.decompose.ComponentContext + +class RealDateTimeComponent( + componentContext: ComponentContext +) : ComponentContext by componentContext { + +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt new file mode 100644 index 00000000..770b2384 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt @@ -0,0 +1,11 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import com.arkivanov.decompose.ComponentContext + +class RealEventLengthComponent( + componentContext: ComponentContext, + private val changeLength: (Int) -> Unit +) : ComponentContext by componentContext { + fun increment() = changeLength(15) + fun decrement() = changeLength(-30) +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt new file mode 100644 index 00000000..30e44b0f --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt @@ -0,0 +1,6 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents + +import com.arkivanov.decompose.ComponentContext + +class RealEventOrganizerComponent(componentContext: ComponentContext): ComponentContext by componentContext { +} \ No newline at end of file -- GitLab From 17cf698c60b49f7812c5c292109c6d6b1e73778a Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 18:28:27 +0600 Subject: [PATCH 14/63] [+] design event length view --- .../uiComponents/EventLengthView.kt | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt new file mode 100644 index 00000000..190611d4 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -0,0 +1,60 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents + +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealEventLengthComponent + +@Composable +fun EventLengthView( + modifier: Modifier = Modifier, + component: RealEventLengthComponent, + currentLength: Int +) { + val space = 50.dp + Row( + modifier = modifier, + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween + ) { + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.decrement() } + ) { + Text( + text = "-30", + color = Color(0xFFFAFAFA), + fontSize = 20.sp + ) + } + Spacer(modifier = Modifier.width(space)) + Text( + text = "$currentLength мин", + color = Color(0xFFFAFAFA), + fontSize = 32.sp + ) + Spacer(modifier = Modifier.width(space)) + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.increment() } + ) { + Text( + text = "+15", + color = Color(0xFFFAFAFA), + fontSize = 20.sp + ) + } + } +} \ No newline at end of file -- GitLab From 9a1845a0edc1bdb4805856aab024119e4abed929 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 20:02:41 +0600 Subject: [PATCH 15/63] [+] design select date and time view --- .../mainScreen/components/MainScreenView.kt | 4 +- .../bookingRoomComponents/BookingRoomState.kt | 9 ++- .../bookingRoomComponents/BookingRoomView.kt | 38 ++++++---- .../RealBookingRoomComponent.kt | 50 ++++++++++++- .../RealDateTimeComponent.kt | 6 +- .../uiComponents/DateTimeView.kt | 72 +++++++++++++++++++ .../uiComponents/EventLengthView.kt | 62 +++++++++------- 7 files changed, 197 insertions(+), 44 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 22a9ee00..4e10d9c6 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -8,11 +8,13 @@ import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomView @@ -39,7 +41,7 @@ fun MainScreenView( ) Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { BookingRoomView( - modifier = Modifier.fillMaxSize(), + modifier = Modifier.fillMaxSize().padding(25.dp), bookingRoomComponent = bookingRoomComponent ) //MockSettingView(mockComponent) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt index 56e5407a..d0aa7aad 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt @@ -1,15 +1,20 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import java.util.Calendar +import java.util.GregorianCalendar + data class BookingRoomState( val length: Int, val organizer: String, - val organizers: List + val organizers: List, + val selectDate: Calendar ){ companion object{ val default = BookingRoomState( length = 0, organizer = "", - organizers = listOf() + organizers = listOf(), + selectDate = GregorianCalendar() ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index 5eee9a6a..a09587bf 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -1,40 +1,54 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.DateTimeView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView @Composable fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: BookingRoomComponent) { val state by bookingRoomComponent.state.collectAsState() Column(modifier = modifier) { - DateTimeView(component = bookingRoomComponent.dateTimeComponent) + Text( + text = "Занять", + color = Color(0xFFFAFAFA), + fontSize = 36.sp + ) + Spacer(modifier = Modifier.height(25.dp)) + DateTimeView( + modifier = Modifier.fillMaxWidth().height(100.dp), + component = bookingRoomComponent.dateTimeComponent, + selectDate = state.selectDate + ) + Spacer(modifier = Modifier.height(25.dp)) EventLengthView( - modifier = Modifier.fillMaxWidth().height(100.dp).padding(25.dp), + modifier = Modifier.fillMaxWidth().height(100.dp), component = bookingRoomComponent.eventLengthComponent, currentLength = state.length ) + Spacer(modifier = Modifier.height(25.dp)) EventOrganizerView(component = bookingRoomComponent.eventOrganizerComponent) - Button(onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { - Text(text = "SelectOtherRoom") + Spacer(modifier = Modifier.height(25.dp)) + Button( + modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { + Text(text = "Занять Sirius") } } } - -@Composable -fun DateTimeView(component: RealDateTimeComponent) { - -} - @Composable fun EventOrganizerView(component: RealEventOrganizerComponent) { -} \ No newline at end of file +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 9c7a1e64..9b8a666e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -2,12 +2,22 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomCompone import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext +import com.arkivanov.essenty.lifecycle.Lifecycle +import com.arkivanov.essenty.lifecycle.doOnDestroy +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.cancel +import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import java.util.Calendar +import java.util.GregorianCalendar class RealBookingRoomComponent( - componentContext: ComponentContext, + private val componentContext: ComponentContext, private val onSelectOtherRoom: () -> Unit ) : ComponentContext by componentContext, BookingRoomComponent { @@ -15,13 +25,17 @@ class RealBookingRoomComponent( override val state = mutableState.asStateFlow() override val dateTimeComponent: RealDateTimeComponent = - RealDateTimeComponent(childContext("dateTime")) + RealDateTimeComponent(childContext("dateTime"), changeDay = { changeDate(it) }) override val eventLengthComponent: RealEventLengthComponent = RealEventLengthComponent(childContext("length"), changeLength = { changeLength(it) }) override val eventOrganizerComponent: RealEventOrganizerComponent = RealEventOrganizerComponent(childContext("organizer")) + init { + updateSelectTime() + } + override fun sendEvent(event: BookingRoomViewEvent) { when (event) { is BookingRoomViewEvent.OnBookingCurrentRoom -> {} @@ -36,4 +50,36 @@ class RealBookingRoomComponent( mutableState.update { it.copy(length = it.length + delta) } } } + + private fun changeDate(day: Int) { + val newValue = state.value.selectDate.clone() as Calendar + newValue.add(Calendar.DAY_OF_MONTH, day) + mutableState.update { it.copy(selectDate = newValue) } + } + + //TODO + private fun updateSelectTime() { + componentCoroutineScope().launch { + while (true) { + val now = GregorianCalendar() + mutableState.update { it.copy(selectDate = now) } + delay((60 - now.get(Calendar.SECOND)) * 1000L) + } + } + } +} + +//https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 +fun ComponentContext.componentCoroutineScope(): CoroutineScope { + val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) + + if (lifecycle.state != Lifecycle.State.DESTROYED) { + lifecycle.doOnDestroy { + scope.cancel() + } + } else { + scope.cancel() + } + + return scope } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt index a0a1df6e..89f9cf4c 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt @@ -3,7 +3,9 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomCompone import com.arkivanov.decompose.ComponentContext class RealDateTimeComponent( - componentContext: ComponentContext + componentContext: ComponentContext, + private val changeDay: (Int) -> Unit ) : ComponentContext by componentContext { - + fun incrementDay() = changeDay(1) + fun decrementDay() = changeDay(-1) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt new file mode 100644 index 00000000..6e7617dc --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt @@ -0,0 +1,72 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents + +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealDateTimeComponent +import band.effective.office.tablet.utils.CalendarStringConverter +import java.util.Calendar + +@Composable +fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDate: Calendar) { + Column(modifier = modifier) { + Text( + text = "когда", + color = Color(0xFF808080), + fontSize = 16.sp + ) + Spacer(modifier = Modifier.height(10.dp)) + Row(modifier = Modifier.fillMaxSize()) { + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.decrementDay() } + ) { + Text( + text = "<", + color = Color(0xFF777777), + fontSize = 20.sp + ) + } + Spacer(modifier = Modifier.width(10.dp)) + Button( + modifier = Modifier.fillMaxHeight().weight(4f).clip(RoundedCornerShape(15.dp)), + onClick = { } + ) { + Text( + text = selectDate.dateTime(), + color = Color(0xFFFAFAFA), + fontSize = 20.sp + ) + } + Spacer(modifier = Modifier.width(10.dp)) + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.incrementDay() } + ) { + Text( + text = ">", + color = Color(0xFF777777), + fontSize = 20.sp + ) + } + } + } +} + + +private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") +private fun Calendar.date() = CalendarStringConverter.calendarToString(this, "dd MMMM") +private fun Calendar.dateTime() = "${date()} c ${time()}" \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt index 190611d4..b4cb7012 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -1,9 +1,12 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button @@ -24,37 +27,46 @@ fun EventLengthView( currentLength: Int ) { val space = 50.dp - Row( - modifier = modifier, - verticalAlignment = Alignment.CenterVertically, - horizontalArrangement = Arrangement.SpaceBetween - ) { - Button( - modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.decrement() } - ) { - Text( - text = "-30", - color = Color(0xFFFAFAFA), - fontSize = 20.sp - ) - } - Spacer(modifier = Modifier.width(space)) + Column(modifier = modifier) { Text( - text = "$currentLength мин", - color = Color(0xFFFAFAFA), - fontSize = 32.sp + text = "на сколько", + color = Color(0xFF808080), + fontSize = 16.sp ) - Spacer(modifier = Modifier.width(space)) - Button( - modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.increment() } + Spacer(modifier = Modifier.height(10.dp)) + Row( + modifier = Modifier.fillMaxSize(), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.SpaceBetween ) { + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.decrement() } + ) { + Text( + text = "-30", + color = Color(0xFFFAFAFA), + fontSize = 20.sp + ) + } + Spacer(modifier = Modifier.width(space)) Text( - text = "+15", + text = "$currentLength мин", color = Color(0xFFFAFAFA), - fontSize = 20.sp + fontSize = 32.sp ) + Spacer(modifier = Modifier.width(space)) + Button( + modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), + onClick = { component.increment() } + ) { + Text( + text = "+15", + color = Color(0xFFFAFAFA), + fontSize = 20.sp + ) + } } } + } \ No newline at end of file -- GitLab From 891ede27335e0016db0fc7f9907749489bee1dd4 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 4 Jul 2023 22:46:34 +0600 Subject: [PATCH 16/63] [+] design select organizer component --- .../office/tablet/domain/RoomInteractor.kt | 2 + .../tablet/domain/RoomInteractorImpl.kt | 1 + .../tablet/network/MockRoomInfoRepository.kt | 4 + .../tablet/network/RoomInfoRepository.kt | 2 + .../mainScreen/components/MainScreenView.kt | 4 +- .../bookingRoomComponents/BookingRoomView.kt | 69 ++++++++------ .../RealBookingRoomComponent.kt | 25 ++++- .../RealEventOrganizerComponent.kt | 24 ++++- .../uiComponents/BookingRoomView.kt | 95 +++++++++++++++++++ .../libres/images/arrow_to_down.svg | 5 + 10 files changed, 194 insertions(+), 37 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_down.svg diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt index 19a6747d..810f027f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt @@ -6,4 +6,6 @@ import band.effective.office.tablet.domain.model.RoomInfo interface RoomInteractor { /**Get room information by room's name*/ fun getRoomInfo(name: String): RoomInfo + + fun getOrganizers(): List } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt index 78ada386..e11c8d7a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt @@ -5,4 +5,5 @@ import band.effective.office.tablet.network.RoomInfoRepository class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository): RoomInteractor { override fun getRoomInfo(name: String): RoomInfo = roomInfoRepository.getRoomInfo(name) + override fun getOrganizers(): List = roomInfoRepository.getOrganizers() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt index 3cbc12a3..42a9a440 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt @@ -16,6 +16,7 @@ class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { private val startCurrentEvent: Calendar private val finishCurrentEvent: Calendar + /**It's field contain time for mocks, when it is used it needs to be increment, so that different mocks have different times*/ private val currentTime: Calendar @@ -81,4 +82,7 @@ class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { currentEvent = if (isBusy()) currentEvent() else null ) } + + override fun getOrganizers(): List = + listOf("Ольга Белозерова", "Матвей Авгуль", "Лилия Акентьева") } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt index a230bf5f..4c46495b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt @@ -6,4 +6,6 @@ import band.effective.office.tablet.domain.model.RoomInfo interface RoomInfoRepository { /**Get information about room by room's name*/ fun getRoomInfo(name: String): RoomInfo + + fun getOrganizers(): List } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 4e10d9c6..3a566c09 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -39,9 +39,9 @@ fun MainScreenView( modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), room = room ) - Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState())) { + Column(modifier = Modifier.fillMaxSize()) { BookingRoomView( - modifier = Modifier.fillMaxSize().padding(25.dp), + modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize().padding(25.dp), bookingRoomComponent = bookingRoomComponent ) //MockSettingView(mockComponent) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index a09587bf..548493c5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -1,15 +1,19 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button +import androidx.compose.material.Surface import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color @@ -17,38 +21,45 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.DateTimeView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventOrganizerView @Composable fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: BookingRoomComponent) { val state by bookingRoomComponent.state.collectAsState() - Column(modifier = modifier) { - Text( - text = "Занять", - color = Color(0xFFFAFAFA), - fontSize = 36.sp - ) - Spacer(modifier = Modifier.height(25.dp)) - DateTimeView( - modifier = Modifier.fillMaxWidth().height(100.dp), - component = bookingRoomComponent.dateTimeComponent, - selectDate = state.selectDate - ) - Spacer(modifier = Modifier.height(25.dp)) - EventLengthView( - modifier = Modifier.fillMaxWidth().height(100.dp), - component = bookingRoomComponent.eventLengthComponent, - currentLength = state.length - ) - Spacer(modifier = Modifier.height(25.dp)) - EventOrganizerView(component = bookingRoomComponent.eventOrganizerComponent) - Spacer(modifier = Modifier.height(25.dp)) - Button( - modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { - Text(text = "Занять Sirius") + Surface(modifier = modifier.fillMaxSize(), color = Color(0xFF252322)) { + Column(modifier = Modifier.fillMaxSize()) { + Spacer(modifier = Modifier.height(63.dp)) + Text( + text = "Занять", + color = Color(0xFFFAFAFA), + fontSize = 36.sp + ) + Spacer(modifier = Modifier.height(25.dp)) + DateTimeView( + modifier = Modifier.fillMaxWidth().height(100.dp), + component = bookingRoomComponent.dateTimeComponent, + selectDate = state.selectDate + ) + Spacer(modifier = Modifier.height(25.dp)) + EventLengthView( + modifier = Modifier.fillMaxWidth().height(100.dp), + component = bookingRoomComponent.eventLengthComponent, + currentLength = state.length + ) + Spacer(modifier = Modifier.height(25.dp)) + EventOrganizerView( + modifier = Modifier.fillMaxWidth().height(100.dp), + component = bookingRoomComponent.eventOrganizerComponent, + organizers = state.organizers + ) + Spacer(modifier = Modifier.height(25.dp)) + } + Box(Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) { + Button( + modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { + Text(text = "Занять Sirius") + } } } -} -@Composable -fun EventOrganizerView(component: RealEventOrganizerComponent) { -} +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 9b8a666e..0ffdf72a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import band.effective.office.tablet.domain.RoomInteractor import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import com.arkivanov.essenty.lifecycle.Lifecycle @@ -13,6 +14,8 @@ import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject import java.util.Calendar import java.util.GregorianCalendar @@ -20,20 +23,28 @@ class RealBookingRoomComponent( private val componentContext: ComponentContext, private val onSelectOtherRoom: () -> Unit ) : - ComponentContext by componentContext, BookingRoomComponent { + ComponentContext by componentContext, BookingRoomComponent, KoinComponent { private var mutableState = MutableStateFlow(BookingRoomState.default) override val state = mutableState.asStateFlow() override val dateTimeComponent: RealDateTimeComponent = - RealDateTimeComponent(childContext("dateTime"), changeDay = { changeDate(it) }) + RealDateTimeComponent( + childContext("dateTime"), + changeDay = { changeDate(it) } + ) override val eventLengthComponent: RealEventLengthComponent = RealEventLengthComponent(childContext("length"), changeLength = { changeLength(it) }) override val eventOrganizerComponent: RealEventOrganizerComponent = - RealEventOrganizerComponent(childContext("organizer")) + RealEventOrganizerComponent( + childContext("organizer"), + onSelectOrganizer = { selectOrganizer(it) }) + + private val roomInfoInteractor: RoomInteractor by inject() init { updateSelectTime() + mutableState.update { it.copy(organizers = roomInfoInteractor.getOrganizers()) } } override fun sendEvent(event: BookingRoomViewEvent) { @@ -57,7 +68,7 @@ class RealBookingRoomComponent( mutableState.update { it.copy(selectDate = newValue) } } - //TODO + //TODO(Maksim Mishenko): delete while(true) private fun updateSelectTime() { componentCoroutineScope().launch { while (true) { @@ -67,9 +78,13 @@ class RealBookingRoomComponent( } } } + + private fun selectOrganizer(organizer: String) { + mutableState.update { it.copy(organizer = organizer) } + } } -//https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 +//NOTE(Maksim Mishenko): https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 fun ComponentContext.componentCoroutineScope(): CoroutineScope { val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt index 30e44b0f..d7b6f3ba 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt @@ -1,6 +1,28 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update -class RealEventOrganizerComponent(componentContext: ComponentContext): ComponentContext by componentContext { +class RealEventOrganizerComponent( + componentContext: ComponentContext, + private val onSelectOrganizer: (String) -> Unit +) : + ComponentContext by componentContext { + private var mutableExpanded = MutableStateFlow(false) + val expanded = mutableExpanded.asStateFlow() + + private var mutableSelectedItem = MutableStateFlow("") + val selectedItem = mutableSelectedItem.asStateFlow() + + fun onExpandedChange() { + mutableExpanded.update { !it } + } + + fun onSelectItem(item: String) { + mutableSelectedItem.update { item } + mutableExpanded.update { false } + onSelectOrganizer(item) + } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt new file mode 100644 index 00000000..99ef1325 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt @@ -0,0 +1,95 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents + +import androidx.compose.foundation.Image +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.DropdownMenuItem +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.ExposedDropdownMenuBox +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.roomInfo.MainRes +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealEventOrganizerComponent +import io.github.skeptick.libres.compose.painterResource + +@OptIn(ExperimentalMaterialApi::class) +@Composable +fun EventOrganizerView( + modifier: Modifier = Modifier, + component: RealEventOrganizerComponent, + organizers: List +) { + val expended by component.expanded.collectAsState() + val selectedItem by component.selectedItem.collectAsState() + Column(modifier = modifier) { + Text( + text = "организатор", + color = Color(0xFF808080), + fontSize = 16.sp + ) + Spacer(modifier = Modifier.height(10.dp)) + ExposedDropdownMenuBox( + expanded = expended, + onExpandedChange = { component.onExpandedChange() } + ) { + Row( + modifier = Modifier + .clip(RoundedCornerShape(15.dp)) + .fillMaxSize() + .background(color = Color(0xFF302D2C)) + .padding(horizontal = 20.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + if (selectedItem.notSelect()) { + Text( + text = "Организатор встречи", + color = Color(0xFF777777) + ) + } else { + Text( + text = selectedItem, + color = Color(0xFFFAFAFA) + ) + } + + Image( + modifier = Modifier, + painter = painterResource(MainRes.image.arrow_to_down), + contentDescription = null + ) + } + + + ExposedDropdownMenu( + expanded = expended, + onDismissRequest = { component.onExpandedChange() } + ) { + organizers.forEach { organizer -> + DropdownMenuItem(onClick = { + component.onSelectItem(organizer) + }) { + Text(text = organizer) + } + } + } + } + } +} + +private fun String.notSelect() = this == "" \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_down.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_down.svg new file mode 100644 index 00000000..4d1b0627 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_down.svg @@ -0,0 +1,5 @@ + + + + + -- GitLab From fbf4dcb97392e63342e9beb02c4c8a134a768976 Mon Sep 17 00:00:00 2001 From: Viktor Konyshev Date: Wed, 5 Jul 2023 01:59:28 +0600 Subject: [PATCH 17/63] customize-theme --- .../band/effective/office/tablet/App.kt | 3 +- .../effective/office/tablet/ui/theme/Color.kt | 16 +++++++ .../effective/office/tablet/ui/theme/Theme.kt | 42 +++++++++++++++++++ 3 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index 1df588dd..8e19a020 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -4,12 +4,13 @@ import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.root.Root import band.effective.office.tablet.ui.root.RootComponent +import band.effective.office.tablet.ui.theme.AppTheme import com.arkivanov.decompose.ComponentContext @Composable fun App(componentContext: ComponentContext) { val rootComponent = RootComponent(componentContext) - MaterialTheme { + AppTheme { Root(rootComponent) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt new file mode 100644 index 00000000..89e6000f --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt @@ -0,0 +1,16 @@ +package band.effective.office.tablet.ui.theme + +import androidx.compose.ui.graphics.Color + +internal val md_theme_dark_primary = Color(0xFFEF7234) +internal val md_theme_dark_onPrimary = Color(0xFFFAFAFA) +internal val md_theme_dark_primaryContainer = Color(0xFF004E5C) +internal val md_theme_dark_secondary = Color(0xFFA362F8) +internal val md_theme_dark_onSecondary = Color(0xFF00373A) +internal val md_theme_dark_secondaryContainer = Color(0xFF004F53) +internal val md_theme_dark_error = Color(0xFFEB4C2A) +internal val md_theme_dark_onError = Color(0xFF690005) +internal val md_theme_dark_background = Color(0xFF1E1C1A) +internal val md_theme_dark_onBackground = Color(0xFFFFE264) +internal val md_theme_dark_surface = Color(0xFF252322) +internal val md_theme_dark_onSurface = Color(0xFFFFFFFF) \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt new file mode 100644 index 00000000..8b423a53 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -0,0 +1,42 @@ +package band.effective.office.tablet.ui.theme + +import androidx.compose.foundation.isSystemInDarkTheme +import androidx.compose.material.MaterialTheme +import androidx.compose.material.Surface +import androidx.compose.material.Typography +import androidx.compose.material.darkColors +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.runtime.Composable + +private val DarkColors = darkColors( + primary = md_theme_dark_primary, + primaryVariant = md_theme_dark_primaryContainer, + secondary = md_theme_dark_secondary, + secondaryVariant = md_theme_dark_secondaryContainer, + background = md_theme_dark_background, + surface = md_theme_dark_surface, + error = md_theme_dark_error, + onPrimary = md_theme_dark_onPrimary, + onSecondary = md_theme_dark_onSecondary, + onBackground = md_theme_dark_onBackground, + onSurface = md_theme_dark_onSurface, + onError = md_theme_dark_onError +) + +@Composable +internal fun AppTheme( + useDarkTheme: Boolean = isSystemInDarkTheme(), + content: @Composable () -> Unit +) { + val colors = DarkColors + val typography = Typography(defaultFontFamily = FontFamily.Default) + + + MaterialTheme( + colors = colors, + typography = typography, + content = { + Surface(content = content) + } + ) +} \ No newline at end of file -- GitLab From e13d31dc412ffadf57fe6184ce39842b05ca3be1 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 13:34:17 +0600 Subject: [PATCH 18/63] [~] work with colors --- .../bookingRoomComponents/BookingRoomView.kt | 10 ++++++- .../uiComponents/DateTimeView.kt | 19 +++++++++++--- .../uiComponents/EventLengthView.kt | 7 +++-- ...okingRoomView.kt => EventOrganizerView.kt} | 26 ++++++++++++++----- .../src/commonMain/libres/images/calendar.svg | 5 ++++ 5 files changed, 55 insertions(+), 12 deletions(-) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/{BookingRoomView.kt => EventOrganizerView.kt} (79%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/calendar.svg diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index 548493c5..564d9093 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -8,6 +8,7 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults import androidx.compose.material.Surface import androidx.compose.material.Text import androidx.compose.runtime.Composable @@ -57,7 +58,14 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking Box(Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) { Button( modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) { + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }, + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFFEF7234), + disabledBackgroundColor = Color(0xFF342C28), + disabledContentColor = Color(0xFF808080) + ) + ) { Text(text = "Занять Sirius") } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt index 6e7617dc..ce6fe7cc 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents +import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -9,6 +10,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -16,8 +18,10 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.roomInfo.MainRes import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealDateTimeComponent import band.effective.office.tablet.utils.CalendarStringConverter +import io.github.skeptick.libres.compose.painterResource import java.util.Calendar @Composable @@ -32,7 +36,8 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat Row(modifier = Modifier.fillMaxSize()) { Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.decrementDay() } + onClick = { component.decrementDay() }, + colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) ) { Text( text = "<", @@ -43,18 +48,26 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat Spacer(modifier = Modifier.width(10.dp)) Button( modifier = Modifier.fillMaxHeight().weight(4f).clip(RoundedCornerShape(15.dp)), - onClick = { } + onClick = { }, + colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) ) { Text( text = selectDate.dateTime(), color = Color(0xFFFAFAFA), fontSize = 20.sp ) + Spacer(Modifier.width(5.dp)) + Image( + modifier = Modifier, + painter = painterResource(MainRes.image.calendar), + contentDescription = null + ) } Spacer(modifier = Modifier.width(10.dp)) Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.incrementDay() } + onClick = { component.incrementDay() }, + colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) ) { Text( text = ">", diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt index b4cb7012..11f6e609 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -10,6 +10,7 @@ import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment @@ -41,7 +42,8 @@ fun EventLengthView( ) { Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.decrement() } + onClick = { component.decrement() }, + colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) ) { Text( text = "-30", @@ -58,7 +60,8 @@ fun EventLengthView( Spacer(modifier = Modifier.width(space)) Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.increment() } + onClick = { component.increment() }, + colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) ) { Text( text = "+15", diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt similarity index 79% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt index 99ef1325..9c2a0145 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt @@ -2,7 +2,9 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomCompone import androidx.compose.foundation.Image import androidx.compose.foundation.background +import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -13,6 +15,7 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.DropdownMenuItem import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.ExposedDropdownMenuBox +import androidx.compose.material.Surface import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState @@ -75,19 +78,30 @@ fun EventOrganizerView( ) } - ExposedDropdownMenu( + modifier = Modifier + .background( + color = Color(0xFF252322) + ), expanded = expended, onDismissRequest = { component.onExpandedChange() } ) { - organizers.forEach { organizer -> - DropdownMenuItem(onClick = { - component.onSelectItem(organizer) - }) { - Text(text = organizer) + Column( + modifier = Modifier.background( + color = Color(0xFF302D2C), + shape = RoundedCornerShape(15.dp) + ) + ) { + organizers.forEach { organizer -> + DropdownMenuItem(onClick = { + component.onSelectItem(organizer) + }) { + Text(text = organizer, color = Color(0xFFFAFAFA)) + } } } } + } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/calendar.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/calendar.svg new file mode 100644 index 00000000..e342ef2a --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/calendar.svg @@ -0,0 +1,5 @@ + + + + + -- GitLab From c78c4c85ba76858e99945204777d0f76fc0d5212 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 14:52:27 +0600 Subject: [PATCH 19/63] [+] design alert about busy room --- .../office/tablet/domain/RoomInteractor.kt | 4 ++ .../tablet/domain/RoomInteractorImpl.kt | 11 ++- .../office/tablet/domain/model/EventInfo.kt | 11 ++- .../bookingRoomComponents/BookingRoomState.kt | 13 ++-- .../bookingRoomComponents/BookingRoomView.kt | 15 +++- .../RealBookingRoomComponent.kt | 9 ++- .../uiComponents/BusyAlertView.kt | 70 +++++++++++++++++++ .../uiComponents/EventLengthView.kt | 15 ++-- .../src/commonMain/libres/images/allert.svg | 5 ++ .../libres/images/arrow_to_right.svg | 5 ++ 10 files changed, 144 insertions(+), 14 deletions(-) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/allert.svg create mode 100644 tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_right.svg diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt index 810f027f..2879cbba 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt @@ -1,6 +1,8 @@ package band.effective.office.tablet.domain +import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo +import java.util.Calendar /**Interface for get information about room and send booking request*/ interface RoomInteractor { @@ -8,4 +10,6 @@ interface RoomInteractor { fun getRoomInfo(name: String): RoomInfo fun getOrganizers(): List + + fun checkRoom(name: String, dateTime: Calendar): EventInfo? } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt index e11c8d7a..f310bc16 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt @@ -1,9 +1,18 @@ package band.effective.office.tablet.domain +import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.RoomInfoRepository +import java.util.Calendar +import java.util.GregorianCalendar -class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository): RoomInteractor { +class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository) : RoomInteractor { override fun getRoomInfo(name: String): RoomInfo = roomInfoRepository.getRoomInfo(name) override fun getOrganizers(): List = roomInfoRepository.getOrganizers() + override fun checkRoom(name: String, dateTime: Calendar): EventInfo? = + EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "Ольга Белозерова" + ) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt index c8f9a935..888fea56 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -1,9 +1,18 @@ package band.effective.office.tablet.domain.model import java.util.Calendar +import java.util.GregorianCalendar data class EventInfo( val startTime: Calendar, val finishTime: Calendar, val organizer: String -) +){ + companion object{ + val emptyEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "" + ) + } +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt index d0aa7aad..21707d93 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar import java.util.GregorianCalendar @@ -7,14 +8,18 @@ data class BookingRoomState( val length: Int, val organizer: String, val organizers: List, - val selectDate: Calendar -){ - companion object{ + val selectDate: Calendar, + val isBusy: Boolean, + val busyEvent: EventInfo +) { + companion object { val default = BookingRoomState( length = 0, organizer = "", organizers = listOf(), - selectDate = GregorianCalendar() + selectDate = GregorianCalendar(), + isBusy = false, + busyEvent = EventInfo.emptyEvent ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index 564d9093..e85908a3 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.BusyAlertView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.DateTimeView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventOrganizerView @@ -45,7 +46,8 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking EventLengthView( modifier = Modifier.fillMaxWidth().height(100.dp), component = bookingRoomComponent.eventLengthComponent, - currentLength = state.length + currentLength = state.length, + isBusy = state.isBusy ) Spacer(modifier = Modifier.height(25.dp)) EventOrganizerView( @@ -53,7 +55,13 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking component = bookingRoomComponent.eventOrganizerComponent, organizers = state.organizers ) - Spacer(modifier = Modifier.height(25.dp)) + Spacer(modifier = Modifier.height(50.dp)) + if (state.isBusy) { + BusyAlertView( + modifier = Modifier.fillMaxWidth(), + event = state.busyEvent, + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) + } } Box(Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) { Button( @@ -64,7 +72,8 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking backgroundColor = Color(0xFFEF7234), disabledBackgroundColor = Color(0xFF342C28), disabledContentColor = Color(0xFF808080) - ) + ), + enabled = !state.isBusy ) { Text(text = "Занять Sirius") } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 0ffdf72a..edc02791 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.domain.model.EventInfo import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import com.arkivanov.essenty.lifecycle.Lifecycle @@ -44,7 +45,13 @@ class RealBookingRoomComponent( init { updateSelectTime() - mutableState.update { it.copy(organizers = roomInfoInteractor.getOrganizers()) } + mutableState.update { + it.copy( + organizers = roomInfoInteractor.getOrganizers(), + isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, + busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) ?: EventInfo.emptyEvent + ) + } } override fun sendEvent(event: BookingRoomViewEvent) { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt new file mode 100644 index 00000000..071ebbba --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt @@ -0,0 +1,70 @@ +package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents + +import androidx.compose.foundation.Image +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.Surface +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.features.roomInfo.MainRes +import band.effective.office.tablet.utils.CalendarStringConverter +import io.github.skeptick.libres.compose.painterResource +import java.util.Calendar + +@OptIn(ExperimentalMaterialApi::class) +@Composable +fun BusyAlertView(modifier: Modifier, event: EventInfo, onClick: () -> Unit) { + Column(modifier = modifier) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.Start, + verticalAlignment = Alignment.CenterVertically + ) { + Image( + modifier = Modifier, + painter = painterResource(MainRes.image.allert), + contentDescription = null + ) + Spacer(Modifier.width(10.dp)) + Text( + text = "Время ${event.startTime.time()} — ${event.finishTime.time()} занято · ${event.organizer}", + color = Color(0xFFEB4C2A), + fontSize = 19.sp + ) + } + Spacer(modifier = Modifier.height(30.dp)) + Surface(color = Color(0xFF252322), onClick = { onClick() }) { + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.End, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = "Смотреть свободные переговорки на это время", + color = Color(0xFFA362F8), + fontSize = 19.sp + ) + Image( + modifier = Modifier, + painter = painterResource(MainRes.image.arrow_to_right), + contentDescription = null + ) + } + } + + } +} + +private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt index 11f6e609..2980d103 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -25,7 +25,8 @@ import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponen fun EventLengthView( modifier: Modifier = Modifier, component: RealEventLengthComponent, - currentLength: Int + currentLength: Int, + isBusy: Boolean ) { val space = 50.dp Column(modifier = modifier) { @@ -43,7 +44,10 @@ fun EventLengthView( Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { component.decrement() }, - colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFF302D2C) + ) ) { Text( text = "-30", @@ -54,14 +58,17 @@ fun EventLengthView( Spacer(modifier = Modifier.width(space)) Text( text = "$currentLength мин", - color = Color(0xFFFAFAFA), + color = if (isBusy) Color(0xFFA362F8) else Color(0xFFFAFAFA), fontSize = 32.sp ) Spacer(modifier = Modifier.width(space)) Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { component.increment() }, - colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFF302D2C) + ) ) { Text( text = "+15", diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/allert.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/allert.svg new file mode 100644 index 00000000..e7d0fab9 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/allert.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_right.svg b/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_right.svg new file mode 100644 index 00000000..3c9c9e41 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/libres/images/arrow_to_right.svg @@ -0,0 +1,5 @@ + + + + + -- GitLab From 740d371bc4c9f136ebb513824e93cff81888131c Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 14:54:55 +0600 Subject: [PATCH 20/63] [~] fix view events --- .../components/bookingRoomComponents/BookingRoomView.kt | 4 ++-- .../bookingRoomComponents/BookingRoomViewEvent.kt | 2 +- .../bookingRoomComponents/RealBookingRoomComponent.kt | 6 ++++-- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index e85908a3..8bb582ae 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -60,13 +60,13 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking BusyAlertView( modifier = Modifier.fillMaxWidth(), event = state.busyEvent, - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }) + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherRoom) }) } } Box(Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) { Button( modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherOtherRoom) }, + onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingCurrentRoom) }, colors = ButtonDefaults.buttonColors( contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFFEF7234), diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt index 2d3b5818..10c9fca5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt @@ -2,5 +2,5 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomCompone sealed interface BookingRoomViewEvent{ object OnBookingCurrentRoom: BookingRoomViewEvent - object OnBookingOtherOtherRoom: BookingRoomViewEvent + object OnBookingOtherRoom: BookingRoomViewEvent } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index edc02791..a4a49f78 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -56,8 +56,10 @@ class RealBookingRoomComponent( override fun sendEvent(event: BookingRoomViewEvent) { when (event) { - is BookingRoomViewEvent.OnBookingCurrentRoom -> {} - is BookingRoomViewEvent.OnBookingOtherOtherRoom -> { + is BookingRoomViewEvent.OnBookingCurrentRoom -> { + onSelectOtherRoom() + } + is BookingRoomViewEvent.OnBookingOtherRoom -> { onSelectOtherRoom() } } -- GitLab From 1b3bea32f2ae9d9f3443611a8cec011028d13235 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 15:21:08 +0600 Subject: [PATCH 21/63] [~] refactor mock view --- .../office/tablet/domain/MockController.kt | 3 +- .../tablet/domain/RoomInteractorImpl.kt | 9 ++- .../tablet/ui/mainScreen/RealMainComponent.kt | 1 + .../mainScreen/components/MainScreenView.kt | 5 +- .../BookingRoomComponent.kt | 1 + .../RealBookingRoomComponent.kt | 20 ++++--- .../mockComponets/MockSettingView.kt | 60 ++++++++++++++----- .../mockComponets/MockSettingsEvent.kt | 3 + .../components/mockComponets/MockState.kt | 6 +- .../RealMockSettingsComponent.kt | 11 ++-- 10 files changed, 85 insertions(+), 34 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt index e9f011b7..3e1925e3 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -4,5 +4,6 @@ package band.effective.office.tablet.domain data class MockController( var isBusy: Boolean = false, var isManyEvent: Boolean = false, - var isHaveTV: Boolean = false + var isHaveTV: Boolean = false, + var isBusyTime: Boolean = false ) \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt index f310bc16..b32db1dd 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt @@ -3,16 +3,21 @@ package band.effective.office.tablet.domain import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.RoomInfoRepository +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject import java.util.Calendar import java.util.GregorianCalendar -class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository) : RoomInteractor { +class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository) : RoomInteractor, + KoinComponent { + private val mockController: MockController by inject() override fun getRoomInfo(name: String): RoomInfo = roomInfoRepository.getRoomInfo(name) override fun getOrganizers(): List = roomInfoRepository.getOrganizers() override fun checkRoom(name: String, dateTime: Calendar): EventInfo? = - EventInfo( + if (mockController.isBusyTime) EventInfo( startTime = GregorianCalendar(), finishTime = GregorianCalendar(), organizer = "Ольга Белозерова" ) + else null } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 7e18beab..19dcc99a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -44,6 +44,7 @@ class RealMainComponent( roomInfo = interactor.getRoomInfo("sirius") ) } + bookingRoomComponent.update() } override fun sendEvent(event: MainScreenEvent) = diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 3a566c09..1c557f3b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -3,6 +3,7 @@ package band.effective.office.tablet.ui.mainScreen.components import android.os.Build import androidx.annotation.RequiresApi import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight @@ -39,12 +40,12 @@ fun MainScreenView( modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), room = room ) - Column(modifier = Modifier.fillMaxSize()) { + Box(modifier = Modifier.fillMaxSize()) { BookingRoomView( modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize().padding(25.dp), bookingRoomComponent = bookingRoomComponent ) - //MockSettingView(mockComponent) + MockSettingView(mockComponent) } } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt index bfffb1b7..1b5f924d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt @@ -10,4 +10,5 @@ interface BookingRoomComponent { val eventOrganizerComponent: RealEventOrganizerComponent fun sendEvent(event: BookingRoomViewEvent) + fun update() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index a4a49f78..e24f3e03 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -45,13 +45,7 @@ class RealBookingRoomComponent( init { updateSelectTime() - mutableState.update { - it.copy( - organizers = roomInfoInteractor.getOrganizers(), - isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, - busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) ?: EventInfo.emptyEvent - ) - } + update() } override fun sendEvent(event: BookingRoomViewEvent) { @@ -59,12 +53,24 @@ class RealBookingRoomComponent( is BookingRoomViewEvent.OnBookingCurrentRoom -> { onSelectOtherRoom() } + is BookingRoomViewEvent.OnBookingOtherRoom -> { onSelectOtherRoom() } } } + override fun update() { + mutableState.update { + it.copy( + organizers = roomInfoInteractor.getOrganizers(), + isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, + busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) + ?: EventInfo.emptyEvent + ) + } + } + private fun changeLength(delta: Int) { if (state.value.length + delta >= 0) { mutableState.update { it.copy(length = it.length + delta) } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt index d0b2fcd2..986fa696 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt @@ -1,37 +1,65 @@ package band.effective.office.tablet.ui.mainScreen.components.mockComponets +import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.material.Checkbox import androidx.compose.material.CheckboxDefaults +import androidx.compose.material.ExperimentalMaterialApi +import androidx.compose.material.Surface import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +@OptIn(ExperimentalMaterialApi::class) @Composable fun MockSettingView(component: MockSettingsComponent) { val state by component.state.collectAsState() + Surface( + modifier = Modifier.fillMaxWidth().height(100.dp), + color = Color(0xFF252322), + onClick = { component.sendEvent(MockSettingsEvent.OnSwitchVisible) }) { + if (state.isVisible) { + Column { + Row { + Item( + checked = state.isBusy, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchBusy(it)) }, + text = "Комната занята" + ) + Item( + checked = state.isManyEvent, + onCheckedChange = { + component.sendEvent( + MockSettingsEvent.OnSwitchEventCount( + it + ) + ) + }, + text = "Много меропритий" + ) + Item( + checked = state.isHaveTv, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchTv(it)) }, + text = "Есть tv" + ) + } - Column { - Item( - checked = state.isBusy, - onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchBusy(it)) }, - text = "Комната занята" - ) - Item( - checked = state.isManyEvent, - onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchEventCount(it)) }, - text = "Много меропритий" - ) - Item( - checked = state.isHaveTv, - onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchTv(it)) }, - text = "Есть tv" - ) + Item( + checked = state.isBusyTime, + onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchBusyTime(it)) }, + text = "Невожможно забронировть" + ) + } + } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt index 78852f06..b6de0548 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt @@ -4,4 +4,7 @@ sealed interface MockSettingsEvent{ data class OnSwitchEventCount(val newState: Boolean): MockSettingsEvent data class OnSwitchBusy(val newState: Boolean): MockSettingsEvent data class OnSwitchTv(val newState: Boolean): MockSettingsEvent + data class OnSwitchBusyTime(val newState: Boolean): MockSettingsEvent + object OnSwitchVisible: MockSettingsEvent + } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt index 64b789e4..2c287e06 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt @@ -3,5 +3,7 @@ package band.effective.office.tablet.ui.mainScreen.components.mockComponets data class MockState( val isBusy: Boolean = false, val isManyEvent: Boolean = false, - val isHaveTv: Boolean = false -) + val isHaveTv: Boolean = false, + val isBusyTime: Boolean = false, + val isVisible: Boolean = false +) \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt index 17f3a727..19b64316 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt @@ -22,21 +22,24 @@ class RealMockSettingsComponent( } /**Synchronize data in mock controller and in state*/ - private fun reloadData(){ + private fun reloadData() { mutableState.update { - MockState( + it.copy( isBusy = mockController.isBusy, isManyEvent = mockController.isManyEvent, - isHaveTv = mockController.isHaveTV + isHaveTv = mockController.isHaveTV, + isBusyTime = mockController.isBusyTime ) } } override fun sendEvent(event: MockSettingsEvent) { - when(event){ + when (event) { is MockSettingsEvent.OnSwitchBusy -> mockController.isBusy = event.newState is MockSettingsEvent.OnSwitchEventCount -> mockController.isManyEvent = event.newState is MockSettingsEvent.OnSwitchTv -> mockController.isHaveTV = event.newState + is MockSettingsEvent.OnSwitchBusyTime -> mockController.isBusyTime = event.newState + is MockSettingsEvent.OnSwitchVisible -> mutableState.update { it.copy(isVisible = !it.isVisible) } } reloadData() updateData() -- GitLab From 3545c9207bc1dd577da86954a677ab64033e5308 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 18:07:45 +0600 Subject: [PATCH 22/63] [~] move strings in resource --- .../tablet/ui/mainScreen/RealMainComponent.kt | 4 +++- .../bookingRoomComponents/BookingRoomState.kt | 6 ++++-- .../bookingRoomComponents/BookingRoomView.kt | 5 +++-- .../RealBookingRoomComponent.kt | 6 ++++-- .../uiComponents/BusyAlertView.kt | 8 ++++++-- .../uiComponents/DateTimeView.kt | 20 ++++++++++++++----- .../uiComponents/EventLengthView.kt | 9 +++++---- .../uiComponents/EventOrganizerView.kt | 4 ++-- .../commonMain/libres/strings/strings_ru.xml | 12 +++++++++++ 9 files changed, 54 insertions(+), 20 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 19dcc99a..1343e4ff 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -30,7 +30,9 @@ class RealMainComponent( ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), - onSelectOtherRoom = { onClick() }) + onSelectOtherRoom = { onClick() }, + roomName = "Sirius" + ) init { updateData() diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt index 21707d93..ceed1d76 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt @@ -10,7 +10,8 @@ data class BookingRoomState( val organizers: List, val selectDate: Calendar, val isBusy: Boolean, - val busyEvent: EventInfo + val busyEvent: EventInfo, + val roomName: String ) { companion object { val default = BookingRoomState( @@ -19,7 +20,8 @@ data class BookingRoomState( organizers = listOf(), selectDate = GregorianCalendar(), isBusy = false, - busyEvent = EventInfo.emptyEvent + busyEvent = EventInfo.emptyEvent, + roomName = "" ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt index 8bb582ae..e29dd7b5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt @@ -20,6 +20,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.roomInfo.MainRes import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.BusyAlertView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.DateTimeView import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView @@ -32,7 +33,7 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking Column(modifier = Modifier.fillMaxSize()) { Spacer(modifier = Modifier.height(63.dp)) Text( - text = "Занять", + text = MainRes.string.booking_view_title, color = Color(0xFFFAFAFA), fontSize = 36.sp ) @@ -75,7 +76,7 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking ), enabled = !state.isBusy ) { - Text(text = "Занять Sirius") + Text(text = MainRes.string.booking_button_text.format(roomName = state.roomName)) } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index e24f3e03..4cdec0d5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -22,7 +22,8 @@ import java.util.GregorianCalendar class RealBookingRoomComponent( private val componentContext: ComponentContext, - private val onSelectOtherRoom: () -> Unit + private val onSelectOtherRoom: () -> Unit, + roomName: String ) : ComponentContext by componentContext, BookingRoomComponent, KoinComponent { private var mutableState = MutableStateFlow(BookingRoomState.default) @@ -44,6 +45,7 @@ class RealBookingRoomComponent( private val roomInfoInteractor: RoomInteractor by inject() init { + mutableState.update { it.copy(roomName = roomName) } updateSelectTime() update() } @@ -66,7 +68,7 @@ class RealBookingRoomComponent( organizers = roomInfoInteractor.getOrganizers(), isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) - ?: EventInfo.emptyEvent + ?: EventInfo.emptyEvent, ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt index 071ebbba..2fe9500f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt @@ -39,7 +39,11 @@ fun BusyAlertView(modifier: Modifier, event: EventInfo, onClick: () -> Unit) { ) Spacer(Modifier.width(10.dp)) Text( - text = "Время ${event.startTime.time()} — ${event.finishTime.time()} занято · ${event.organizer}", + text = MainRes.string.busy_time_string.format( + startTime = event.startTime.time(), + finishTime = event.finishTime.time(), + organizer = event.organizer + ), color = Color(0xFFEB4C2A), fontSize = 19.sp ) @@ -52,7 +56,7 @@ fun BusyAlertView(modifier: Modifier, event: EventInfo, onClick: () -> Unit) { verticalAlignment = Alignment.CenterVertically ) { Text( - text = "Смотреть свободные переговорки на это время", + text = MainRes.string.see_free_room, color = Color(0xFFA362F8), fontSize = 19.sp ) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt index ce6fe7cc..f90e0367 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt @@ -28,7 +28,7 @@ import java.util.Calendar fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDate: Calendar) { Column(modifier = modifier) { Text( - text = "когда", + text = MainRes.string.select_date_tine_title, color = Color(0xFF808080), fontSize = 16.sp ) @@ -37,7 +37,10 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { component.decrementDay() }, - colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFF302D2C) + ) ) { Text( text = "<", @@ -49,7 +52,10 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat Button( modifier = Modifier.fillMaxHeight().weight(4f).clip(RoundedCornerShape(15.dp)), onClick = { }, - colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFF302D2C) + ) ) { Text( text = selectDate.dateTime(), @@ -67,7 +73,10 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), onClick = { component.incrementDay() }, - colors = ButtonDefaults.buttonColors(contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C)) + colors = ButtonDefaults.buttonColors( + contentColor = Color(0xFFFFFFFF), + backgroundColor = Color(0xFF302D2C) + ) ) { Text( text = ">", @@ -82,4 +91,5 @@ fun DateTimeView(modifier: Modifier, component: RealDateTimeComponent, selectDat private fun Calendar.time() = CalendarStringConverter.calendarToString(this, "HH:mm") private fun Calendar.date() = CalendarStringConverter.calendarToString(this, "dd MMMM") -private fun Calendar.dateTime() = "${date()} c ${time()}" \ No newline at end of file +private fun Calendar.dateTime() = + MainRes.string.start_date_time.format(time = time(), date = date()) \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt index 2980d103..eaf6eb26 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -19,6 +19,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.roomInfo.MainRes import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealEventLengthComponent @Composable @@ -31,7 +32,7 @@ fun EventLengthView( val space = 50.dp Column(modifier = modifier) { Text( - text = "на сколько", + text = MainRes.string.select_length_title, color = Color(0xFF808080), fontSize = 16.sp ) @@ -50,14 +51,14 @@ fun EventLengthView( ) ) { Text( - text = "-30", + text = MainRes.string.minus_date_button_string, color = Color(0xFFFAFAFA), fontSize = 20.sp ) } Spacer(modifier = Modifier.width(space)) Text( - text = "$currentLength мин", + text = MainRes.string.current_length_string.format(currentLength.toString()), color = if (isBusy) Color(0xFFA362F8) else Color(0xFFFAFAFA), fontSize = 32.sp ) @@ -71,7 +72,7 @@ fun EventLengthView( ) ) { Text( - text = "+15", + text = MainRes.string.plus_date_button_string, color = Color(0xFFFAFAFA), fontSize = 20.sp ) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt index 9c2a0145..8d17fd80 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt @@ -41,7 +41,7 @@ fun EventOrganizerView( val selectedItem by component.selectedItem.collectAsState() Column(modifier = modifier) { Text( - text = "организатор", + text = MainRes.string.select_organizer_title, color = Color(0xFF808080), fontSize = 16.sp ) @@ -61,7 +61,7 @@ fun EventOrganizerView( ) { if (selectedItem.notSelect()) { Text( - text = "Организатор встречи", + text = MainRes.string.selectbox_organizer_title, color = Color(0xFF777777) ) } else { diff --git a/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml index 9b0b27ea..7889fe30 100644 --- a/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml +++ b/tabletApp/features/roomInfo/src/commonMain/libres/strings/strings_ru.xml @@ -8,4 +8,16 @@ Розетка Розетки Розеток + Занять + Занять ${roomName} + Время ${startTime} — ${finishTime} занято · ${organizer} + Смотреть свободные переговорки на это время + когда + на сколько + организатор + ${date} c ${time} + -30 + +15 + ${currentLength} мин + Организатор встречи \ No newline at end of file -- GitLab From 4c46a7f748a32e51df97138f82f44fb6e702d077 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 18:16:50 +0600 Subject: [PATCH 23/63] [~] add comments --- .../band/effective/office/tablet/domain/MockController.kt | 2 +- .../band/effective/office/tablet/domain/RoomInteractor.kt | 3 +++ .../bookingRoomComponents/RealBookingRoomComponent.kt | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt index 3e1925e3..8ca15f5b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -1,6 +1,6 @@ package band.effective.office.tablet.domain -/**Contain mock's fields*/ +/**Contain mock's flags*/ data class MockController( var isBusy: Boolean = false, var isManyEvent: Boolean = false, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt index 2879cbba..99ad3ab2 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt @@ -9,7 +9,10 @@ interface RoomInteractor { /**Get room information by room's name*/ fun getRoomInfo(name: String): RoomInfo + /**Get list peoples have rights for booking room*/ fun getOrganizers(): List + /**Check opportunity book room + * @return Return null if room is free, if room busy then return interfering event*/ fun checkRoom(name: String, dateTime: Calendar): EventInfo? } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 4cdec0d5..2e77125e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -85,7 +85,7 @@ class RealBookingRoomComponent( mutableState.update { it.copy(selectDate = newValue) } } - //TODO(Maksim Mishenko): delete while(true) + //TODO(Maksim Mishenko): think about while(true) private fun updateSelectTime() { componentCoroutineScope().launch { while (true) { -- GitLab From 1d41766789c7f58ac0fd1dea7271ee5562ff47f0 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 5 Jul 2023 18:35:40 +0600 Subject: [PATCH 24/63] [~] clean up main component --- .../office/tablet/ui/mainScreen/MainScreenEvent.kt | 1 - .../office/tablet/ui/mainScreen/RealMainComponent.kt | 8 +++----- .../band/effective/office/tablet/ui/root/RootComponent.kt | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt index 24430faa..d5e0da17 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt @@ -2,5 +2,4 @@ package band.effective.office.tablet.ui.mainScreen sealed class MainScreenEvent { object OnCLick: MainScreenEvent() - object OnDoubleTub: MainScreenEvent() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 1343e4ff..98ceaade 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -15,7 +15,7 @@ import org.koin.core.component.inject class RealMainComponent( componentContext: ComponentContext, - private val onClick: () -> Unit + private val OnSelectOtherRoomRequest: () -> Unit ) : ComponentContext by componentContext, KoinComponent, MainComponent { private val interactor: RoomInteractor by inject() @@ -30,7 +30,7 @@ class RealMainComponent( ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), - onSelectOtherRoom = { onClick() }, + onSelectOtherRoom = { OnSelectOtherRoomRequest() }, roomName = "Sirius" ) @@ -52,9 +52,7 @@ class RealMainComponent( override fun sendEvent(event: MainScreenEvent) = when (event) { is MainScreenEvent.OnCLick -> { - onClick() + OnSelectOtherRoomRequest() } - - is MainScreenEvent.OnDoubleTub -> {} } } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 48fc00a9..b628bde0 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -28,7 +28,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co is Config.Main -> { Child.MainChild(RealMainComponent( componentContext = componentContext, - onClick = { + OnSelectOtherRoomRequest = { navigation.push(Config.SelectRoom) } )) -- GitLab From e9bbd35c9634d999d9e8986197d0fa0dc579bfb2 Mon Sep 17 00:00:00 2001 From: Margarita Date: Thu, 6 Jul 2023 10:46:10 +0600 Subject: [PATCH 25/63] write main structure and components --- buildSrc/hs_err_pid49948.log | 851 ++++++++++++++++++ .../features/selectRoom/build.gradle.kts | 12 + .../kotlin/tablet/di/initSelectRoomKoin.kt | 7 + .../kotlin/tablet/di/SelectRoomModule.kt | 9 + .../tablet/domain/ISelectRoomInteractor.kt | 8 + .../tablet/domain/SelectRoomInteractorImpl.kt | 9 + .../kotlin/tablet/domain/model/Booking.kt | 6 + .../kotlin/tablet/domain/model/EventInfo.kt | 9 + .../tablet/network/ISelectRoomRepository.kt | 8 + .../RealSelectRoomComponent.kt | 29 + .../selectRoomScreen/SelectRoomComponent.kt | 8 +- .../ui/selectRoomScreen/SelectRoomScreen.kt | 29 +- .../selectRoomScreen/SelectRoomScreenState.kt | 18 + .../effective/office/tablet/MainActivity.kt | 2 + .../office/tablet/ui/root/RootComponent.kt | 22 +- 15 files changed, 1018 insertions(+), 9 deletions(-) create mode 100644 buildSrc/hs_err_pid49948.log create mode 100644 tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt diff --git a/buildSrc/hs_err_pid49948.log b/buildSrc/hs_err_pid49948.log new file mode 100644 index 00000000..c6cc489d --- /dev/null +++ b/buildSrc/hs_err_pid49948.log @@ -0,0 +1,851 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap +# Possible reasons: +# The system is out of physical RAM or swap space +# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Unscaled Compressed Oops mode in which the Java heap is +# placed in the first 4GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 4GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (./src/hotspot/share/memory/allocation.cpp:46), pid=49948, tid=54616 +# +# JRE version: OpenJDK Runtime Environment (11.0.13) (build 11.0.13+0-b1751.21-8125866) +# Java VM: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 + +Host: AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G , 2 cores, 3G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031) +Time: Mon Jul 3 17:11:04 2023 elapsed time: 80.431619 seconds (0d 0h 1m 20s) + +--------------- T H R E A D --------------- + +Current thread (0x00000225319f6800): VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] + +Stack: [0x0000008c53200000,0x0000008c53300000] +[error occurred during error reporting (printing stack bounds), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002251b68112d] + +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6100fa] +V [jvm.dll+0x747090] +V [jvm.dll+0x7486ad] +V [jvm.dll+0x748ce5] +V [jvm.dll+0x748c9b] +V [jvm.dll+0x60f224] +V [jvm.dll+0x60f9b8] +C [ntdll.dll+0xa247f] +C [ntdll.dll+0x514f4] +C [ntdll.dll+0xa0f8e] +C 0x000002251b68112d + +VM_Operation (0x0000008c56ff9770): CollectForMetadataAllocation, mode: safepoint, requested by thread 0x00000225324c0800 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000022536238790, length=61, elements={ +0x0000022517b60800, 0x00000225319fa000, 0x0000022531a03800, 0x0000022531a19000, +0x0000022531a1c000, 0x0000022531a1d800, 0x0000022531a66800, 0x0000022531a68800, +0x0000022531a7c800, 0x0000022531cee800, 0x0000022532734000, 0x0000022532576800, +0x000002253351e800, 0x0000022531f56000, 0x000002253302a800, 0x000002253302b800, +0x000002253253b800, 0x00000225324ce000, 0x0000022531ecd000, 0x0000022531ea4800, +0x0000022531e9f000, 0x0000022531ea5800, 0x0000022531ea2000, 0x0000022531ea0800, +0x0000022531ea3000, 0x0000022531ea4000, 0x0000022531ea0000, 0x0000022531ea1800, +0x0000022533cce800, 0x0000022533ccb000, 0x0000022533ccf000, 0x0000022533cd0000, +0x0000022533cca800, 0x0000022533ccd000, 0x0000022533cd1000, 0x0000022533cd1800, +0x0000022533ccc000, 0x0000022533cd7800, 0x0000022533cd3800, 0x0000022533cd2800, +0x0000022533cd4000, 0x0000022533cd8000, 0x0000022533cd9000, 0x0000022533cd5000, +0x0000022533cd6000, 0x0000022533cd6800, 0x00000225324c2000, 0x00000225324c1800, +0x00000225324be000, 0x00000225324c3000, 0x00000225324c4000, 0x00000225324c4800, +0x00000225324bf000, 0x00000225324c5800, 0x00000225324bf800, 0x00000225324c6800, +0x00000225324c0800, 0x00000225324cb000, 0x00000225324cd000, 0x00000225324cc000, +0x00000225324c8000 +} + +Java Threads: ( => current thread ) + 0x0000022517b60800 JavaThread "main" [_thread_blocked, id=52892, stack(0x0000008c52c00000,0x0000008c52d00000)] + 0x00000225319fa000 JavaThread "Reference Handler" daemon [_thread_blocked, id=52232, stack(0x0000008c53300000,0x0000008c53400000)] + 0x0000022531a03800 JavaThread "Finalizer" daemon [_thread_blocked, id=44012, stack(0x0000008c53400000,0x0000008c53500000)] + 0x0000022531a19000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=53300, stack(0x0000008c53500000,0x0000008c53600000)] + 0x0000022531a1c000 JavaThread "Attach Listener" daemon [_thread_blocked, id=49748, stack(0x0000008c53600000,0x0000008c53700000)] + 0x0000022531a1d800 JavaThread "Service Thread" daemon [_thread_blocked, id=46864, stack(0x0000008c53700000,0x0000008c53800000)] + 0x0000022531a66800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=53760, stack(0x0000008c53800000,0x0000008c53900000)] + 0x0000022531a68800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=54680, stack(0x0000008c53900000,0x0000008c53a00000)] + 0x0000022531a7c800 JavaThread "Sweeper thread" daemon [_thread_blocked, id=46020, stack(0x0000008c53a00000,0x0000008c53b00000)] + 0x0000022531cee800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=55048, stack(0x0000008c53b00000,0x0000008c53c00000)] + 0x0000022532734000 JavaThread "Daemon health stats" [_thread_blocked, id=54880, stack(0x0000008c53e00000,0x0000008c53f00000)] + 0x0000022532576800 JavaThread "Incoming local TCP Connector on port 58623" [_thread_in_native, id=50576, stack(0x0000008c53f00000,0x0000008c54000000)] + 0x000002253351e800 JavaThread "Daemon periodic checks" [_thread_blocked, id=52448, stack(0x0000008c54000000,0x0000008c54100000)] + 0x0000022531f56000 JavaThread "Daemon" [_thread_blocked, id=54848, stack(0x0000008c54100000,0x0000008c54200000)] + 0x000002253302a800 JavaThread "Handler for socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_in_native, id=53764, stack(0x0000008c54200000,0x0000008c54300000)] + 0x000002253302b800 JavaThread "Cancel handler" [_thread_blocked, id=55084, stack(0x0000008c54300000,0x0000008c54400000)] + 0x000002253253b800 JavaThread "Daemon worker" [_thread_blocked, id=15576, stack(0x0000008c54400000,0x0000008c54500000)] + 0x00000225324ce000 JavaThread "Asynchronous log dispatcher for DefaultDaemonConnection: socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_blocked, id=43788, stack(0x0000008c54500000,0x0000008c54600000)] + 0x0000022531ecd000 JavaThread "Daemon client event forwarder" [_thread_blocked, id=54688, stack(0x0000008c54700000,0x0000008c54800000)] + 0x0000022531ea4800 JavaThread "Cache worker for journal cache (C:\Users\USER\.gradle\caches\journal-1)" [_thread_blocked, id=50804, stack(0x0000008c54800000,0x0000008c54900000)] + 0x0000022531e9f000 JavaThread "File lock request listener" [_thread_in_native, id=48844, stack(0x0000008c54900000,0x0000008c54a00000)] + 0x0000022531ea5800 JavaThread "Cache worker for file hash cache (C:\Users\USER\.gradle\caches\8.0.2\fileHashes)" [_thread_blocked, id=48008, stack(0x0000008c54a00000,0x0000008c54b00000)] + 0x0000022531ea2000 JavaThread "File watcher server" daemon [_thread_blocked, id=47932, stack(0x0000008c54b00000,0x0000008c54c00000)] + 0x0000022531ea0800 JavaThread "File watcher consumer" daemon [_thread_blocked, id=40928, stack(0x0000008c54c00000,0x0000008c54d00000)] + 0x0000022531ea3000 JavaThread "jar transforms" [_thread_blocked, id=20244, stack(0x0000008c54d00000,0x0000008c54e00000)] + 0x0000022531ea4000 JavaThread "jar transforms Thread 2" [_thread_blocked, id=54224, stack(0x0000008c54e00000,0x0000008c54f00000)] + 0x0000022531ea0000 JavaThread "Cache worker for checksums cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\checksums)" [_thread_blocked, id=37804, stack(0x0000008c54f00000,0x0000008c55000000)] + 0x0000022531ea1800 JavaThread "Cache worker for cache directory md-rule (C:\Users\USER\.gradle\caches\8.0.2\md-rule)" [_thread_blocked, id=52184, stack(0x0000008c55000000,0x0000008c55100000)] + 0x0000022533cce800 JavaThread "Cache worker for file content cache (C:\Users\USER\.gradle\caches\8.0.2\fileContent)" [_thread_blocked, id=54940, stack(0x0000008c55100000,0x0000008c55200000)] + 0x0000022533ccb000 JavaThread "Cache worker for file hash cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\fileHashes)" [_thread_blocked, id=50424, stack(0x0000008c55200000,0x0000008c55300000)] + 0x0000022533ccf000 JavaThread "Cache worker for cache directory md-supplier (C:\Users\USER\.gradle\caches\8.0.2\md-supplier)" [_thread_blocked, id=30304, stack(0x0000008c55300000,0x0000008c55400000)] + 0x0000022533cd0000 JavaThread "Cache worker for execution history cache (C:\Users\USER\.gradle\caches\8.0.2\executionHistory)" [_thread_blocked, id=54756, stack(0x0000008c55400000,0x0000008c55500000)] + 0x0000022533cca800 JavaThread "Cache worker for dependencies-accessors (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\dependencies-accessors)" [_thread_blocked, id=54948, stack(0x0000008c55700000,0x0000008c55800000)] + 0x0000022533ccd000 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=54772, stack(0x0000008c55800000,0x0000008c55900000)] + 0x0000022533cd1000 JavaThread "Memory manager" [_thread_blocked, id=64, stack(0x0000008c55900000,0x0000008c55a00000)] + 0x0000022533cd1800 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=51880, stack(0x0000008c55a00000,0x0000008c55b00000)] + 0x0000022533ccc000 JavaThread "Cache worker for kotlin-dsl (C:\Users\USER\.gradle\caches\8.0.2\kotlin-dsl)" [_thread_blocked, id=53304, stack(0x0000008c55b00000,0x0000008c55c00000)] + 0x0000022533cd7800 JavaThread "Unconstrained build operations" [_thread_blocked, id=54808, stack(0x0000008c55c00000,0x0000008c55d00000)] + 0x0000022533cd3800 JavaThread "Unconstrained build operations Thread 2" [_thread_blocked, id=54200, stack(0x0000008c55d00000,0x0000008c55e00000)] + 0x0000022533cd2800 JavaThread "Unconstrained build operations Thread 3" [_thread_blocked, id=49596, stack(0x0000008c55e00000,0x0000008c55f00000)] + 0x0000022533cd4000 JavaThread "Unconstrained build operations Thread 4" [_thread_blocked, id=54500, stack(0x0000008c55f00000,0x0000008c56000000)] + 0x0000022533cd8000 JavaThread "Unconstrained build operations Thread 5" [_thread_blocked, id=52376, stack(0x0000008c56000000,0x0000008c56100000)] + 0x0000022533cd9000 JavaThread "Unconstrained build operations Thread 6" [_thread_blocked, id=54288, stack(0x0000008c56100000,0x0000008c56200000)] + 0x0000022533cd5000 JavaThread "Unconstrained build operations Thread 7" [_thread_blocked, id=55148, stack(0x0000008c56200000,0x0000008c56300000)] + 0x0000022533cd6000 JavaThread "Unconstrained build operations Thread 8" [_thread_blocked, id=54676, stack(0x0000008c56300000,0x0000008c56400000)] + 0x0000022533cd6800 JavaThread "Unconstrained build operations Thread 9" [_thread_blocked, id=52780, stack(0x0000008c56400000,0x0000008c56500000)] + 0x00000225324c2000 JavaThread "Unconstrained build operations Thread 10" [_thread_blocked, id=52528, stack(0x0000008c56500000,0x0000008c56600000)] + 0x00000225324c1800 JavaThread "Unconstrained build operations Thread 11" [_thread_blocked, id=54508, stack(0x0000008c56600000,0x0000008c56700000)] + 0x00000225324be000 JavaThread "Unconstrained build operations Thread 12" [_thread_blocked, id=51544, stack(0x0000008c56700000,0x0000008c56800000)] + 0x00000225324c3000 JavaThread "Unconstrained build operations Thread 13" [_thread_blocked, id=52856, stack(0x0000008c56800000,0x0000008c56900000)] + 0x00000225324c4000 JavaThread "Unconstrained build operations Thread 14" [_thread_blocked, id=30784, stack(0x0000008c56900000,0x0000008c56a00000)] + 0x00000225324c4800 JavaThread "Unconstrained build operations Thread 15" [_thread_blocked, id=41272, stack(0x0000008c56a00000,0x0000008c56b00000)] + 0x00000225324bf000 JavaThread "Unconstrained build operations Thread 16" [_thread_blocked, id=52956, stack(0x0000008c56b00000,0x0000008c56c00000)] + 0x00000225324c5800 JavaThread "Unconstrained build operations Thread 17" [_thread_blocked, id=44264, stack(0x0000008c56c00000,0x0000008c56d00000)] + 0x00000225324bf800 JavaThread "Unconstrained build operations Thread 18" [_thread_blocked, id=54308, stack(0x0000008c56d00000,0x0000008c56e00000)] + 0x00000225324c6800 JavaThread "Unconstrained build operations Thread 19" [_thread_blocked, id=51824, stack(0x0000008c56e00000,0x0000008c56f00000)] + 0x00000225324c0800 JavaThread "Unconstrained build operations Thread 20" [_thread_blocked, id=55232, stack(0x0000008c56f00000,0x0000008c57000000)] + 0x00000225324cb000 JavaThread "included builds" [_thread_blocked, id=54504, stack(0x0000008c52a00000,0x0000008c52b00000)] + 0x00000225324cd000 JavaThread "Execution worker" [_thread_blocked, id=51832, stack(0x0000008c52b00000,0x0000008c52c00000)] + 0x00000225324cc000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=47204, stack(0x0000008c57000000,0x0000008c57100000)] + 0x00000225324c8000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=5536, stack(0x0000008c54600000,0x0000008c54700000)] + +Other Threads: +=>0x00000225319f6800 VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] + 0x0000022531d1a800 WatcherThread [stack: 0x0000008c53c00000,0x0000008c53d00000] [id=53860] + 0x0000022517b73000 GCTaskThread "GC Thread#0" [stack: 0x0000008c52d00000,0x0000008c52e00000] [id=46300] + 0x0000022531c15800 GCTaskThread "GC Thread#1" [stack: 0x0000008c53d00000,0x0000008c53e00000] [id=49096] + 0x0000022517ba3800 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008c52e00000,0x0000008c52f00000] [id=50800] + 0x0000022517ba7800 ConcurrentGCThread "G1 Conc#0" [stack: 0x0000008c52f00000,0x0000008c53000000] [id=39368] + 0x0000022517be4800 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008c53000000,0x0000008c53100000] [id=49560] + 0x0000022517be5800 ConcurrentGCThread "G1 Young RemSet Sampling" [stack: 0x0000008c53100000,0x0000008c53200000] [id=55224] + +Threads with active compile tasks: + +VM state:at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x0000022517b5c200] Threads_lock - owner thread: 0x00000225319f6800 +[0x0000022517b5be10] Heap_lock - owner thread: 0x00000225324c0800 + +Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit +Narrow klass base: 0x0000000000000000, Narrow klass shift: 3 +Compressed class space size: 1073741824 Address: 0x0000000100000000 + +Heap: + garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 1 young (1024K), 1 survivors (1024K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1140736K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, A=archive, TAMS=top-at-mark-start (previous, next) +| 0|0x0000000080000000, 0x0000000080100000, 0x0000000080100000|100%| O| |TAMS 0x0000000080100000, 0x0000000080100000| Untracked +| 1|0x0000000080100000, 0x0000000080200000, 0x0000000080200000|100%|HS| |TAMS 0x0000000080200000, 0x0000000080200000| Complete +| 2|0x0000000080200000, 0x0000000080300000, 0x0000000080300000|100%|HC| |TAMS 0x0000000080300000, 0x0000000080300000| Complete +| 3|0x0000000080300000, 0x0000000080400000, 0x0000000080400000|100%|HC| |TAMS 0x0000000080400000, 0x0000000080400000| Complete +| 4|0x0000000080400000, 0x0000000080500000, 0x0000000080500000|100%|HC| |TAMS 0x0000000080500000, 0x0000000080500000| Complete +| 5|0x0000000080500000, 0x0000000080600000, 0x0000000080600000|100%| O| |TAMS 0x0000000080600000, 0x0000000080600000| Untracked +| 6|0x0000000080600000, 0x0000000080700000, 0x0000000080700000|100%| O| |TAMS 0x0000000080700000, 0x0000000080700000| Untracked +| 7|0x0000000080700000, 0x0000000080800000, 0x0000000080800000|100%| O| |TAMS 0x0000000080800000, 0x0000000080800000| Untracked +| 8|0x0000000080800000, 0x0000000080900000, 0x0000000080900000|100%| O| |TAMS 0x0000000080900000, 0x0000000080900000| Untracked +| 9|0x0000000080900000, 0x0000000080a00000, 0x0000000080a00000|100%| O| |TAMS 0x0000000080a00000, 0x0000000080a00000| Untracked +| 10|0x0000000080a00000, 0x0000000080b00000, 0x0000000080b00000|100%| O| |TAMS 0x0000000080b00000, 0x0000000080b00000| Untracked +| 11|0x0000000080b00000, 0x0000000080c00000, 0x0000000080c00000|100%| O| |TAMS 0x0000000080c00000, 0x0000000080c00000| Untracked +| 12|0x0000000080c00000, 0x0000000080d00000, 0x0000000080d00000|100%| O| |TAMS 0x0000000080d00000, 0x0000000080d00000| Untracked +| 13|0x0000000080d00000, 0x0000000080e00000, 0x0000000080e00000|100%| O| |TAMS 0x0000000080e00000, 0x0000000080e00000| Untracked +| 14|0x0000000080e00000, 0x0000000080f00000, 0x0000000080f00000|100%| O| |TAMS 0x0000000080f00000, 0x0000000080f00000| Untracked +| 15|0x0000000080f00000, 0x0000000081000000, 0x0000000081000000|100%| O| |TAMS 0x0000000081000000, 0x0000000081000000| Untracked +| 16|0x0000000081000000, 0x0000000081100000, 0x0000000081100000|100%| O| |TAMS 0x0000000081100000, 0x0000000081100000| Untracked +| 17|0x0000000081100000, 0x0000000081200000, 0x0000000081200000|100%| O| |TAMS 0x0000000081200000, 0x0000000081200000| Untracked +| 18|0x0000000081200000, 0x0000000081300000, 0x0000000081300000|100%|HS| |TAMS 0x0000000081300000, 0x0000000081300000| Complete +| 19|0x0000000081300000, 0x0000000081400000, 0x0000000081400000|100%|HC| |TAMS 0x0000000081400000, 0x0000000081400000| Complete +| 20|0x0000000081400000, 0x0000000081500000, 0x0000000081500000|100%|HS| |TAMS 0x0000000081500000, 0x0000000081500000| Complete +| 21|0x0000000081500000, 0x0000000081600000, 0x0000000081600000|100%|HC| |TAMS 0x0000000081600000, 0x0000000081600000| Complete +| 22|0x0000000081600000, 0x0000000081700000, 0x0000000081700000|100%|HC| |TAMS 0x0000000081700000, 0x0000000081700000| Complete +| 23|0x0000000081700000, 0x0000000081800000, 0x0000000081800000|100%| O| |TAMS 0x0000000081800000, 0x0000000081800000| Untracked +| 24|0x0000000081800000, 0x0000000081900000, 0x0000000081900000|100%|HS| |TAMS 0x0000000081900000, 0x0000000081900000| Complete +| 25|0x0000000081900000, 0x0000000081a00000, 0x0000000081a00000|100%|HC| |TAMS 0x0000000081a00000, 0x0000000081a00000| Complete +| 26|0x0000000081a00000, 0x0000000081b00000, 0x0000000081b00000|100%|HC| |TAMS 0x0000000081b00000, 0x0000000081b00000| Complete +| 27|0x0000000081b00000, 0x0000000081c00000, 0x0000000081c00000|100%| O| |TAMS 0x0000000081c00000, 0x0000000081c00000| Untracked +| 28|0x0000000081c00000, 0x0000000081d00000, 0x0000000081d00000|100%| O| |TAMS 0x0000000081d00000, 0x0000000081d00000| Untracked +| 29|0x0000000081d00000, 0x0000000081e00000, 0x0000000081e00000|100%| O| |TAMS 0x0000000081e00000, 0x0000000081e00000| Untracked +| 30|0x0000000081e00000, 0x0000000081f00000, 0x0000000081f00000|100%| O| |TAMS 0x0000000081f00000, 0x0000000081f00000| Untracked +| 31|0x0000000081f00000, 0x0000000082000000, 0x0000000082000000|100%|HS| |TAMS 0x0000000082000000, 0x0000000082000000| Complete +| 32|0x0000000082000000, 0x0000000082100000, 0x0000000082100000|100%|HC| |TAMS 0x0000000082100000, 0x0000000082100000| Complete +| 33|0x0000000082100000, 0x0000000082200000, 0x0000000082200000|100%|HC| |TAMS 0x0000000082200000, 0x0000000082200000| Complete +| 34|0x0000000082200000, 0x0000000082300000, 0x0000000082300000|100%|HC| |TAMS 0x0000000082300000, 0x0000000082300000| Complete +| 35|0x0000000082300000, 0x0000000082400000, 0x0000000082400000|100%|HS| |TAMS 0x0000000082400000, 0x0000000082400000| Complete +| 36|0x0000000082400000, 0x0000000082500000, 0x0000000082500000|100%|HC| |TAMS 0x0000000082500000, 0x0000000082500000| Complete +| 37|0x0000000082500000, 0x0000000082600000, 0x0000000082600000|100%|HC| |TAMS 0x0000000082600000, 0x0000000082600000| Complete +| 38|0x0000000082600000, 0x0000000082700000, 0x0000000082700000|100%|HC| |TAMS 0x0000000082700000, 0x0000000082700000| Complete +| 39|0x0000000082700000, 0x0000000082800000, 0x0000000082800000|100%|HC| |TAMS 0x0000000082800000, 0x0000000082800000| Complete +| 40|0x0000000082800000, 0x0000000082900000, 0x0000000082900000|100%| O| |TAMS 0x0000000082900000, 0x0000000082900000| Untracked +| 41|0x0000000082900000, 0x0000000082a00000, 0x0000000082a00000|100%| O| |TAMS 0x0000000082a00000, 0x0000000082a00000| Untracked +| 42|0x0000000082a00000, 0x0000000082b00000, 0x0000000082b00000|100%|HS| |TAMS 0x0000000082b00000, 0x0000000082b00000| Complete +| 43|0x0000000082b00000, 0x0000000082c00000, 0x0000000082c00000|100%| O| |TAMS 0x0000000082c00000, 0x0000000082c00000| Untracked +| 44|0x0000000082c00000, 0x0000000082d00000, 0x0000000082d00000|100%| O| |TAMS 0x0000000082d00000, 0x0000000082d00000| Untracked +| 45|0x0000000082d00000, 0x0000000082e00000, 0x0000000082e00000|100%| O| |TAMS 0x0000000082e00000, 0x0000000082e00000| Untracked +| 46|0x0000000082e00000, 0x0000000082f00000, 0x0000000082f00000|100%| O| |TAMS 0x0000000082f00000, 0x0000000082f00000| Untracked +| 47|0x0000000082f00000, 0x0000000083000000, 0x0000000083000000|100%| O| |TAMS 0x0000000083000000, 0x0000000083000000| Untracked +| 48|0x0000000083000000, 0x0000000083100000, 0x0000000083100000|100%| O| |TAMS 0x0000000083100000, 0x0000000083100000| Untracked +| 49|0x0000000083100000, 0x0000000083200000, 0x0000000083200000|100%|HS| |TAMS 0x0000000083200000, 0x0000000083200000| Complete +| 50|0x0000000083200000, 0x0000000083300000, 0x0000000083300000|100%|HC| |TAMS 0x0000000083300000, 0x0000000083300000| Complete +| 51|0x0000000083300000, 0x0000000083400000, 0x0000000083400000|100%|HC| |TAMS 0x0000000083400000, 0x0000000083400000| Complete +| 52|0x0000000083400000, 0x0000000083500000, 0x0000000083500000|100%|HS| |TAMS 0x0000000083500000, 0x0000000083500000| Complete +| 53|0x0000000083500000, 0x0000000083600000, 0x0000000083600000|100%|HC| |TAMS 0x0000000083600000, 0x0000000083600000| Complete +| 54|0x0000000083600000, 0x0000000083700000, 0x0000000083700000|100%| O| |TAMS 0x0000000083700000, 0x0000000083700000| Untracked +| 55|0x0000000083700000, 0x0000000083800000, 0x0000000083800000|100%| O| |TAMS 0x0000000083800000, 0x0000000083800000| Untracked +| 56|0x0000000083800000, 0x0000000083900000, 0x0000000083900000|100%|HS| |TAMS 0x0000000083900000, 0x0000000083900000| Complete +| 57|0x0000000083900000, 0x0000000083a00000, 0x0000000083a00000|100%|HC| |TAMS 0x0000000083a00000, 0x0000000083a00000| Complete +| 58|0x0000000083a00000, 0x0000000083b00000, 0x0000000083b00000|100%|HC| |TAMS 0x0000000083b00000, 0x0000000083b00000| Complete +| 59|0x0000000083b00000, 0x0000000083c00000, 0x0000000083c00000|100%|HS| |TAMS 0x0000000083c00000, 0x0000000083c00000| Complete +| 60|0x0000000083c00000, 0x0000000083d00000, 0x0000000083d00000|100%|HC| |TAMS 0x0000000083d00000, 0x0000000083d00000| Complete +| 61|0x0000000083d00000, 0x0000000083e00000, 0x0000000083e00000|100%|HC| |TAMS 0x0000000083e00000, 0x0000000083e00000| Complete +| 62|0x0000000083e00000, 0x0000000083f00000, 0x0000000083f00000|100%|HC| |TAMS 0x0000000083f00000, 0x0000000083f00000| Complete +| 63|0x0000000083f00000, 0x0000000084000000, 0x0000000084000000|100%| O| |TAMS 0x0000000084000000, 0x0000000084000000| Untracked +| 64|0x0000000084000000, 0x0000000084100000, 0x0000000084100000|100%| O| |TAMS 0x0000000084100000, 0x0000000084100000| Untracked +| 65|0x0000000084100000, 0x0000000084200000, 0x0000000084200000|100%| O| |TAMS 0x0000000084200000, 0x0000000084200000| Untracked +| 66|0x0000000084200000, 0x0000000084300000, 0x0000000084300000|100%| O| |TAMS 0x0000000084300000, 0x0000000084300000| Untracked +| 67|0x0000000084300000, 0x0000000084400000, 0x0000000084400000|100%| O| |TAMS 0x0000000084400000, 0x0000000084400000| Untracked +| 68|0x0000000084400000, 0x0000000084500000, 0x0000000084500000|100%| O| |TAMS 0x0000000084500000, 0x0000000084500000| Untracked +| 69|0x0000000084500000, 0x0000000084600000, 0x0000000084600000|100%| O| |TAMS 0x0000000084600000, 0x0000000084600000| Untracked +| 70|0x0000000084600000, 0x0000000084700000, 0x0000000084700000|100%| O| |TAMS 0x0000000084700000, 0x0000000084700000| Untracked +| 71|0x0000000084700000, 0x0000000084800000, 0x0000000084800000|100%| O| |TAMS 0x0000000084800000, 0x0000000084800000| Untracked +| 72|0x0000000084800000, 0x0000000084900000, 0x0000000084900000|100%|HS| |TAMS 0x0000000084900000, 0x0000000084900000| Complete +| 73|0x0000000084900000, 0x0000000084a00000, 0x0000000084a00000|100%|HC| |TAMS 0x0000000084a00000, 0x0000000084a00000| Complete +| 74|0x0000000084a00000, 0x0000000084b00000, 0x0000000084b00000|100%|HC| |TAMS 0x0000000084b00000, 0x0000000084b00000| Complete +| 75|0x0000000084b00000, 0x0000000084c00000, 0x0000000084c00000|100%|HC| |TAMS 0x0000000084c00000, 0x0000000084c00000| Complete +| 76|0x0000000084c00000, 0x0000000084d00000, 0x0000000084d00000|100%|HC| |TAMS 0x0000000084d00000, 0x0000000084d00000| Complete +| 77|0x0000000084d00000, 0x0000000084e00000, 0x0000000084e00000|100%| O| |TAMS 0x0000000084e00000, 0x0000000084e00000| Untracked +| 78|0x0000000084e00000, 0x0000000084f00000, 0x0000000084f00000|100%| O| |TAMS 0x0000000084f00000, 0x0000000084f00000| Untracked +| 79|0x0000000084f00000, 0x0000000085000000, 0x0000000085000000|100%| O| |TAMS 0x0000000085000000, 0x0000000085000000| Untracked +| 80|0x0000000085000000, 0x0000000085100000, 0x0000000085100000|100%| O| |TAMS 0x0000000085100000, 0x0000000085100000| Untracked +| 81|0x0000000085100000, 0x0000000085200000, 0x0000000085200000|100%| O| |TAMS 0x0000000085200000, 0x0000000085200000| Untracked +| 82|0x0000000085200000, 0x0000000085300000, 0x0000000085300000|100%| O| |TAMS 0x0000000085300000, 0x0000000085300000| Untracked +| 83|0x0000000085300000, 0x0000000085400000, 0x0000000085400000|100%|HS| |TAMS 0x0000000085400000, 0x0000000085400000| Complete +| 84|0x0000000085400000, 0x0000000085500000, 0x0000000085500000|100%|HC| |TAMS 0x0000000085500000, 0x0000000085500000| Complete +| 85|0x0000000085500000, 0x0000000085600000, 0x0000000085600000|100%|HS| |TAMS 0x0000000085600000, 0x0000000085600000| Complete +| 86|0x0000000085600000, 0x0000000085700000, 0x0000000085700000|100%|HC| |TAMS 0x0000000085700000, 0x0000000085700000| Complete +| 87|0x0000000085700000, 0x0000000085800000, 0x0000000085800000|100%|HC| |TAMS 0x0000000085800000, 0x0000000085800000| Complete +| 88|0x0000000085800000, 0x0000000085900000, 0x0000000085900000|100%|HC| |TAMS 0x0000000085900000, 0x0000000085900000| Complete +| 89|0x0000000085900000, 0x0000000085a00000, 0x0000000085a00000|100%| O| |TAMS 0x0000000085a00000, 0x0000000085a00000| Untracked +| 90|0x0000000085a00000, 0x0000000085b00000, 0x0000000085b00000|100%| O| |TAMS 0x0000000085b00000, 0x0000000085b00000| Untracked +| 91|0x0000000085b00000, 0x0000000085c00000, 0x0000000085c00000|100%| O| |TAMS 0x0000000085c00000, 0x0000000085c00000| Untracked +| 92|0x0000000085c00000, 0x0000000085d00000, 0x0000000085d00000|100%| O| |TAMS 0x0000000085d00000, 0x0000000085d00000| Untracked +| 93|0x0000000085d00000, 0x0000000085e00000, 0x0000000085e00000|100%| O| |TAMS 0x0000000085e00000, 0x0000000085e00000| Untracked +| 94|0x0000000085e00000, 0x0000000085f00000, 0x0000000085f00000|100%| O| |TAMS 0x0000000085f00000, 0x0000000085f00000| Untracked +| 95|0x0000000085f00000, 0x0000000086000000, 0x0000000086000000|100%| O| |TAMS 0x0000000086000000, 0x0000000086000000| Untracked +| 96|0x0000000086000000, 0x0000000086100000, 0x0000000086100000|100%| O| |TAMS 0x0000000086100000, 0x0000000086100000| Untracked +| 97|0x0000000086100000, 0x0000000086200000, 0x0000000086200000|100%| O| |TAMS 0x0000000086200000, 0x0000000086200000| Untracked +| 98|0x0000000086200000, 0x0000000086300000, 0x0000000086300000|100%| O| |TAMS 0x0000000086300000, 0x0000000086300000| Untracked +| 99|0x0000000086300000, 0x0000000086400000, 0x0000000086400000|100%| O| |TAMS 0x0000000086400000, 0x0000000086400000| Untracked +| 100|0x0000000086400000, 0x0000000086500000, 0x0000000086500000|100%| O| |TAMS 0x0000000086500000, 0x0000000086500000| Untracked +| 101|0x0000000086500000, 0x0000000086600000, 0x0000000086600000|100%| O| |TAMS 0x0000000086600000, 0x0000000086600000| Untracked +| 102|0x0000000086600000, 0x0000000086700000, 0x0000000086700000|100%| O| |TAMS 0x0000000086700000, 0x0000000086700000| Untracked +| 103|0x0000000086700000, 0x0000000086800000, 0x0000000086800000|100%| O| |TAMS 0x0000000086800000, 0x0000000086800000| Untracked +| 104|0x0000000086800000, 0x0000000086900000, 0x0000000086900000|100%|HS| |TAMS 0x0000000086800000, 0x0000000086900000| Complete +| 105|0x0000000086900000, 0x0000000086a00000, 0x0000000086a00000|100%|HC| |TAMS 0x0000000086900000, 0x0000000086a00000| Complete +| 106|0x0000000086a00000, 0x0000000086b00000, 0x0000000086b00000|100%|HS| |TAMS 0x0000000086a00000, 0x0000000086b00000| Complete +| 107|0x0000000086b00000, 0x0000000086c00000, 0x0000000086c00000|100%|HC| |TAMS 0x0000000086b00000, 0x0000000086c00000| Complete +| 108|0x0000000086c00000, 0x0000000086d00000, 0x0000000086d00000|100%|HC| |TAMS 0x0000000086c00000, 0x0000000086d00000| Complete +| 109|0x0000000086d00000, 0x0000000086e00000, 0x0000000086e00000|100%|HS| |TAMS 0x0000000086d00000, 0x0000000086e00000| Complete +| 110|0x0000000086e00000, 0x0000000086f00000, 0x0000000086f00000|100%|HC| |TAMS 0x0000000086e00000, 0x0000000086f00000| Complete +| 111|0x0000000086f00000, 0x0000000087000000, 0x0000000087000000|100%|HC| |TAMS 0x0000000086f00000, 0x0000000087000000| Complete +| 112|0x0000000087000000, 0x0000000087100000, 0x0000000087100000|100%|HS| |TAMS 0x0000000087000000, 0x0000000087100000| Complete +| 113|0x0000000087100000, 0x0000000087200000, 0x0000000087200000|100%|HC| |TAMS 0x0000000087100000, 0x0000000087200000| Complete +| 114|0x0000000087200000, 0x0000000087300000, 0x0000000087300000|100%|HC| |TAMS 0x0000000087200000, 0x0000000087300000| Complete +| 115|0x0000000087300000, 0x0000000087400000, 0x0000000087400000|100%|HC| |TAMS 0x0000000087300000, 0x0000000087400000| Complete +| 116|0x0000000087400000, 0x0000000087500000, 0x0000000087500000|100%|HS| |TAMS 0x0000000087400000, 0x0000000087500000| Complete +| 117|0x0000000087500000, 0x0000000087600000, 0x0000000087600000|100%|HC| |TAMS 0x0000000087500000, 0x0000000087600000| Complete +| 118|0x0000000087600000, 0x0000000087700000, 0x0000000087700000|100%|HC| |TAMS 0x0000000087600000, 0x0000000087700000| Complete +| 119|0x0000000087700000, 0x0000000087800000, 0x0000000087800000|100%|HC| |TAMS 0x0000000087700000, 0x0000000087800000| Complete +| 120|0x0000000087800000, 0x0000000087900000, 0x0000000087900000|100%|HC| |TAMS 0x0000000087800000, 0x0000000087900000| Complete +| 121|0x0000000087900000, 0x0000000087a00000, 0x0000000087a00000|100%|HS| |TAMS 0x0000000087900000, 0x0000000087a00000| Complete +| 122|0x0000000087a00000, 0x0000000087b00000, 0x0000000087b00000|100%| O| |TAMS 0x0000000087a00000, 0x0000000087b00000| Untracked +| 123|0x0000000087b00000, 0x0000000087c00000, 0x0000000087c00000|100%| O| |TAMS 0x0000000087b00000, 0x0000000087c00000| Untracked +| 124|0x0000000087c00000, 0x0000000087d00000, 0x0000000087d00000|100%| O| |TAMS 0x0000000087c00000, 0x0000000087d00000| Untracked +| 125|0x0000000087d00000, 0x0000000087e00000, 0x0000000087e00000|100%| O| |TAMS 0x0000000087d00000, 0x0000000087e00000| Untracked +| 126|0x0000000087e00000, 0x0000000087f00000, 0x0000000087f00000|100%| O| |TAMS 0x0000000087e00000, 0x0000000087f00000| Untracked +| 127|0x0000000087f00000, 0x0000000088000000, 0x0000000088000000|100%| O| |TAMS 0x0000000087f00000, 0x0000000088000000| Untracked +| 128|0x0000000088000000, 0x0000000088100000, 0x0000000088100000|100%| O| |TAMS 0x0000000088000000, 0x0000000088100000| Untracked +| 129|0x0000000088100000, 0x0000000088200000, 0x0000000088200000|100%| O| |TAMS 0x0000000088100000, 0x0000000088200000| Untracked +| 130|0x0000000088200000, 0x0000000088300000, 0x0000000088300000|100%| O| |TAMS 0x0000000088200000, 0x0000000088300000| Untracked +| 131|0x0000000088300000, 0x0000000088400000, 0x0000000088400000|100%| O| |TAMS 0x0000000088300000, 0x0000000088400000| Untracked +| 132|0x0000000088400000, 0x0000000088500000, 0x0000000088500000|100%| O| |TAMS 0x0000000088400000, 0x0000000088500000| Untracked +| 133|0x0000000088500000, 0x0000000088600000, 0x0000000088600000|100%| O| |TAMS 0x0000000088500000, 0x0000000088600000| Untracked +| 134|0x0000000088600000, 0x0000000088600000, 0x0000000088700000| 0%| F| |TAMS 0x0000000088600000, 0x0000000088600000| Untracked +| 135|0x0000000088700000, 0x0000000088700000, 0x0000000088800000| 0%| F| |TAMS 0x0000000088700000, 0x0000000088700000| Untracked +| 136|0x0000000088800000, 0x0000000088800000, 0x0000000088900000| 0%| F| |TAMS 0x0000000088800000, 0x0000000088800000| Untracked +| 137|0x0000000088900000, 0x0000000088900000, 0x0000000088a00000| 0%| F| |TAMS 0x0000000088900000, 0x0000000088900000| Untracked +| 138|0x0000000088a00000, 0x0000000088a00000, 0x0000000088b00000| 0%| F| |TAMS 0x0000000088a00000, 0x0000000088a00000| Untracked +| 139|0x0000000088b00000, 0x0000000088b00000, 0x0000000088c00000| 0%| F| |TAMS 0x0000000088b00000, 0x0000000088b00000| Untracked +| 140|0x0000000088c00000, 0x0000000088c00000, 0x0000000088d00000| 0%| F| |TAMS 0x0000000088c00000, 0x0000000088c00000| Untracked +| 141|0x0000000088d00000, 0x0000000088d00000, 0x0000000088e00000| 0%| F| |TAMS 0x0000000088d00000, 0x0000000088d00000| Untracked +| 142|0x0000000088e00000, 0x0000000088e00000, 0x0000000088f00000| 0%| F| |TAMS 0x0000000088e00000, 0x0000000088e00000| Untracked +| 143|0x0000000088f00000, 0x0000000088f00000, 0x0000000089000000| 0%| F| |TAMS 0x0000000088f00000, 0x0000000088f00000| Untracked +| 144|0x0000000089000000, 0x0000000089000000, 0x0000000089100000| 0%| F| |TAMS 0x0000000089000000, 0x0000000089000000| Untracked +| 145|0x0000000089100000, 0x0000000089100000, 0x0000000089200000| 0%| F| |TAMS 0x0000000089100000, 0x0000000089100000| Untracked +| 146|0x0000000089200000, 0x0000000089200000, 0x0000000089300000| 0%| F| |TAMS 0x0000000089200000, 0x0000000089200000| Untracked +| 147|0x0000000089300000, 0x0000000089300000, 0x0000000089400000| 0%| F| |TAMS 0x0000000089300000, 0x0000000089300000| Untracked +| 148|0x0000000089400000, 0x0000000089400000, 0x0000000089500000| 0%| F| |TAMS 0x0000000089400000, 0x0000000089400000| Untracked +| 149|0x0000000089500000, 0x0000000089500000, 0x0000000089600000| 0%| F| |TAMS 0x0000000089500000, 0x0000000089500000| Untracked +| 150|0x0000000089600000, 0x0000000089600000, 0x0000000089700000| 0%| F| |TAMS 0x0000000089600000, 0x0000000089600000| Untracked +| 151|0x0000000089700000, 0x0000000089700000, 0x0000000089800000| 0%| F| |TAMS 0x0000000089700000, 0x0000000089700000| Untracked +| 152|0x0000000089800000, 0x0000000089800000, 0x0000000089900000| 0%| F| |TAMS 0x0000000089800000, 0x0000000089800000| Untracked +| 153|0x0000000089900000, 0x0000000089900000, 0x0000000089a00000| 0%| F| |TAMS 0x0000000089900000, 0x0000000089900000| Untracked +| 154|0x0000000089a00000, 0x0000000089a00000, 0x0000000089b00000| 0%| F| |TAMS 0x0000000089a00000, 0x0000000089a00000| Untracked +| 155|0x0000000089b00000, 0x0000000089b00000, 0x0000000089c00000| 0%| F| |TAMS 0x0000000089b00000, 0x0000000089b00000| Untracked +| 156|0x0000000089c00000, 0x0000000089c00000, 0x0000000089d00000| 0%| F| |TAMS 0x0000000089c00000, 0x0000000089c00000| Untracked +| 157|0x0000000089d00000, 0x0000000089d00000, 0x0000000089e00000| 0%| F| |TAMS 0x0000000089d00000, 0x0000000089d00000| Untracked +| 158|0x0000000089e00000, 0x0000000089e00000, 0x0000000089f00000| 0%| F| |TAMS 0x0000000089e00000, 0x0000000089e00000| Untracked +| 159|0x0000000089f00000, 0x0000000089f00000, 0x000000008a000000| 0%| F| |TAMS 0x0000000089f00000, 0x0000000089f00000| Untracked +| 160|0x000000008a000000, 0x000000008a000000, 0x000000008a100000| 0%| F| |TAMS 0x000000008a000000, 0x000000008a000000| Untracked +| 161|0x000000008a100000, 0x000000008a100000, 0x000000008a200000| 0%| F| |TAMS 0x000000008a100000, 0x000000008a100000| Untracked +| 162|0x000000008a200000, 0x000000008a200000, 0x000000008a300000| 0%| F| |TAMS 0x000000008a200000, 0x000000008a200000| Untracked +| 163|0x000000008a300000, 0x000000008a300000, 0x000000008a400000| 0%| F| |TAMS 0x000000008a300000, 0x000000008a300000| Untracked +| 164|0x000000008a400000, 0x000000008a400000, 0x000000008a500000| 0%| F| |TAMS 0x000000008a400000, 0x000000008a400000| Untracked +| 165|0x000000008a500000, 0x000000008a500000, 0x000000008a600000| 0%| F| |TAMS 0x000000008a500000, 0x000000008a500000| Untracked +| 166|0x000000008a600000, 0x000000008a600000, 0x000000008a700000| 0%| F| |TAMS 0x000000008a600000, 0x000000008a600000| Untracked +| 167|0x000000008a700000, 0x000000008a700000, 0x000000008a800000| 0%| F| |TAMS 0x000000008a700000, 0x000000008a700000| Untracked +| 168|0x000000008a800000, 0x000000008a800000, 0x000000008a900000| 0%| F| |TAMS 0x000000008a800000, 0x000000008a800000| Untracked +| 169|0x000000008a900000, 0x000000008a900000, 0x000000008aa00000| 0%| F| |TAMS 0x000000008a900000, 0x000000008a900000| Untracked +| 170|0x000000008aa00000, 0x000000008aa00000, 0x000000008ab00000| 0%| F| |TAMS 0x000000008aa00000, 0x000000008aa00000| Untracked +| 171|0x000000008ab00000, 0x000000008ab00000, 0x000000008ac00000| 0%| F| |TAMS 0x000000008ab00000, 0x000000008ab00000| Untracked +| 172|0x000000008ac00000, 0x000000008ac00000, 0x000000008ad00000| 0%| F| |TAMS 0x000000008ac00000, 0x000000008ac00000| Untracked +| 173|0x000000008ad00000, 0x000000008ad00000, 0x000000008ae00000| 0%| F| |TAMS 0x000000008ad00000, 0x000000008ad00000| Untracked +| 174|0x000000008ae00000, 0x000000008ae00000, 0x000000008af00000| 0%| F| |TAMS 0x000000008ae00000, 0x000000008ae00000| Untracked +| 175|0x000000008af00000, 0x000000008af00000, 0x000000008b000000| 0%| F| |TAMS 0x000000008af00000, 0x000000008af00000| Untracked +| 176|0x000000008b000000, 0x000000008b000000, 0x000000008b100000| 0%| F| |TAMS 0x000000008b000000, 0x000000008b000000| Untracked +| 177|0x000000008b100000, 0x000000008b100000, 0x000000008b200000| 0%| F| |TAMS 0x000000008b100000, 0x000000008b100000| Untracked +| 178|0x000000008b200000, 0x000000008b200000, 0x000000008b300000| 0%| F| |TAMS 0x000000008b200000, 0x000000008b200000| Untracked +| 179|0x000000008b300000, 0x000000008b300000, 0x000000008b400000| 0%| F| |TAMS 0x000000008b300000, 0x000000008b300000| Untracked +| 180|0x000000008b400000, 0x000000008b400000, 0x000000008b500000| 0%| F| |TAMS 0x000000008b400000, 0x000000008b400000| Untracked +| 181|0x000000008b500000, 0x000000008b500000, 0x000000008b600000| 0%| F| |TAMS 0x000000008b500000, 0x000000008b500000| Untracked +| 182|0x000000008b600000, 0x000000008b600000, 0x000000008b700000| 0%| F| |TAMS 0x000000008b600000, 0x000000008b600000| Untracked +| 183|0x000000008b700000, 0x000000008b700000, 0x000000008b800000| 0%| F| |TAMS 0x000000008b700000, 0x000000008b700000| Untracked +| 184|0x000000008b800000, 0x000000008b800000, 0x000000008b900000| 0%| F| |TAMS 0x000000008b800000, 0x000000008b800000| Untracked +| 185|0x000000008b900000, 0x000000008b900000, 0x000000008ba00000| 0%| F| |TAMS 0x000000008b900000, 0x000000008b900000| Untracked +| 186|0x000000008ba00000, 0x000000008ba00000, 0x000000008bb00000| 0%| F| |TAMS 0x000000008ba00000, 0x000000008ba00000| Untracked +| 187|0x000000008bb00000, 0x000000008bb00000, 0x000000008bc00000| 0%| F| |TAMS 0x000000008bb00000, 0x000000008bb00000| Untracked +| 188|0x000000008bc00000, 0x000000008bc00000, 0x000000008bd00000| 0%| F| |TAMS 0x000000008bc00000, 0x000000008bc00000| Untracked +| 189|0x000000008bd00000, 0x000000008bd00000, 0x000000008be00000| 0%| F| |TAMS 0x000000008bd00000, 0x000000008bd00000| Untracked +| 190|0x000000008be00000, 0x000000008be00000, 0x000000008bf00000| 0%| F| |TAMS 0x000000008be00000, 0x000000008be00000| Untracked +| 191|0x000000008bf00000, 0x000000008bf00000, 0x000000008c000000| 0%| F| |TAMS 0x000000008bf00000, 0x000000008bf00000| Untracked +| 192|0x000000008c000000, 0x000000008c000000, 0x000000008c100000| 0%| F| |TAMS 0x000000008c000000, 0x000000008c000000| Untracked +| 193|0x000000008c100000, 0x000000008c100000, 0x000000008c200000| 0%| F| |TAMS 0x000000008c100000, 0x000000008c100000| Untracked +| 194|0x000000008c200000, 0x000000008c200000, 0x000000008c300000| 0%| F| |TAMS 0x000000008c200000, 0x000000008c200000| Untracked +| 195|0x000000008c300000, 0x000000008c300000, 0x000000008c400000| 0%| F| |TAMS 0x000000008c300000, 0x000000008c300000| Untracked +| 196|0x000000008c400000, 0x000000008c400000, 0x000000008c500000| 0%| F| |TAMS 0x000000008c400000, 0x000000008c400000| Untracked +| 197|0x000000008c500000, 0x000000008c500000, 0x000000008c600000| 0%| F| |TAMS 0x000000008c500000, 0x000000008c500000| Untracked +| 198|0x000000008c600000, 0x000000008c600000, 0x000000008c700000| 0%| F| |TAMS 0x000000008c600000, 0x000000008c600000| Untracked +| 199|0x000000008c700000, 0x000000008c700000, 0x000000008c800000| 0%| F| |TAMS 0x000000008c700000, 0x000000008c700000| Untracked +| 200|0x000000008c800000, 0x000000008c800000, 0x000000008c900000| 0%| F| |TAMS 0x000000008c800000, 0x000000008c800000| Untracked +| 201|0x000000008c900000, 0x000000008c900000, 0x000000008ca00000| 0%| F| |TAMS 0x000000008c900000, 0x000000008c900000| Untracked +| 202|0x000000008ca00000, 0x000000008ca00000, 0x000000008cb00000| 0%| F| |TAMS 0x000000008ca00000, 0x000000008ca00000| Untracked +| 203|0x000000008cb00000, 0x000000008cb00000, 0x000000008cc00000| 0%| F| |TAMS 0x000000008cb00000, 0x000000008cb00000| Untracked +| 204|0x000000008cc00000, 0x000000008cc00000, 0x000000008cd00000| 0%| F| |TAMS 0x000000008cc00000, 0x000000008cc00000| Untracked +| 205|0x000000008cd00000, 0x000000008cd00000, 0x000000008ce00000| 0%| F| |TAMS 0x000000008cd00000, 0x000000008cd00000| Untracked +| 206|0x000000008ce00000, 0x000000008ce00000, 0x000000008cf00000| 0%| F| |TAMS 0x000000008ce00000, 0x000000008ce00000| Untracked +| 207|0x000000008cf00000, 0x000000008cf00000, 0x000000008d000000| 0%| F| |TAMS 0x000000008cf00000, 0x000000008cf00000| Untracked +| 208|0x000000008d000000, 0x000000008d000000, 0x000000008d100000| 0%| F| |TAMS 0x000000008d000000, 0x000000008d000000| Untracked +| 209|0x000000008d100000, 0x000000008d100000, 0x000000008d200000| 0%| F| |TAMS 0x000000008d100000, 0x000000008d100000| Untracked +| 210|0x000000008d200000, 0x000000008d200000, 0x000000008d300000| 0%| F| |TAMS 0x000000008d200000, 0x000000008d200000| Untracked +| 211|0x000000008d300000, 0x000000008d300000, 0x000000008d400000| 0%| F| |TAMS 0x000000008d300000, 0x000000008d300000| Untracked +| 212|0x000000008d400000, 0x000000008d400000, 0x000000008d500000| 0%| F| |TAMS 0x000000008d400000, 0x000000008d400000| Untracked +| 213|0x000000008d500000, 0x000000008d500000, 0x000000008d600000| 0%| F| |TAMS 0x000000008d500000, 0x000000008d500000| Untracked +| 214|0x000000008d600000, 0x000000008d600000, 0x000000008d700000| 0%| F| |TAMS 0x000000008d600000, 0x000000008d600000| Untracked +| 215|0x000000008d700000, 0x000000008d700000, 0x000000008d800000| 0%| F| |TAMS 0x000000008d700000, 0x000000008d700000| Untracked +| 216|0x000000008d800000, 0x000000008d800000, 0x000000008d900000| 0%| F| |TAMS 0x000000008d800000, 0x000000008d800000| Untracked +| 217|0x000000008d900000, 0x000000008d900000, 0x000000008da00000| 0%| F| |TAMS 0x000000008d900000, 0x000000008d900000| Untracked +| 218|0x000000008da00000, 0x000000008da00000, 0x000000008db00000| 0%| F| |TAMS 0x000000008da00000, 0x000000008da00000| Untracked +| 219|0x000000008db00000, 0x000000008db00000, 0x000000008dc00000| 0%| F| |TAMS 0x000000008db00000, 0x000000008db00000| Untracked +| 220|0x000000008dc00000, 0x000000008dc00000, 0x000000008dd00000| 0%| F| |TAMS 0x000000008dc00000, 0x000000008dc00000| Untracked +| 221|0x000000008dd00000, 0x000000008dd00000, 0x000000008de00000| 0%| F| |TAMS 0x000000008dd00000, 0x000000008dd00000| Untracked +| 222|0x000000008de00000, 0x000000008de00000, 0x000000008df00000| 0%| F| |TAMS 0x000000008de00000, 0x000000008de00000| Untracked +| 223|0x000000008df00000, 0x000000008df00000, 0x000000008e000000| 0%| F| |TAMS 0x000000008df00000, 0x000000008df00000| Untracked +| 224|0x000000008e000000, 0x000000008e000000, 0x000000008e100000| 0%| F| |TAMS 0x000000008e000000, 0x000000008e000000| Untracked +| 225|0x000000008e100000, 0x000000008e100000, 0x000000008e200000| 0%| F| |TAMS 0x000000008e100000, 0x000000008e100000| Untracked +| 226|0x000000008e200000, 0x000000008e200000, 0x000000008e300000| 0%| F| |TAMS 0x000000008e200000, 0x000000008e200000| Untracked +| 227|0x000000008e300000, 0x000000008e300000, 0x000000008e400000| 0%| F| |TAMS 0x000000008e300000, 0x000000008e300000| Untracked +| 228|0x000000008e400000, 0x000000008e400000, 0x000000008e500000| 0%| F| |TAMS 0x000000008e400000, 0x000000008e400000| Untracked +| 229|0x000000008e500000, 0x000000008e500000, 0x000000008e600000| 0%| F| |TAMS 0x000000008e500000, 0x000000008e500000| Untracked +| 230|0x000000008e600000, 0x000000008e600000, 0x000000008e700000| 0%| F| |TAMS 0x000000008e600000, 0x000000008e600000| Untracked +| 231|0x000000008e700000, 0x000000008e700000, 0x000000008e800000| 0%| F| |TAMS 0x000000008e700000, 0x000000008e700000| Untracked +| 232|0x000000008e800000, 0x000000008e800000, 0x000000008e900000| 0%| F| |TAMS 0x000000008e800000, 0x000000008e800000| Untracked +| 233|0x000000008e900000, 0x000000008e900000, 0x000000008ea00000| 0%| F| |TAMS 0x000000008e900000, 0x000000008e900000| Untracked +| 234|0x000000008ea00000, 0x000000008ea00000, 0x000000008eb00000| 0%| F| |TAMS 0x000000008ea00000, 0x000000008ea00000| Untracked +| 235|0x000000008eb00000, 0x000000008eb00000, 0x000000008ec00000| 0%| F| |TAMS 0x000000008eb00000, 0x000000008eb00000| Untracked +| 236|0x000000008ec00000, 0x000000008ec00000, 0x000000008ed00000| 0%| F| |TAMS 0x000000008ec00000, 0x000000008ec00000| Untracked +| 237|0x000000008ed00000, 0x000000008ed00000, 0x000000008ee00000| 0%| F| |TAMS 0x000000008ed00000, 0x000000008ed00000| Untracked +| 238|0x000000008ee00000, 0x000000008ee00000, 0x000000008ef00000| 0%| F| |TAMS 0x000000008ee00000, 0x000000008ee00000| Untracked +| 239|0x000000008ef00000, 0x000000008ef00000, 0x000000008f000000| 0%| F| |TAMS 0x000000008ef00000, 0x000000008ef00000| Untracked +| 240|0x000000008f000000, 0x000000008f000000, 0x000000008f100000| 0%| F| |TAMS 0x000000008f000000, 0x000000008f000000| Untracked +| 241|0x000000008f100000, 0x000000008f100000, 0x000000008f200000| 0%| F| |TAMS 0x000000008f100000, 0x000000008f100000| Untracked +| 242|0x000000008f200000, 0x000000008f200000, 0x000000008f300000| 0%| F| |TAMS 0x000000008f200000, 0x000000008f200000| Untracked +| 243|0x000000008f300000, 0x000000008f300000, 0x000000008f400000| 0%| F| |TAMS 0x000000008f300000, 0x000000008f300000| Untracked +| 244|0x000000008f400000, 0x000000008f400000, 0x000000008f500000| 0%| F| |TAMS 0x000000008f400000, 0x000000008f400000| Untracked +| 245|0x000000008f500000, 0x000000008f500000, 0x000000008f600000| 0%| F| |TAMS 0x000000008f500000, 0x000000008f500000| Untracked +| 246|0x000000008f600000, 0x000000008f600000, 0x000000008f700000| 0%| F| |TAMS 0x000000008f600000, 0x000000008f600000| Untracked +| 247|0x000000008f700000, 0x000000008f700000, 0x000000008f800000| 0%| F| |TAMS 0x000000008f700000, 0x000000008f700000| Untracked +| 248|0x000000008f800000, 0x000000008f800000, 0x000000008f900000| 0%| F| |TAMS 0x000000008f800000, 0x000000008f800000| Untracked +| 249|0x000000008f900000, 0x000000008f900000, 0x000000008fa00000| 0%| F| |TAMS 0x000000008f900000, 0x000000008f900000| Untracked +| 250|0x000000008fa00000, 0x000000008fa00000, 0x000000008fb00000| 0%| F| |TAMS 0x000000008fa00000, 0x000000008fa00000| Untracked +| 251|0x000000008fb00000, 0x000000008fb00000, 0x000000008fc00000| 0%| F| |TAMS 0x000000008fb00000, 0x000000008fb00000| Untracked +| 252|0x000000008fc00000, 0x000000008fc00000, 0x000000008fd00000| 0%| F| |TAMS 0x000000008fc00000, 0x000000008fc00000| Untracked +| 253|0x000000008fd00000, 0x000000008fd00000, 0x000000008fe00000| 0%| F| |TAMS 0x000000008fd00000, 0x000000008fd00000| Untracked +| 254|0x000000008fe00000, 0x000000008fe00000, 0x000000008ff00000| 0%| F| |TAMS 0x000000008fe00000, 0x000000008fe00000| Untracked +| 255|0x000000008ff00000, 0x000000008ff00000, 0x0000000090000000| 0%| F| |TAMS 0x000000008ff00000, 0x000000008ff00000| Untracked +| 256|0x0000000090000000, 0x0000000090000000, 0x0000000090100000| 0%| F| |TAMS 0x0000000090000000, 0x0000000090000000| Untracked +| 257|0x0000000090100000, 0x0000000090100000, 0x0000000090200000| 0%| F| |TAMS 0x0000000090100000, 0x0000000090100000| Untracked +| 258|0x0000000090200000, 0x0000000090200000, 0x0000000090300000| 0%| F| |TAMS 0x0000000090200000, 0x0000000090200000| Untracked +| 259|0x0000000090300000, 0x0000000090300000, 0x0000000090400000| 0%| F| |TAMS 0x0000000090300000, 0x0000000090300000| Untracked +| 260|0x0000000090400000, 0x0000000090400000, 0x0000000090500000| 0%| F| |TAMS 0x0000000090400000, 0x0000000090400000| Untracked +| 261|0x0000000090500000, 0x0000000090500000, 0x0000000090600000| 0%| F| |TAMS 0x0000000090500000, 0x0000000090500000| Untracked +| 262|0x0000000090600000, 0x0000000090600000, 0x0000000090700000| 0%| F| |TAMS 0x0000000090600000, 0x0000000090600000| Untracked +| 263|0x0000000090700000, 0x0000000090700000, 0x0000000090800000| 0%| F| |TAMS 0x0000000090700000, 0x0000000090700000| Untracked +| 264|0x0000000090800000, 0x0000000090800000, 0x0000000090900000| 0%| F| |TAMS 0x0000000090800000, 0x0000000090800000| Untracked +| 265|0x0000000090900000, 0x0000000090900000, 0x0000000090a00000| 0%| F| |TAMS 0x0000000090900000, 0x0000000090900000| Untracked +| 266|0x0000000090a00000, 0x0000000090a00000, 0x0000000090b00000| 0%| F| |TAMS 0x0000000090a00000, 0x0000000090a00000| Untracked +| 267|0x0000000090b00000, 0x0000000090b00000, 0x0000000090c00000| 0%| F| |TAMS 0x0000000090b00000, 0x0000000090b00000| Untracked +| 268|0x0000000090c00000, 0x0000000090c00000, 0x0000000090d00000| 0%| F| |TAMS 0x0000000090c00000, 0x0000000090c00000| Untracked +| 269|0x0000000090d00000, 0x0000000090d00000, 0x0000000090e00000| 0%| F| |TAMS 0x0000000090d00000, 0x0000000090d00000| Untracked +| 270|0x0000000090e00000, 0x0000000090e00000, 0x0000000090f00000| 0%| F| |TAMS 0x0000000090e00000, 0x0000000090e00000| Untracked +| 271|0x0000000090f00000, 0x0000000090fb8a30, 0x0000000091000000| 72%| S|CS|TAMS 0x0000000090f00000, 0x0000000090f00000| Complete +| 272|0x0000000091000000, 0x0000000091000000, 0x0000000091100000| 0%| F| |TAMS 0x0000000091000000, 0x0000000091000000| Untracked +| 273|0x0000000091100000, 0x0000000091100000, 0x0000000091200000| 0%| F| |TAMS 0x0000000091100000, 0x0000000091100000| Untracked +| 274|0x0000000091200000, 0x0000000091200000, 0x0000000091300000| 0%| F| |TAMS 0x0000000091200000, 0x0000000091200000| Untracked +| 275|0x0000000091300000, 0x0000000091300000, 0x0000000091400000| 0%| F| |TAMS 0x0000000091300000, 0x0000000091300000| Untracked +| 276|0x0000000091400000, 0x0000000091400000, 0x0000000091500000| 0%| F| |TAMS 0x0000000091400000, 0x0000000091400000| Untracked +| 277|0x0000000091500000, 0x0000000091500000, 0x0000000091600000| 0%| F| |TAMS 0x0000000091500000, 0x0000000091500000| Untracked + +Card table byte_map: [0x000002252a680000,0x000002252aa80000] _byte_map_base: 0x000002252a280000 + +Marking Bits (Prev, Next): (CMBitMap*) 0x0000022517b9ab60, (CMBitMap*) 0x0000022517b9ab28 + Prev Bits: [0x000002252ce80000, 0x000002252ee80000) + Next Bits: [0x000002252ae80000, 0x000002252ce80000) + +Polling page: 0x0000022515b10000 + +Metaspace: + +Usage: + Non-class: 80.88 MB capacity, 79.13 MB ( 98%) used, 1.46 MB ( 2%) free+waste, 302.69 KB ( <1%) overhead. + Class: 13.36 MB capacity, 12.30 MB ( 92%) used, 941.90 KB ( 7%) free+waste, 145.25 KB ( 1%) overhead. + Both: 94.24 MB capacity, 91.42 MB ( 97%) used, 2.38 MB ( 3%) free+waste, 447.94 KB ( <1%) overhead. + +Virtual space: + Non-class space: 90.00 MB reserved, 80.92 MB ( 90%) committed + Class space: 1.00 GB reserved, 13.38 MB ( 1%) committed + Both: 1.09 GB reserved, 94.30 MB ( 8%) committed + +Chunk freelists: + Non-Class: 42.00 KB + Class: 18.00 KB + Both: 60.00 KB + +MaxMetaspaceSize: 17179869184.00 GB +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 20.80 MB +Current GC threshold: 146.24 MB +CDS: off + +CodeHeap 'non-profiled nmethods': size=120064Kb used=5951Kb max_used=5951Kb free=114112Kb + bounds [0x0000022523140000, 0x0000022523710000, 0x000002252a680000] +CodeHeap 'profiled nmethods': size=120000Kb used=21698Kb max_used=21698Kb free=98301Kb + bounds [0x000002251bc10000, 0x000002251d150000, 0x0000022523140000] +CodeHeap 'non-nmethods': size=5696Kb used=2390Kb max_used=2412Kb free=3305Kb + bounds [0x000002251b680000, 0x000002251b8f0000, 0x000002251bc10000] + total_blobs=10637 nmethods=9720 adapters=829 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 79.992 Thread 0x0000022531a68800 nmethod 9783 0x000002251d13ca10 code [0x000002251d13cda0, 0x000002251d13ee58] +Event: 80.099 Thread 0x0000022531a66800 nmethod 9770 0x0000022523707d10 code [0x0000022523707f60, 0x000002252370a340] +Event: 80.100 Thread 0x0000022531a66800 9771 4 java.lang.StringUTF16::compress (50 bytes) +Event: 80.106 Thread 0x0000022531a66800 nmethod 9771 0x000002252370b210 code [0x000002252370b3a0, 0x000002252370b698] +Event: 80.107 Thread 0x0000022531a66800 9776 % 4 sun.nio.cs.UTF_8$Decoder::decodeArrayLoop @ 106 (691 bytes) +Event: 80.149 Thread 0x0000022531a68800 9784 2 sun.net.util.URLUtil::urlNoFragString (114 bytes) +Event: 80.150 Thread 0x0000022531a66800 nmethod 9776% 0x000002252370b790 code [0x000002252370b9e0, 0x000002252370c7b8] +Event: 80.151 Thread 0x0000022531a66800 9774 4 java.lang.String::startsWith (138 bytes) +Event: 80.151 Thread 0x0000022531a68800 nmethod 9784 0x000002251d13f890 code [0x000002251d13fb00, 0x000002251d140058] +Event: 80.151 Thread 0x0000022531a68800 9785 2 java.net.URL::getDefaultPort (8 bytes) +Event: 80.152 Thread 0x0000022531a68800 nmethod 9785 0x000002251d140390 code [0x000002251d140540, 0x000002251d140668] +Event: 80.157 Thread 0x0000022531a66800 nmethod 9774 0x000002252370d590 code [0x000002252370d720, 0x000002252370d918] +Event: 80.158 Thread 0x0000022531a66800 9773 4 java.lang.String::startsWith (7 bytes) +Event: 80.164 Thread 0x0000022531a66800 nmethod 9773 0x000002252370da90 code [0x000002252370dc20, 0x000002252370ddf8] +Event: 80.191 Thread 0x0000022531a66800 9786 4 java.lang.ClassLoader::preDefineClass (116 bytes) +Event: 80.241 Thread 0x0000022531a66800 nmethod 9786 0x000002252370df90 code [0x000002252370e1a0, 0x000002252370efc8] +Event: 80.242 Thread 0x0000022531a66800 9787 4 java.lang.String::hashCode (49 bytes) +Event: 80.250 Thread 0x0000022531a66800 nmethod 9787 0x000002252370f890 code [0x000002252370fa20, 0x000002252370fc78] +Event: 80.281 Thread 0x0000022531a68800 9788 3 org.slf4j.impl.StaticLoggerBinder::getSingleton (4 bytes) +Event: 80.281 Thread 0x0000022531a68800 nmethod 9788 0x000002251d140710 code [0x000002251d1408c0, 0x000002251d1409b8] + +GC Heap History (20 events): +Event: 40.469 GC heap before +{Heap before GC invocations=56 (full 0): + garbage-first heap total 176128K, used 133402K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 55 young (56320K), 4 survivors (4096K) + Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K + class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K +} +Event: 40.493 GC heap after +{Heap after GC invocations=57 (full 0): + garbage-first heap total 176128K, used 85256K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K + class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K +} +Event: 43.393 GC heap before +{Heap before GC invocations=57 (full 0): + garbage-first heap total 176128K, used 142600K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 63 young (64512K), 7 survivors (7168K) + Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K + class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K +} +Event: 43.441 GC heap after +{Heap after GC invocations=58 (full 0): + garbage-first heap total 176128K, used 87003K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 6 young (6144K), 6 survivors (6144K) + Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K + class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K +} +Event: 45.839 GC heap before +{Heap before GC invocations=58 (full 0): + garbage-first heap total 176128K, used 144347K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 63 young (64512K), 6 survivors (6144K) + Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K + class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K +} +Event: 45.877 GC heap after +{Heap after GC invocations=59 (full 0): + garbage-first heap total 176128K, used 89690K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 5 young (5120K), 5 survivors (5120K) + Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K + class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K +} +Event: 48.274 GC heap before +{Heap before GC invocations=60 (full 0): + garbage-first heap total 176128K, used 153178K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 61 young (62464K), 5 survivors (5120K) + Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K + class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K +} +Event: 48.337 GC heap after +{Heap after GC invocations=61 (full 0): + garbage-first heap total 211968K, used 99725K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K + class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K +} +Event: 52.007 GC heap before +{Heap before GC invocations=61 (full 0): + garbage-first heap total 211968K, used 167309K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 73 young (74752K), 7 survivors (7168K) + Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K + class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K +} +Event: 52.081 GC heap after +{Heap after GC invocations=62 (full 0): + garbage-first heap total 211968K, used 102211K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 6 young (6144K), 6 survivors (6144K) + Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K + class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K +} +Event: 63.878 GC heap before +{Heap before GC invocations=62 (full 0): + garbage-first heap total 211968K, used 175939K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 79 young (80896K), 6 survivors (6144K) + Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K + class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K +} +Event: 64.071 GC heap after +{Heap after GC invocations=63 (full 0): + garbage-first heap total 211968K, used 106847K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K + class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K +} +Event: 72.632 GC heap before +{Heap before GC invocations=64 (full 0): + garbage-first heap total 211968K, used 177503K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 76 young (77824K), 7 survivors (7168K) + Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K + class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K +} +Event: 72.787 GC heap after +{Heap after GC invocations=65 (full 0): + garbage-first heap total 211968K, used 109366K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K + class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K +} +Event: 73.860 GC heap before +{Heap before GC invocations=65 (full 0): + garbage-first heap total 211968K, used 119606K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 18 young (18432K), 7 survivors (7168K) + Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K + class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K +} +Event: 73.917 GC heap after +{Heap after GC invocations=66 (full 0): + garbage-first heap total 284672K, used 110080K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 4 young (4096K), 4 survivors (4096K) + Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K + class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K +} +Event: 80.027 GC heap before +{Heap before GC invocations=67 (full 0): + garbage-first heap total 284672K, used 179712K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 55 young (56320K), 4 survivors (4096K) + Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K + class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K +} +Event: 80.095 GC heap after +{Heap after GC invocations=68 (full 0): + garbage-first heap total 284672K, used 136936K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K + class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K +} +Event: 80.287 GC heap before +{Heap before GC invocations=68 (full 0): + garbage-first heap total 284672K, used 142056K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 13 young (13312K), 7 survivors (7168K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +} +Event: 80.394 GC heap after +{Heap after GC invocations=69 (full 0): + garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 1 young (1024K), 1 survivors (1024K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +} + +Deoptimization events (20 events): +Event: 79.976 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.976 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.977 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.977 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x0000022523146710 relative=0x0000000000000170 +Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000022523146710 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 79.981 Thread 0x00000225324c0800 DEOPT PACKING pc=0x0000022523146710 sp=0x0000008c56ffca00 +Event: 79.981 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc928 mode 2 +Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225236c90cc relative=0x00000000000013cc +Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225236c90cc method=java.util.concurrent.ConcurrentHashMap.putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object; @ 401 c2 +Event: 79.984 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225236c90cc sp=0x0000008c56ffca30 +Event: 79.984 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc9c0 mode 2 +Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225232060cc relative=0x000000000000124c +Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225232060cc method=java.util.concurrent.ConcurrentHashMap.transfer([Ljava/util/concurrent/ConcurrentHashMap$Node;[Ljava/util/concurrent/ConcurrentHashMap$Node;)V @ 352 c2 +Event: 79.993 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225232060cc sp=0x0000008c56ffc810 +Event: 79.993 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc788 mode 2 + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 77.831 Thread 0x000002253253b800 Exception (0x000000008ff476c8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.835 Thread 0x000002253253b800 Exception (0x000000008ff6ac98) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.836 Thread 0x000002253253b800 Exception (0x000000008ff83d68) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.837 Thread 0x000002253253b800 Exception (0x000000008ff9bd00) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.839 Thread 0x000002253253b800 Exception (0x000000008ffb3428) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.841 Thread 0x000002253253b800 Exception (0x000000008ffcb900) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.842 Thread 0x000002253253b800 Exception (0x000000008ffe3350) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.844 Thread 0x000002253253b800 Exception (0x000000008ffedb28) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.845 Thread 0x000002253253b800 Exception (0x000000008fff83a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.848 Thread 0x000002253253b800 Exception (0x000000008fe19198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.851 Thread 0x000002253253b800 Exception (0x000000008fe4e380) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.856 Thread 0x000002253253b800 Exception (0x000000008fe8b638) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.860 Thread 0x000002253253b800 Exception (0x000000008feb77a0) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.863 Thread 0x000002253253b800 Exception (0x000000008fee37a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.866 Thread 0x000002253253b800 Exception (0x000000008fd12198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.871 Thread 0x000002253253b800 Exception (0x000000008fd44978) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.901 Thread 0x000002253253b800 Exception (0x000000008fdf3650) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.903 Thread 0x000002253253b800 Exception (0x000000008fc06b90) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 78.412 Thread 0x00000225324c0800 Implicit null exception at 0x00000225234c7165 to 0x00000225234c79dc +Event: 78.846 Thread 0x00000225324c0800 Exception (0x000000008f2f9b78) thrown at [./src/hotspot/share/prims/jni.cpp, line 616] + +Events (20 events): +Event: 80.272 loading class org/apache/http/impl/execchain/RedirectExec done +Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore +Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore done +Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator +Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator done +Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 +Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 done +Event: 80.277 loading class org/apache/http/client/ClientProtocolException +Event: 80.277 loading class org/apache/http/client/ClientProtocolException done +Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager +Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager done +Event: 80.281 loading class org/apache/http/client/utils/URIUtils +Event: 80.281 loading class org/apache/http/client/utils/URIUtils done +Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag +Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag done +Event: 80.285 loading class org/apache/http/HttpHost +Event: 80.285 loading class org/apache/http/HttpHost done +Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper +Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper done +Event: 80.287 Executing VM operation: CollectForMetadataAllocation + + +Dynamic libraries: +0x00007ff668680000 - 0x00007ff66868a000 C:\Program Files\Android\Android Studio1\jre\bin\java.exe +0x00007ffb8e7d0000 - 0x00007ffb8e9c8000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffb8e630000 - 0x00007ffb8e6ef000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffb8bfb0000 - 0x00007ffb8c2a6000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffb8c2b0000 - 0x00007ffb8c3b0000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffb5be60000 - 0x00007ffb5be79000 C:\Program Files\Android\Android Studio1\jre\bin\jli.dll +0x00007ffb5be40000 - 0x00007ffb5be57000 C:\Program Files\Android\Android Studio1\jre\bin\VCRUNTIME140.dll +0x00007ffb8d450000 - 0x00007ffb8d5ed000 C:\WINDOWS\System32\USER32.dll +0x00007ffb8c540000 - 0x00007ffb8c562000 C:\WINDOWS\System32\win32u.dll +0x00007ffb8db60000 - 0x00007ffb8db8c000 C:\WINDOWS\System32\GDI32.dll +0x00007ffb8c710000 - 0x00007ffb8c825000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffb8c670000 - 0x00007ffb8c70d000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffb7c7e0000 - 0x00007ffb7ca7a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll +0x00007ffb8dac0000 - 0x00007ffb8db5e000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffb8ccd0000 - 0x00007ffb8cd00000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffb3f2a0000 - 0x00007ffb3f33d000 C:\Program Files\Android\Android Studio1\jre\bin\msvcp140.dll +0x00007ffb23b50000 - 0x00007ffb24652000 C:\Program Files\Android\Android Studio1\jre\bin\server\jvm.dll +0x00007ffb8ca80000 - 0x00007ffb8cb2f000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffb8e6f0000 - 0x00007ffb8e78c000 C:\WINDOWS\System32\sechost.dll +0x00007ffb8c830000 - 0x00007ffb8c956000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffb8ca70000 - 0x00007ffb8ca78000 C:\WINDOWS\System32\PSAPI.DLL +0x00007ffb85130000 - 0x00007ffb85139000 C:\WINDOWS\SYSTEM32\WSOCK32.dll +0x00007ffb8df00000 - 0x00007ffb8df6b000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffb816a0000 - 0x00007ffb816aa000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffb816b0000 - 0x00007ffb816d7000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffb8a6f0000 - 0x00007ffb8a702000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffb84710000 - 0x00007ffb84721000 C:\Program Files\Android\Android Studio1\jre\bin\verify.dll +0x00007ffb8a4e0000 - 0x00007ffb8a6c4000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffb76690000 - 0x00007ffb766c4000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffb8c5e0000 - 0x00007ffb8c662000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffb7c210000 - 0x00007ffb7c239000 C:\Program Files\Android\Android Studio1\jre\bin\java.dll +0x00007ffb84330000 - 0x00007ffb8433b000 C:\Program Files\Android\Android Studio1\jre\bin\jimage.dll +0x00007ffb72a00000 - 0x00007ffb72a18000 C:\Program Files\Android\Android Studio1\jre\bin\zip.dll +0x00007ffb8cd00000 - 0x00007ffb8d444000 C:\WINDOWS\System32\SHELL32.dll +0x00007ffb89c00000 - 0x00007ffb8a393000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x00007ffb8e120000 - 0x00007ffb8e474000 C:\WINDOWS\System32\combase.dll +0x00007ffb8b890000 - 0x00007ffb8b8be000 C:\WINDOWS\SYSTEM32\Wldp.dll +0x00007ffb8c960000 - 0x00007ffb8ca0d000 C:\WINDOWS\System32\SHCORE.dll +0x00007ffb8cb30000 - 0x00007ffb8cb85000 C:\WINDOWS\System32\shlwapi.dll +0x00007ffb8bdf0000 - 0x00007ffb8be0f000 C:\WINDOWS\SYSTEM32\profapi.dll +0x00007ffb729e0000 - 0x00007ffb729fa000 C:\Program Files\Android\Android Studio1\jre\bin\net.dll +0x00007ffb7d4d0000 - 0x00007ffb7d5da000 C:\WINDOWS\SYSTEM32\WINHTTP.dll +0x00007ffb8b580000 - 0x00007ffb8b5ea000 C:\WINDOWS\system32\mswsock.dll +0x00007ffb729c0000 - 0x00007ffb729d4000 C:\Program Files\Android\Android Studio1\jre\bin\nio.dll +0x00007ffb64870000 - 0x00007ffb64897000 C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64\native-platform.dll +0x00007ffb3f150000 - 0x00007ffb3f294000 C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64\native-platform-file-events.dll +0x00007ffb7f180000 - 0x00007ffb7f18a000 C:\Program Files\Android\Android Studio1\jre\bin\management.dll +0x00007ffb7c200000 - 0x00007ffb7c20d000 C:\Program Files\Android\Android Studio1\jre\bin\management_ext.dll +0x00007ffb8b780000 - 0x00007ffb8b798000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll +0x00007ffb8aea0000 - 0x00007ffb8aed4000 C:\WINDOWS\system32\rsaenh.dll +0x00007ffb8c510000 - 0x00007ffb8c537000 C:\WINDOWS\System32\bcrypt.dll +0x00007ffb8bd70000 - 0x00007ffb8bd9e000 C:\WINDOWS\SYSTEM32\USERENV.dll +0x00007ffb8b770000 - 0x00007ffb8b77c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll +0x00007ffb8b270000 - 0x00007ffb8b2ac000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL +0x00007ffb8e5a0000 - 0x00007ffb8e5a8000 C:\WINDOWS\System32\NSI.dll +0x00007ffb7dfb0000 - 0x00007ffb7dfc7000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL +0x00007ffb7e4f0000 - 0x00007ffb7e50d000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL +0x00007ffb8b2b0000 - 0x00007ffb8b37a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll +0x00007ffb72570000 - 0x00007ffb72587000 C:\WINDOWS\system32\napinsp.dll +0x00007ffb72550000 - 0x00007ffb7256b000 C:\WINDOWS\system32\pnrpnsp.dll +0x00007ffb863a0000 - 0x00007ffb863b5000 C:\WINDOWS\system32\wshbth.dll +0x00007ffb874f0000 - 0x00007ffb8750d000 C:\WINDOWS\system32\NLAapi.dll +0x00007ffb72530000 - 0x00007ffb72542000 C:\WINDOWS\System32\winrnr.dll +0x00007ffb828b0000 - 0x00007ffb828ba000 C:\Windows\System32\rasadhlp.dll +0x00007ffb7b200000 - 0x00007ffb7b282000 C:\WINDOWS\System32\fwpuclnt.dll +0x00007ffb7f1a0000 - 0x00007ffb7f1c7000 C:\Program Files\Android\Android Studio1\jre\bin\sunec.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio1\jre\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Android\Android Studio1\jre\bin\server;C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64;C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64 + +VM Arguments: +jvm_args: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant +java_command: org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 +java_class_path (initial): C:\Users\USER\.gradle\wrapper\dists\gradle-8.0.2-bin\25jlreiuz6u3xu2phlpa2vv4m\gradle-8.0.2\lib\gradle-launcher-8.0.2.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 2 {product} {ergonomic} + uint ConcGCThreads = 1 {product} {ergonomic} + uint G1ConcRefinementThreads = 2 {product} {ergonomic} + size_t G1HeapRegionSize = 1048576 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 58720256 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 2147483648 {product} {command line} + size_t MaxNewSize = 1287651328 {product} {ergonomic} + size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5825164 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + bool UseCompressedClassPointers = true {lp64_product} {ergonomic} + bool UseCompressedOops = true {lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\USER\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3\bin;;C:\Users\USER\Programming\Maven\apache-maven-3.6.3\bin;C:\Users\USER\.dotnet\tools;C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USER\Programming\effective_android\flutter\bin; +USERNAME=USER +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD + + + +--------------- S Y S T E M --------------- + +OS: Windows 10 , 64 bit Build 19041 (10.0.19041.3031) +OS uptime: 6 days 20:35 hours + +CPU:total 2 (initial active 2) (2 cores per cpu, 1 threads per core) family 21 model 112 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1, bmi2, fma + +Memory: 4k page, system-wide physical 3471M (45M free) +TotalPageFile size 14223M (AvailPageFile size 4M) +current process WorkingSet (physical memory assigned to process): 250M, peak: 323M +current process commit charge ("private bytes"): 537M, peak: 538M + +vm_info: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866) for windows-amd64 JRE (11.0.13+0-b1751.21-8125866), built on Feb 2 2022 03:00:22 by "builder" with MS VC++ 14.0 (VS2015) + +END. diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index f3da50b5..1815ff28 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -18,6 +18,7 @@ kotlin { } } + sourceSets { val commonMain by getting { dependencies { @@ -28,7 +29,18 @@ kotlin { // Decompose implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + + //Koin + api(Dependencies.Koin.core) + } + } + + val androidMain by getting { + dependencies { + //Koin + api(Dependencies.Koin.android) } } } + } diff --git a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt b/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt new file mode 100644 index 00000000..f0fca77e --- /dev/null +++ b/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt @@ -0,0 +1,7 @@ +package tablet.di + +import org.koin.core.context.startKoin + +fun initSelectRoomKoin() = startKoin { + modules(selectRoomModule) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt new file mode 100644 index 00000000..32efc178 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt @@ -0,0 +1,9 @@ +package tablet.di + +import org.koin.dsl.module +import tablet.domain.ISelectRoomInteractor +import tablet.domain.SelectRoomInteractorImpl + +val selectRoomModule = module{ + single { SelectRoomInteractorImpl(get()) } +} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt new file mode 100644 index 00000000..22d5433d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt @@ -0,0 +1,8 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo + +interface ISelectRoomInteractor { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt new file mode 100644 index 00000000..e7b69120 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt @@ -0,0 +1,9 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import tablet.network.ISelectRoomRepository + +class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): ISelectRoomInteractor { + override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt new file mode 100644 index 00000000..3a81e0df --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt @@ -0,0 +1,6 @@ +package tablet.domain.model + +data class Booking( + val nameRoom: String, + val eventInfo: EventInfo +) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..c1c4627d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt @@ -0,0 +1,9 @@ +package tablet.domain.model + +import java.util.Calendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt new file mode 100644 index 00000000..eb2dea3a --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt @@ -0,0 +1,8 @@ +package tablet.network + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo + +interface ISelectRoomRepository { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt new file mode 100644 index 00000000..1de4be7e --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen + +import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject +import tablet.domain.ISelectRoomInteractor +import tablet.domain.model.Booking + +class RealSelectRoomComponent(componentContext: ComponentContext, + booking: Booking) + : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ + private val interactor: ISelectRoomInteractor by inject() + val booking = booking + + private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) + override val state = _state.asStateFlow() + + + override fun bookRoom() { + TODO("Not yet implemented") + } + + override fun close() { + TODO("Not yet implemented") + } + +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index 1e221134..cdfdf472 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,7 +1,11 @@ package tablet.ui.selectRoomScreen -import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.StateFlow +import tablet.domain.model.Booking -class SelectRoomComponent(componentContext: ComponentContext) : ComponentContext by componentContext { +interface SelectRoomComponent { + val state: StateFlow + fun bookRoom() + fun close() } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index b485b41a..2daab3df 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -2,13 +2,34 @@ package tablet.ui.selectRoomScreen import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue @Composable -fun SelectRoomScreen(component: SelectRoomComponent){ - SelectRoomView() +fun SelectRoomScreen(component: RealSelectRoomComponent){ + val state by component.state.collectAsState() + + when{ + state.isData -> { + SelectRoomView(component) + } + + state.isLoad -> { + /* (Margarita Djinjolia) + not in design */ + } + + state.isError -> { + /* (Margarita Djinjolia) + not in design */ + } + } + } @Composable -fun SelectRoomView(){ - Text(text = "SelectRoomView") +fun SelectRoomView( + component: RealSelectRoomComponent +){ + Text(text = component.booking.nameRoom) } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt new file mode 100644 index 00000000..a0dc436d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt @@ -0,0 +1,18 @@ +package tablet.ui.selectRoomScreen + +data class SelectRoomScreenState( + val isLoad: Boolean, + val isData: Boolean, + val isError: Boolean, + val error: String +){ + companion object { + val defaultState = + SelectRoomScreenState( + isLoad = false, + isData = true, + isError = false, + error = "" + ) + } +} diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index 136b30e4..f8ff151a 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -4,11 +4,13 @@ import android.os.Bundle import androidx.appcompat.app.AppCompatActivity import androidx.activity.compose.setContent import com.arkivanov.decompose.defaultComponentContext +import tablet.di.initSelectRoomKoin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { + initSelectRoomKoin() App(defaultComponentContext()) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 03a885d1..0be3fc5d 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -7,7 +7,10 @@ import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.ui.selectRoomScreen.SelectRoomComponent +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import tablet.ui.selectRoomScreen.RealSelectRoomComponent +import java.util.Calendar class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -35,12 +38,25 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co } is Config.SelectRoom -> { - Child.SelectRoomChild(SelectRoomComponent(componentContext)) + Child.SelectRoomChild( + RealSelectRoomComponent( + componentContext, + Booking + ("Sirius", + EventInfo + ( + Calendar.getInstance(), + Calendar.getInstance(), + "Ольга Белозёрова" + ) + ) + ) + ) } } sealed class Child { - data class SelectRoomChild(val component: SelectRoomComponent) : Child() + data class SelectRoomChild(val component: RealSelectRoomComponent) : Child() data class MainChild(val component: MainComponent) : Child() } -- GitLab From 0f5449be1f44486c977af4c217e8b96f3f0e9143 Mon Sep 17 00:00:00 2001 From: Margarita Date: Thu, 6 Jul 2023 10:51:30 +0600 Subject: [PATCH 26/63] [-] delete log file --- buildSrc/hs_err_pid49948.log | 851 ----------------------------------- 1 file changed, 851 deletions(-) delete mode 100644 buildSrc/hs_err_pid49948.log diff --git a/buildSrc/hs_err_pid49948.log b/buildSrc/hs_err_pid49948.log deleted file mode 100644 index c6cc489d..00000000 --- a/buildSrc/hs_err_pid49948.log +++ /dev/null @@ -1,851 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Unscaled Compressed Oops mode in which the Java heap is -# placed in the first 4GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 4GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (./src/hotspot/share/memory/allocation.cpp:46), pid=49948, tid=54616 -# -# JRE version: OpenJDK Runtime Environment (11.0.13) (build 11.0.13+0-b1751.21-8125866) -# Java VM: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 - -Host: AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G , 2 cores, 3G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031) -Time: Mon Jul 3 17:11:04 2023 elapsed time: 80.431619 seconds (0d 0h 1m 20s) - ---------------- T H R E A D --------------- - -Current thread (0x00000225319f6800): VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] - -Stack: [0x0000008c53200000,0x0000008c53300000] -[error occurred during error reporting (printing stack bounds), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002251b68112d] - -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6100fa] -V [jvm.dll+0x747090] -V [jvm.dll+0x7486ad] -V [jvm.dll+0x748ce5] -V [jvm.dll+0x748c9b] -V [jvm.dll+0x60f224] -V [jvm.dll+0x60f9b8] -C [ntdll.dll+0xa247f] -C [ntdll.dll+0x514f4] -C [ntdll.dll+0xa0f8e] -C 0x000002251b68112d - -VM_Operation (0x0000008c56ff9770): CollectForMetadataAllocation, mode: safepoint, requested by thread 0x00000225324c0800 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000022536238790, length=61, elements={ -0x0000022517b60800, 0x00000225319fa000, 0x0000022531a03800, 0x0000022531a19000, -0x0000022531a1c000, 0x0000022531a1d800, 0x0000022531a66800, 0x0000022531a68800, -0x0000022531a7c800, 0x0000022531cee800, 0x0000022532734000, 0x0000022532576800, -0x000002253351e800, 0x0000022531f56000, 0x000002253302a800, 0x000002253302b800, -0x000002253253b800, 0x00000225324ce000, 0x0000022531ecd000, 0x0000022531ea4800, -0x0000022531e9f000, 0x0000022531ea5800, 0x0000022531ea2000, 0x0000022531ea0800, -0x0000022531ea3000, 0x0000022531ea4000, 0x0000022531ea0000, 0x0000022531ea1800, -0x0000022533cce800, 0x0000022533ccb000, 0x0000022533ccf000, 0x0000022533cd0000, -0x0000022533cca800, 0x0000022533ccd000, 0x0000022533cd1000, 0x0000022533cd1800, -0x0000022533ccc000, 0x0000022533cd7800, 0x0000022533cd3800, 0x0000022533cd2800, -0x0000022533cd4000, 0x0000022533cd8000, 0x0000022533cd9000, 0x0000022533cd5000, -0x0000022533cd6000, 0x0000022533cd6800, 0x00000225324c2000, 0x00000225324c1800, -0x00000225324be000, 0x00000225324c3000, 0x00000225324c4000, 0x00000225324c4800, -0x00000225324bf000, 0x00000225324c5800, 0x00000225324bf800, 0x00000225324c6800, -0x00000225324c0800, 0x00000225324cb000, 0x00000225324cd000, 0x00000225324cc000, -0x00000225324c8000 -} - -Java Threads: ( => current thread ) - 0x0000022517b60800 JavaThread "main" [_thread_blocked, id=52892, stack(0x0000008c52c00000,0x0000008c52d00000)] - 0x00000225319fa000 JavaThread "Reference Handler" daemon [_thread_blocked, id=52232, stack(0x0000008c53300000,0x0000008c53400000)] - 0x0000022531a03800 JavaThread "Finalizer" daemon [_thread_blocked, id=44012, stack(0x0000008c53400000,0x0000008c53500000)] - 0x0000022531a19000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=53300, stack(0x0000008c53500000,0x0000008c53600000)] - 0x0000022531a1c000 JavaThread "Attach Listener" daemon [_thread_blocked, id=49748, stack(0x0000008c53600000,0x0000008c53700000)] - 0x0000022531a1d800 JavaThread "Service Thread" daemon [_thread_blocked, id=46864, stack(0x0000008c53700000,0x0000008c53800000)] - 0x0000022531a66800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=53760, stack(0x0000008c53800000,0x0000008c53900000)] - 0x0000022531a68800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=54680, stack(0x0000008c53900000,0x0000008c53a00000)] - 0x0000022531a7c800 JavaThread "Sweeper thread" daemon [_thread_blocked, id=46020, stack(0x0000008c53a00000,0x0000008c53b00000)] - 0x0000022531cee800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=55048, stack(0x0000008c53b00000,0x0000008c53c00000)] - 0x0000022532734000 JavaThread "Daemon health stats" [_thread_blocked, id=54880, stack(0x0000008c53e00000,0x0000008c53f00000)] - 0x0000022532576800 JavaThread "Incoming local TCP Connector on port 58623" [_thread_in_native, id=50576, stack(0x0000008c53f00000,0x0000008c54000000)] - 0x000002253351e800 JavaThread "Daemon periodic checks" [_thread_blocked, id=52448, stack(0x0000008c54000000,0x0000008c54100000)] - 0x0000022531f56000 JavaThread "Daemon" [_thread_blocked, id=54848, stack(0x0000008c54100000,0x0000008c54200000)] - 0x000002253302a800 JavaThread "Handler for socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_in_native, id=53764, stack(0x0000008c54200000,0x0000008c54300000)] - 0x000002253302b800 JavaThread "Cancel handler" [_thread_blocked, id=55084, stack(0x0000008c54300000,0x0000008c54400000)] - 0x000002253253b800 JavaThread "Daemon worker" [_thread_blocked, id=15576, stack(0x0000008c54400000,0x0000008c54500000)] - 0x00000225324ce000 JavaThread "Asynchronous log dispatcher for DefaultDaemonConnection: socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_blocked, id=43788, stack(0x0000008c54500000,0x0000008c54600000)] - 0x0000022531ecd000 JavaThread "Daemon client event forwarder" [_thread_blocked, id=54688, stack(0x0000008c54700000,0x0000008c54800000)] - 0x0000022531ea4800 JavaThread "Cache worker for journal cache (C:\Users\USER\.gradle\caches\journal-1)" [_thread_blocked, id=50804, stack(0x0000008c54800000,0x0000008c54900000)] - 0x0000022531e9f000 JavaThread "File lock request listener" [_thread_in_native, id=48844, stack(0x0000008c54900000,0x0000008c54a00000)] - 0x0000022531ea5800 JavaThread "Cache worker for file hash cache (C:\Users\USER\.gradle\caches\8.0.2\fileHashes)" [_thread_blocked, id=48008, stack(0x0000008c54a00000,0x0000008c54b00000)] - 0x0000022531ea2000 JavaThread "File watcher server" daemon [_thread_blocked, id=47932, stack(0x0000008c54b00000,0x0000008c54c00000)] - 0x0000022531ea0800 JavaThread "File watcher consumer" daemon [_thread_blocked, id=40928, stack(0x0000008c54c00000,0x0000008c54d00000)] - 0x0000022531ea3000 JavaThread "jar transforms" [_thread_blocked, id=20244, stack(0x0000008c54d00000,0x0000008c54e00000)] - 0x0000022531ea4000 JavaThread "jar transforms Thread 2" [_thread_blocked, id=54224, stack(0x0000008c54e00000,0x0000008c54f00000)] - 0x0000022531ea0000 JavaThread "Cache worker for checksums cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\checksums)" [_thread_blocked, id=37804, stack(0x0000008c54f00000,0x0000008c55000000)] - 0x0000022531ea1800 JavaThread "Cache worker for cache directory md-rule (C:\Users\USER\.gradle\caches\8.0.2\md-rule)" [_thread_blocked, id=52184, stack(0x0000008c55000000,0x0000008c55100000)] - 0x0000022533cce800 JavaThread "Cache worker for file content cache (C:\Users\USER\.gradle\caches\8.0.2\fileContent)" [_thread_blocked, id=54940, stack(0x0000008c55100000,0x0000008c55200000)] - 0x0000022533ccb000 JavaThread "Cache worker for file hash cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\fileHashes)" [_thread_blocked, id=50424, stack(0x0000008c55200000,0x0000008c55300000)] - 0x0000022533ccf000 JavaThread "Cache worker for cache directory md-supplier (C:\Users\USER\.gradle\caches\8.0.2\md-supplier)" [_thread_blocked, id=30304, stack(0x0000008c55300000,0x0000008c55400000)] - 0x0000022533cd0000 JavaThread "Cache worker for execution history cache (C:\Users\USER\.gradle\caches\8.0.2\executionHistory)" [_thread_blocked, id=54756, stack(0x0000008c55400000,0x0000008c55500000)] - 0x0000022533cca800 JavaThread "Cache worker for dependencies-accessors (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\dependencies-accessors)" [_thread_blocked, id=54948, stack(0x0000008c55700000,0x0000008c55800000)] - 0x0000022533ccd000 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=54772, stack(0x0000008c55800000,0x0000008c55900000)] - 0x0000022533cd1000 JavaThread "Memory manager" [_thread_blocked, id=64, stack(0x0000008c55900000,0x0000008c55a00000)] - 0x0000022533cd1800 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=51880, stack(0x0000008c55a00000,0x0000008c55b00000)] - 0x0000022533ccc000 JavaThread "Cache worker for kotlin-dsl (C:\Users\USER\.gradle\caches\8.0.2\kotlin-dsl)" [_thread_blocked, id=53304, stack(0x0000008c55b00000,0x0000008c55c00000)] - 0x0000022533cd7800 JavaThread "Unconstrained build operations" [_thread_blocked, id=54808, stack(0x0000008c55c00000,0x0000008c55d00000)] - 0x0000022533cd3800 JavaThread "Unconstrained build operations Thread 2" [_thread_blocked, id=54200, stack(0x0000008c55d00000,0x0000008c55e00000)] - 0x0000022533cd2800 JavaThread "Unconstrained build operations Thread 3" [_thread_blocked, id=49596, stack(0x0000008c55e00000,0x0000008c55f00000)] - 0x0000022533cd4000 JavaThread "Unconstrained build operations Thread 4" [_thread_blocked, id=54500, stack(0x0000008c55f00000,0x0000008c56000000)] - 0x0000022533cd8000 JavaThread "Unconstrained build operations Thread 5" [_thread_blocked, id=52376, stack(0x0000008c56000000,0x0000008c56100000)] - 0x0000022533cd9000 JavaThread "Unconstrained build operations Thread 6" [_thread_blocked, id=54288, stack(0x0000008c56100000,0x0000008c56200000)] - 0x0000022533cd5000 JavaThread "Unconstrained build operations Thread 7" [_thread_blocked, id=55148, stack(0x0000008c56200000,0x0000008c56300000)] - 0x0000022533cd6000 JavaThread "Unconstrained build operations Thread 8" [_thread_blocked, id=54676, stack(0x0000008c56300000,0x0000008c56400000)] - 0x0000022533cd6800 JavaThread "Unconstrained build operations Thread 9" [_thread_blocked, id=52780, stack(0x0000008c56400000,0x0000008c56500000)] - 0x00000225324c2000 JavaThread "Unconstrained build operations Thread 10" [_thread_blocked, id=52528, stack(0x0000008c56500000,0x0000008c56600000)] - 0x00000225324c1800 JavaThread "Unconstrained build operations Thread 11" [_thread_blocked, id=54508, stack(0x0000008c56600000,0x0000008c56700000)] - 0x00000225324be000 JavaThread "Unconstrained build operations Thread 12" [_thread_blocked, id=51544, stack(0x0000008c56700000,0x0000008c56800000)] - 0x00000225324c3000 JavaThread "Unconstrained build operations Thread 13" [_thread_blocked, id=52856, stack(0x0000008c56800000,0x0000008c56900000)] - 0x00000225324c4000 JavaThread "Unconstrained build operations Thread 14" [_thread_blocked, id=30784, stack(0x0000008c56900000,0x0000008c56a00000)] - 0x00000225324c4800 JavaThread "Unconstrained build operations Thread 15" [_thread_blocked, id=41272, stack(0x0000008c56a00000,0x0000008c56b00000)] - 0x00000225324bf000 JavaThread "Unconstrained build operations Thread 16" [_thread_blocked, id=52956, stack(0x0000008c56b00000,0x0000008c56c00000)] - 0x00000225324c5800 JavaThread "Unconstrained build operations Thread 17" [_thread_blocked, id=44264, stack(0x0000008c56c00000,0x0000008c56d00000)] - 0x00000225324bf800 JavaThread "Unconstrained build operations Thread 18" [_thread_blocked, id=54308, stack(0x0000008c56d00000,0x0000008c56e00000)] - 0x00000225324c6800 JavaThread "Unconstrained build operations Thread 19" [_thread_blocked, id=51824, stack(0x0000008c56e00000,0x0000008c56f00000)] - 0x00000225324c0800 JavaThread "Unconstrained build operations Thread 20" [_thread_blocked, id=55232, stack(0x0000008c56f00000,0x0000008c57000000)] - 0x00000225324cb000 JavaThread "included builds" [_thread_blocked, id=54504, stack(0x0000008c52a00000,0x0000008c52b00000)] - 0x00000225324cd000 JavaThread "Execution worker" [_thread_blocked, id=51832, stack(0x0000008c52b00000,0x0000008c52c00000)] - 0x00000225324cc000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=47204, stack(0x0000008c57000000,0x0000008c57100000)] - 0x00000225324c8000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=5536, stack(0x0000008c54600000,0x0000008c54700000)] - -Other Threads: -=>0x00000225319f6800 VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] - 0x0000022531d1a800 WatcherThread [stack: 0x0000008c53c00000,0x0000008c53d00000] [id=53860] - 0x0000022517b73000 GCTaskThread "GC Thread#0" [stack: 0x0000008c52d00000,0x0000008c52e00000] [id=46300] - 0x0000022531c15800 GCTaskThread "GC Thread#1" [stack: 0x0000008c53d00000,0x0000008c53e00000] [id=49096] - 0x0000022517ba3800 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008c52e00000,0x0000008c52f00000] [id=50800] - 0x0000022517ba7800 ConcurrentGCThread "G1 Conc#0" [stack: 0x0000008c52f00000,0x0000008c53000000] [id=39368] - 0x0000022517be4800 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008c53000000,0x0000008c53100000] [id=49560] - 0x0000022517be5800 ConcurrentGCThread "G1 Young RemSet Sampling" [stack: 0x0000008c53100000,0x0000008c53200000] [id=55224] - -Threads with active compile tasks: - -VM state:at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x0000022517b5c200] Threads_lock - owner thread: 0x00000225319f6800 -[0x0000022517b5be10] Heap_lock - owner thread: 0x00000225324c0800 - -Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit -Narrow klass base: 0x0000000000000000, Narrow klass shift: 3 -Compressed class space size: 1073741824 Address: 0x0000000100000000 - -Heap: - garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 1 young (1024K), 1 survivors (1024K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1140736K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, A=archive, TAMS=top-at-mark-start (previous, next) -| 0|0x0000000080000000, 0x0000000080100000, 0x0000000080100000|100%| O| |TAMS 0x0000000080100000, 0x0000000080100000| Untracked -| 1|0x0000000080100000, 0x0000000080200000, 0x0000000080200000|100%|HS| |TAMS 0x0000000080200000, 0x0000000080200000| Complete -| 2|0x0000000080200000, 0x0000000080300000, 0x0000000080300000|100%|HC| |TAMS 0x0000000080300000, 0x0000000080300000| Complete -| 3|0x0000000080300000, 0x0000000080400000, 0x0000000080400000|100%|HC| |TAMS 0x0000000080400000, 0x0000000080400000| Complete -| 4|0x0000000080400000, 0x0000000080500000, 0x0000000080500000|100%|HC| |TAMS 0x0000000080500000, 0x0000000080500000| Complete -| 5|0x0000000080500000, 0x0000000080600000, 0x0000000080600000|100%| O| |TAMS 0x0000000080600000, 0x0000000080600000| Untracked -| 6|0x0000000080600000, 0x0000000080700000, 0x0000000080700000|100%| O| |TAMS 0x0000000080700000, 0x0000000080700000| Untracked -| 7|0x0000000080700000, 0x0000000080800000, 0x0000000080800000|100%| O| |TAMS 0x0000000080800000, 0x0000000080800000| Untracked -| 8|0x0000000080800000, 0x0000000080900000, 0x0000000080900000|100%| O| |TAMS 0x0000000080900000, 0x0000000080900000| Untracked -| 9|0x0000000080900000, 0x0000000080a00000, 0x0000000080a00000|100%| O| |TAMS 0x0000000080a00000, 0x0000000080a00000| Untracked -| 10|0x0000000080a00000, 0x0000000080b00000, 0x0000000080b00000|100%| O| |TAMS 0x0000000080b00000, 0x0000000080b00000| Untracked -| 11|0x0000000080b00000, 0x0000000080c00000, 0x0000000080c00000|100%| O| |TAMS 0x0000000080c00000, 0x0000000080c00000| Untracked -| 12|0x0000000080c00000, 0x0000000080d00000, 0x0000000080d00000|100%| O| |TAMS 0x0000000080d00000, 0x0000000080d00000| Untracked -| 13|0x0000000080d00000, 0x0000000080e00000, 0x0000000080e00000|100%| O| |TAMS 0x0000000080e00000, 0x0000000080e00000| Untracked -| 14|0x0000000080e00000, 0x0000000080f00000, 0x0000000080f00000|100%| O| |TAMS 0x0000000080f00000, 0x0000000080f00000| Untracked -| 15|0x0000000080f00000, 0x0000000081000000, 0x0000000081000000|100%| O| |TAMS 0x0000000081000000, 0x0000000081000000| Untracked -| 16|0x0000000081000000, 0x0000000081100000, 0x0000000081100000|100%| O| |TAMS 0x0000000081100000, 0x0000000081100000| Untracked -| 17|0x0000000081100000, 0x0000000081200000, 0x0000000081200000|100%| O| |TAMS 0x0000000081200000, 0x0000000081200000| Untracked -| 18|0x0000000081200000, 0x0000000081300000, 0x0000000081300000|100%|HS| |TAMS 0x0000000081300000, 0x0000000081300000| Complete -| 19|0x0000000081300000, 0x0000000081400000, 0x0000000081400000|100%|HC| |TAMS 0x0000000081400000, 0x0000000081400000| Complete -| 20|0x0000000081400000, 0x0000000081500000, 0x0000000081500000|100%|HS| |TAMS 0x0000000081500000, 0x0000000081500000| Complete -| 21|0x0000000081500000, 0x0000000081600000, 0x0000000081600000|100%|HC| |TAMS 0x0000000081600000, 0x0000000081600000| Complete -| 22|0x0000000081600000, 0x0000000081700000, 0x0000000081700000|100%|HC| |TAMS 0x0000000081700000, 0x0000000081700000| Complete -| 23|0x0000000081700000, 0x0000000081800000, 0x0000000081800000|100%| O| |TAMS 0x0000000081800000, 0x0000000081800000| Untracked -| 24|0x0000000081800000, 0x0000000081900000, 0x0000000081900000|100%|HS| |TAMS 0x0000000081900000, 0x0000000081900000| Complete -| 25|0x0000000081900000, 0x0000000081a00000, 0x0000000081a00000|100%|HC| |TAMS 0x0000000081a00000, 0x0000000081a00000| Complete -| 26|0x0000000081a00000, 0x0000000081b00000, 0x0000000081b00000|100%|HC| |TAMS 0x0000000081b00000, 0x0000000081b00000| Complete -| 27|0x0000000081b00000, 0x0000000081c00000, 0x0000000081c00000|100%| O| |TAMS 0x0000000081c00000, 0x0000000081c00000| Untracked -| 28|0x0000000081c00000, 0x0000000081d00000, 0x0000000081d00000|100%| O| |TAMS 0x0000000081d00000, 0x0000000081d00000| Untracked -| 29|0x0000000081d00000, 0x0000000081e00000, 0x0000000081e00000|100%| O| |TAMS 0x0000000081e00000, 0x0000000081e00000| Untracked -| 30|0x0000000081e00000, 0x0000000081f00000, 0x0000000081f00000|100%| O| |TAMS 0x0000000081f00000, 0x0000000081f00000| Untracked -| 31|0x0000000081f00000, 0x0000000082000000, 0x0000000082000000|100%|HS| |TAMS 0x0000000082000000, 0x0000000082000000| Complete -| 32|0x0000000082000000, 0x0000000082100000, 0x0000000082100000|100%|HC| |TAMS 0x0000000082100000, 0x0000000082100000| Complete -| 33|0x0000000082100000, 0x0000000082200000, 0x0000000082200000|100%|HC| |TAMS 0x0000000082200000, 0x0000000082200000| Complete -| 34|0x0000000082200000, 0x0000000082300000, 0x0000000082300000|100%|HC| |TAMS 0x0000000082300000, 0x0000000082300000| Complete -| 35|0x0000000082300000, 0x0000000082400000, 0x0000000082400000|100%|HS| |TAMS 0x0000000082400000, 0x0000000082400000| Complete -| 36|0x0000000082400000, 0x0000000082500000, 0x0000000082500000|100%|HC| |TAMS 0x0000000082500000, 0x0000000082500000| Complete -| 37|0x0000000082500000, 0x0000000082600000, 0x0000000082600000|100%|HC| |TAMS 0x0000000082600000, 0x0000000082600000| Complete -| 38|0x0000000082600000, 0x0000000082700000, 0x0000000082700000|100%|HC| |TAMS 0x0000000082700000, 0x0000000082700000| Complete -| 39|0x0000000082700000, 0x0000000082800000, 0x0000000082800000|100%|HC| |TAMS 0x0000000082800000, 0x0000000082800000| Complete -| 40|0x0000000082800000, 0x0000000082900000, 0x0000000082900000|100%| O| |TAMS 0x0000000082900000, 0x0000000082900000| Untracked -| 41|0x0000000082900000, 0x0000000082a00000, 0x0000000082a00000|100%| O| |TAMS 0x0000000082a00000, 0x0000000082a00000| Untracked -| 42|0x0000000082a00000, 0x0000000082b00000, 0x0000000082b00000|100%|HS| |TAMS 0x0000000082b00000, 0x0000000082b00000| Complete -| 43|0x0000000082b00000, 0x0000000082c00000, 0x0000000082c00000|100%| O| |TAMS 0x0000000082c00000, 0x0000000082c00000| Untracked -| 44|0x0000000082c00000, 0x0000000082d00000, 0x0000000082d00000|100%| O| |TAMS 0x0000000082d00000, 0x0000000082d00000| Untracked -| 45|0x0000000082d00000, 0x0000000082e00000, 0x0000000082e00000|100%| O| |TAMS 0x0000000082e00000, 0x0000000082e00000| Untracked -| 46|0x0000000082e00000, 0x0000000082f00000, 0x0000000082f00000|100%| O| |TAMS 0x0000000082f00000, 0x0000000082f00000| Untracked -| 47|0x0000000082f00000, 0x0000000083000000, 0x0000000083000000|100%| O| |TAMS 0x0000000083000000, 0x0000000083000000| Untracked -| 48|0x0000000083000000, 0x0000000083100000, 0x0000000083100000|100%| O| |TAMS 0x0000000083100000, 0x0000000083100000| Untracked -| 49|0x0000000083100000, 0x0000000083200000, 0x0000000083200000|100%|HS| |TAMS 0x0000000083200000, 0x0000000083200000| Complete -| 50|0x0000000083200000, 0x0000000083300000, 0x0000000083300000|100%|HC| |TAMS 0x0000000083300000, 0x0000000083300000| Complete -| 51|0x0000000083300000, 0x0000000083400000, 0x0000000083400000|100%|HC| |TAMS 0x0000000083400000, 0x0000000083400000| Complete -| 52|0x0000000083400000, 0x0000000083500000, 0x0000000083500000|100%|HS| |TAMS 0x0000000083500000, 0x0000000083500000| Complete -| 53|0x0000000083500000, 0x0000000083600000, 0x0000000083600000|100%|HC| |TAMS 0x0000000083600000, 0x0000000083600000| Complete -| 54|0x0000000083600000, 0x0000000083700000, 0x0000000083700000|100%| O| |TAMS 0x0000000083700000, 0x0000000083700000| Untracked -| 55|0x0000000083700000, 0x0000000083800000, 0x0000000083800000|100%| O| |TAMS 0x0000000083800000, 0x0000000083800000| Untracked -| 56|0x0000000083800000, 0x0000000083900000, 0x0000000083900000|100%|HS| |TAMS 0x0000000083900000, 0x0000000083900000| Complete -| 57|0x0000000083900000, 0x0000000083a00000, 0x0000000083a00000|100%|HC| |TAMS 0x0000000083a00000, 0x0000000083a00000| Complete -| 58|0x0000000083a00000, 0x0000000083b00000, 0x0000000083b00000|100%|HC| |TAMS 0x0000000083b00000, 0x0000000083b00000| Complete -| 59|0x0000000083b00000, 0x0000000083c00000, 0x0000000083c00000|100%|HS| |TAMS 0x0000000083c00000, 0x0000000083c00000| Complete -| 60|0x0000000083c00000, 0x0000000083d00000, 0x0000000083d00000|100%|HC| |TAMS 0x0000000083d00000, 0x0000000083d00000| Complete -| 61|0x0000000083d00000, 0x0000000083e00000, 0x0000000083e00000|100%|HC| |TAMS 0x0000000083e00000, 0x0000000083e00000| Complete -| 62|0x0000000083e00000, 0x0000000083f00000, 0x0000000083f00000|100%|HC| |TAMS 0x0000000083f00000, 0x0000000083f00000| Complete -| 63|0x0000000083f00000, 0x0000000084000000, 0x0000000084000000|100%| O| |TAMS 0x0000000084000000, 0x0000000084000000| Untracked -| 64|0x0000000084000000, 0x0000000084100000, 0x0000000084100000|100%| O| |TAMS 0x0000000084100000, 0x0000000084100000| Untracked -| 65|0x0000000084100000, 0x0000000084200000, 0x0000000084200000|100%| O| |TAMS 0x0000000084200000, 0x0000000084200000| Untracked -| 66|0x0000000084200000, 0x0000000084300000, 0x0000000084300000|100%| O| |TAMS 0x0000000084300000, 0x0000000084300000| Untracked -| 67|0x0000000084300000, 0x0000000084400000, 0x0000000084400000|100%| O| |TAMS 0x0000000084400000, 0x0000000084400000| Untracked -| 68|0x0000000084400000, 0x0000000084500000, 0x0000000084500000|100%| O| |TAMS 0x0000000084500000, 0x0000000084500000| Untracked -| 69|0x0000000084500000, 0x0000000084600000, 0x0000000084600000|100%| O| |TAMS 0x0000000084600000, 0x0000000084600000| Untracked -| 70|0x0000000084600000, 0x0000000084700000, 0x0000000084700000|100%| O| |TAMS 0x0000000084700000, 0x0000000084700000| Untracked -| 71|0x0000000084700000, 0x0000000084800000, 0x0000000084800000|100%| O| |TAMS 0x0000000084800000, 0x0000000084800000| Untracked -| 72|0x0000000084800000, 0x0000000084900000, 0x0000000084900000|100%|HS| |TAMS 0x0000000084900000, 0x0000000084900000| Complete -| 73|0x0000000084900000, 0x0000000084a00000, 0x0000000084a00000|100%|HC| |TAMS 0x0000000084a00000, 0x0000000084a00000| Complete -| 74|0x0000000084a00000, 0x0000000084b00000, 0x0000000084b00000|100%|HC| |TAMS 0x0000000084b00000, 0x0000000084b00000| Complete -| 75|0x0000000084b00000, 0x0000000084c00000, 0x0000000084c00000|100%|HC| |TAMS 0x0000000084c00000, 0x0000000084c00000| Complete -| 76|0x0000000084c00000, 0x0000000084d00000, 0x0000000084d00000|100%|HC| |TAMS 0x0000000084d00000, 0x0000000084d00000| Complete -| 77|0x0000000084d00000, 0x0000000084e00000, 0x0000000084e00000|100%| O| |TAMS 0x0000000084e00000, 0x0000000084e00000| Untracked -| 78|0x0000000084e00000, 0x0000000084f00000, 0x0000000084f00000|100%| O| |TAMS 0x0000000084f00000, 0x0000000084f00000| Untracked -| 79|0x0000000084f00000, 0x0000000085000000, 0x0000000085000000|100%| O| |TAMS 0x0000000085000000, 0x0000000085000000| Untracked -| 80|0x0000000085000000, 0x0000000085100000, 0x0000000085100000|100%| O| |TAMS 0x0000000085100000, 0x0000000085100000| Untracked -| 81|0x0000000085100000, 0x0000000085200000, 0x0000000085200000|100%| O| |TAMS 0x0000000085200000, 0x0000000085200000| Untracked -| 82|0x0000000085200000, 0x0000000085300000, 0x0000000085300000|100%| O| |TAMS 0x0000000085300000, 0x0000000085300000| Untracked -| 83|0x0000000085300000, 0x0000000085400000, 0x0000000085400000|100%|HS| |TAMS 0x0000000085400000, 0x0000000085400000| Complete -| 84|0x0000000085400000, 0x0000000085500000, 0x0000000085500000|100%|HC| |TAMS 0x0000000085500000, 0x0000000085500000| Complete -| 85|0x0000000085500000, 0x0000000085600000, 0x0000000085600000|100%|HS| |TAMS 0x0000000085600000, 0x0000000085600000| Complete -| 86|0x0000000085600000, 0x0000000085700000, 0x0000000085700000|100%|HC| |TAMS 0x0000000085700000, 0x0000000085700000| Complete -| 87|0x0000000085700000, 0x0000000085800000, 0x0000000085800000|100%|HC| |TAMS 0x0000000085800000, 0x0000000085800000| Complete -| 88|0x0000000085800000, 0x0000000085900000, 0x0000000085900000|100%|HC| |TAMS 0x0000000085900000, 0x0000000085900000| Complete -| 89|0x0000000085900000, 0x0000000085a00000, 0x0000000085a00000|100%| O| |TAMS 0x0000000085a00000, 0x0000000085a00000| Untracked -| 90|0x0000000085a00000, 0x0000000085b00000, 0x0000000085b00000|100%| O| |TAMS 0x0000000085b00000, 0x0000000085b00000| Untracked -| 91|0x0000000085b00000, 0x0000000085c00000, 0x0000000085c00000|100%| O| |TAMS 0x0000000085c00000, 0x0000000085c00000| Untracked -| 92|0x0000000085c00000, 0x0000000085d00000, 0x0000000085d00000|100%| O| |TAMS 0x0000000085d00000, 0x0000000085d00000| Untracked -| 93|0x0000000085d00000, 0x0000000085e00000, 0x0000000085e00000|100%| O| |TAMS 0x0000000085e00000, 0x0000000085e00000| Untracked -| 94|0x0000000085e00000, 0x0000000085f00000, 0x0000000085f00000|100%| O| |TAMS 0x0000000085f00000, 0x0000000085f00000| Untracked -| 95|0x0000000085f00000, 0x0000000086000000, 0x0000000086000000|100%| O| |TAMS 0x0000000086000000, 0x0000000086000000| Untracked -| 96|0x0000000086000000, 0x0000000086100000, 0x0000000086100000|100%| O| |TAMS 0x0000000086100000, 0x0000000086100000| Untracked -| 97|0x0000000086100000, 0x0000000086200000, 0x0000000086200000|100%| O| |TAMS 0x0000000086200000, 0x0000000086200000| Untracked -| 98|0x0000000086200000, 0x0000000086300000, 0x0000000086300000|100%| O| |TAMS 0x0000000086300000, 0x0000000086300000| Untracked -| 99|0x0000000086300000, 0x0000000086400000, 0x0000000086400000|100%| O| |TAMS 0x0000000086400000, 0x0000000086400000| Untracked -| 100|0x0000000086400000, 0x0000000086500000, 0x0000000086500000|100%| O| |TAMS 0x0000000086500000, 0x0000000086500000| Untracked -| 101|0x0000000086500000, 0x0000000086600000, 0x0000000086600000|100%| O| |TAMS 0x0000000086600000, 0x0000000086600000| Untracked -| 102|0x0000000086600000, 0x0000000086700000, 0x0000000086700000|100%| O| |TAMS 0x0000000086700000, 0x0000000086700000| Untracked -| 103|0x0000000086700000, 0x0000000086800000, 0x0000000086800000|100%| O| |TAMS 0x0000000086800000, 0x0000000086800000| Untracked -| 104|0x0000000086800000, 0x0000000086900000, 0x0000000086900000|100%|HS| |TAMS 0x0000000086800000, 0x0000000086900000| Complete -| 105|0x0000000086900000, 0x0000000086a00000, 0x0000000086a00000|100%|HC| |TAMS 0x0000000086900000, 0x0000000086a00000| Complete -| 106|0x0000000086a00000, 0x0000000086b00000, 0x0000000086b00000|100%|HS| |TAMS 0x0000000086a00000, 0x0000000086b00000| Complete -| 107|0x0000000086b00000, 0x0000000086c00000, 0x0000000086c00000|100%|HC| |TAMS 0x0000000086b00000, 0x0000000086c00000| Complete -| 108|0x0000000086c00000, 0x0000000086d00000, 0x0000000086d00000|100%|HC| |TAMS 0x0000000086c00000, 0x0000000086d00000| Complete -| 109|0x0000000086d00000, 0x0000000086e00000, 0x0000000086e00000|100%|HS| |TAMS 0x0000000086d00000, 0x0000000086e00000| Complete -| 110|0x0000000086e00000, 0x0000000086f00000, 0x0000000086f00000|100%|HC| |TAMS 0x0000000086e00000, 0x0000000086f00000| Complete -| 111|0x0000000086f00000, 0x0000000087000000, 0x0000000087000000|100%|HC| |TAMS 0x0000000086f00000, 0x0000000087000000| Complete -| 112|0x0000000087000000, 0x0000000087100000, 0x0000000087100000|100%|HS| |TAMS 0x0000000087000000, 0x0000000087100000| Complete -| 113|0x0000000087100000, 0x0000000087200000, 0x0000000087200000|100%|HC| |TAMS 0x0000000087100000, 0x0000000087200000| Complete -| 114|0x0000000087200000, 0x0000000087300000, 0x0000000087300000|100%|HC| |TAMS 0x0000000087200000, 0x0000000087300000| Complete -| 115|0x0000000087300000, 0x0000000087400000, 0x0000000087400000|100%|HC| |TAMS 0x0000000087300000, 0x0000000087400000| Complete -| 116|0x0000000087400000, 0x0000000087500000, 0x0000000087500000|100%|HS| |TAMS 0x0000000087400000, 0x0000000087500000| Complete -| 117|0x0000000087500000, 0x0000000087600000, 0x0000000087600000|100%|HC| |TAMS 0x0000000087500000, 0x0000000087600000| Complete -| 118|0x0000000087600000, 0x0000000087700000, 0x0000000087700000|100%|HC| |TAMS 0x0000000087600000, 0x0000000087700000| Complete -| 119|0x0000000087700000, 0x0000000087800000, 0x0000000087800000|100%|HC| |TAMS 0x0000000087700000, 0x0000000087800000| Complete -| 120|0x0000000087800000, 0x0000000087900000, 0x0000000087900000|100%|HC| |TAMS 0x0000000087800000, 0x0000000087900000| Complete -| 121|0x0000000087900000, 0x0000000087a00000, 0x0000000087a00000|100%|HS| |TAMS 0x0000000087900000, 0x0000000087a00000| Complete -| 122|0x0000000087a00000, 0x0000000087b00000, 0x0000000087b00000|100%| O| |TAMS 0x0000000087a00000, 0x0000000087b00000| Untracked -| 123|0x0000000087b00000, 0x0000000087c00000, 0x0000000087c00000|100%| O| |TAMS 0x0000000087b00000, 0x0000000087c00000| Untracked -| 124|0x0000000087c00000, 0x0000000087d00000, 0x0000000087d00000|100%| O| |TAMS 0x0000000087c00000, 0x0000000087d00000| Untracked -| 125|0x0000000087d00000, 0x0000000087e00000, 0x0000000087e00000|100%| O| |TAMS 0x0000000087d00000, 0x0000000087e00000| Untracked -| 126|0x0000000087e00000, 0x0000000087f00000, 0x0000000087f00000|100%| O| |TAMS 0x0000000087e00000, 0x0000000087f00000| Untracked -| 127|0x0000000087f00000, 0x0000000088000000, 0x0000000088000000|100%| O| |TAMS 0x0000000087f00000, 0x0000000088000000| Untracked -| 128|0x0000000088000000, 0x0000000088100000, 0x0000000088100000|100%| O| |TAMS 0x0000000088000000, 0x0000000088100000| Untracked -| 129|0x0000000088100000, 0x0000000088200000, 0x0000000088200000|100%| O| |TAMS 0x0000000088100000, 0x0000000088200000| Untracked -| 130|0x0000000088200000, 0x0000000088300000, 0x0000000088300000|100%| O| |TAMS 0x0000000088200000, 0x0000000088300000| Untracked -| 131|0x0000000088300000, 0x0000000088400000, 0x0000000088400000|100%| O| |TAMS 0x0000000088300000, 0x0000000088400000| Untracked -| 132|0x0000000088400000, 0x0000000088500000, 0x0000000088500000|100%| O| |TAMS 0x0000000088400000, 0x0000000088500000| Untracked -| 133|0x0000000088500000, 0x0000000088600000, 0x0000000088600000|100%| O| |TAMS 0x0000000088500000, 0x0000000088600000| Untracked -| 134|0x0000000088600000, 0x0000000088600000, 0x0000000088700000| 0%| F| |TAMS 0x0000000088600000, 0x0000000088600000| Untracked -| 135|0x0000000088700000, 0x0000000088700000, 0x0000000088800000| 0%| F| |TAMS 0x0000000088700000, 0x0000000088700000| Untracked -| 136|0x0000000088800000, 0x0000000088800000, 0x0000000088900000| 0%| F| |TAMS 0x0000000088800000, 0x0000000088800000| Untracked -| 137|0x0000000088900000, 0x0000000088900000, 0x0000000088a00000| 0%| F| |TAMS 0x0000000088900000, 0x0000000088900000| Untracked -| 138|0x0000000088a00000, 0x0000000088a00000, 0x0000000088b00000| 0%| F| |TAMS 0x0000000088a00000, 0x0000000088a00000| Untracked -| 139|0x0000000088b00000, 0x0000000088b00000, 0x0000000088c00000| 0%| F| |TAMS 0x0000000088b00000, 0x0000000088b00000| Untracked -| 140|0x0000000088c00000, 0x0000000088c00000, 0x0000000088d00000| 0%| F| |TAMS 0x0000000088c00000, 0x0000000088c00000| Untracked -| 141|0x0000000088d00000, 0x0000000088d00000, 0x0000000088e00000| 0%| F| |TAMS 0x0000000088d00000, 0x0000000088d00000| Untracked -| 142|0x0000000088e00000, 0x0000000088e00000, 0x0000000088f00000| 0%| F| |TAMS 0x0000000088e00000, 0x0000000088e00000| Untracked -| 143|0x0000000088f00000, 0x0000000088f00000, 0x0000000089000000| 0%| F| |TAMS 0x0000000088f00000, 0x0000000088f00000| Untracked -| 144|0x0000000089000000, 0x0000000089000000, 0x0000000089100000| 0%| F| |TAMS 0x0000000089000000, 0x0000000089000000| Untracked -| 145|0x0000000089100000, 0x0000000089100000, 0x0000000089200000| 0%| F| |TAMS 0x0000000089100000, 0x0000000089100000| Untracked -| 146|0x0000000089200000, 0x0000000089200000, 0x0000000089300000| 0%| F| |TAMS 0x0000000089200000, 0x0000000089200000| Untracked -| 147|0x0000000089300000, 0x0000000089300000, 0x0000000089400000| 0%| F| |TAMS 0x0000000089300000, 0x0000000089300000| Untracked -| 148|0x0000000089400000, 0x0000000089400000, 0x0000000089500000| 0%| F| |TAMS 0x0000000089400000, 0x0000000089400000| Untracked -| 149|0x0000000089500000, 0x0000000089500000, 0x0000000089600000| 0%| F| |TAMS 0x0000000089500000, 0x0000000089500000| Untracked -| 150|0x0000000089600000, 0x0000000089600000, 0x0000000089700000| 0%| F| |TAMS 0x0000000089600000, 0x0000000089600000| Untracked -| 151|0x0000000089700000, 0x0000000089700000, 0x0000000089800000| 0%| F| |TAMS 0x0000000089700000, 0x0000000089700000| Untracked -| 152|0x0000000089800000, 0x0000000089800000, 0x0000000089900000| 0%| F| |TAMS 0x0000000089800000, 0x0000000089800000| Untracked -| 153|0x0000000089900000, 0x0000000089900000, 0x0000000089a00000| 0%| F| |TAMS 0x0000000089900000, 0x0000000089900000| Untracked -| 154|0x0000000089a00000, 0x0000000089a00000, 0x0000000089b00000| 0%| F| |TAMS 0x0000000089a00000, 0x0000000089a00000| Untracked -| 155|0x0000000089b00000, 0x0000000089b00000, 0x0000000089c00000| 0%| F| |TAMS 0x0000000089b00000, 0x0000000089b00000| Untracked -| 156|0x0000000089c00000, 0x0000000089c00000, 0x0000000089d00000| 0%| F| |TAMS 0x0000000089c00000, 0x0000000089c00000| Untracked -| 157|0x0000000089d00000, 0x0000000089d00000, 0x0000000089e00000| 0%| F| |TAMS 0x0000000089d00000, 0x0000000089d00000| Untracked -| 158|0x0000000089e00000, 0x0000000089e00000, 0x0000000089f00000| 0%| F| |TAMS 0x0000000089e00000, 0x0000000089e00000| Untracked -| 159|0x0000000089f00000, 0x0000000089f00000, 0x000000008a000000| 0%| F| |TAMS 0x0000000089f00000, 0x0000000089f00000| Untracked -| 160|0x000000008a000000, 0x000000008a000000, 0x000000008a100000| 0%| F| |TAMS 0x000000008a000000, 0x000000008a000000| Untracked -| 161|0x000000008a100000, 0x000000008a100000, 0x000000008a200000| 0%| F| |TAMS 0x000000008a100000, 0x000000008a100000| Untracked -| 162|0x000000008a200000, 0x000000008a200000, 0x000000008a300000| 0%| F| |TAMS 0x000000008a200000, 0x000000008a200000| Untracked -| 163|0x000000008a300000, 0x000000008a300000, 0x000000008a400000| 0%| F| |TAMS 0x000000008a300000, 0x000000008a300000| Untracked -| 164|0x000000008a400000, 0x000000008a400000, 0x000000008a500000| 0%| F| |TAMS 0x000000008a400000, 0x000000008a400000| Untracked -| 165|0x000000008a500000, 0x000000008a500000, 0x000000008a600000| 0%| F| |TAMS 0x000000008a500000, 0x000000008a500000| Untracked -| 166|0x000000008a600000, 0x000000008a600000, 0x000000008a700000| 0%| F| |TAMS 0x000000008a600000, 0x000000008a600000| Untracked -| 167|0x000000008a700000, 0x000000008a700000, 0x000000008a800000| 0%| F| |TAMS 0x000000008a700000, 0x000000008a700000| Untracked -| 168|0x000000008a800000, 0x000000008a800000, 0x000000008a900000| 0%| F| |TAMS 0x000000008a800000, 0x000000008a800000| Untracked -| 169|0x000000008a900000, 0x000000008a900000, 0x000000008aa00000| 0%| F| |TAMS 0x000000008a900000, 0x000000008a900000| Untracked -| 170|0x000000008aa00000, 0x000000008aa00000, 0x000000008ab00000| 0%| F| |TAMS 0x000000008aa00000, 0x000000008aa00000| Untracked -| 171|0x000000008ab00000, 0x000000008ab00000, 0x000000008ac00000| 0%| F| |TAMS 0x000000008ab00000, 0x000000008ab00000| Untracked -| 172|0x000000008ac00000, 0x000000008ac00000, 0x000000008ad00000| 0%| F| |TAMS 0x000000008ac00000, 0x000000008ac00000| Untracked -| 173|0x000000008ad00000, 0x000000008ad00000, 0x000000008ae00000| 0%| F| |TAMS 0x000000008ad00000, 0x000000008ad00000| Untracked -| 174|0x000000008ae00000, 0x000000008ae00000, 0x000000008af00000| 0%| F| |TAMS 0x000000008ae00000, 0x000000008ae00000| Untracked -| 175|0x000000008af00000, 0x000000008af00000, 0x000000008b000000| 0%| F| |TAMS 0x000000008af00000, 0x000000008af00000| Untracked -| 176|0x000000008b000000, 0x000000008b000000, 0x000000008b100000| 0%| F| |TAMS 0x000000008b000000, 0x000000008b000000| Untracked -| 177|0x000000008b100000, 0x000000008b100000, 0x000000008b200000| 0%| F| |TAMS 0x000000008b100000, 0x000000008b100000| Untracked -| 178|0x000000008b200000, 0x000000008b200000, 0x000000008b300000| 0%| F| |TAMS 0x000000008b200000, 0x000000008b200000| Untracked -| 179|0x000000008b300000, 0x000000008b300000, 0x000000008b400000| 0%| F| |TAMS 0x000000008b300000, 0x000000008b300000| Untracked -| 180|0x000000008b400000, 0x000000008b400000, 0x000000008b500000| 0%| F| |TAMS 0x000000008b400000, 0x000000008b400000| Untracked -| 181|0x000000008b500000, 0x000000008b500000, 0x000000008b600000| 0%| F| |TAMS 0x000000008b500000, 0x000000008b500000| Untracked -| 182|0x000000008b600000, 0x000000008b600000, 0x000000008b700000| 0%| F| |TAMS 0x000000008b600000, 0x000000008b600000| Untracked -| 183|0x000000008b700000, 0x000000008b700000, 0x000000008b800000| 0%| F| |TAMS 0x000000008b700000, 0x000000008b700000| Untracked -| 184|0x000000008b800000, 0x000000008b800000, 0x000000008b900000| 0%| F| |TAMS 0x000000008b800000, 0x000000008b800000| Untracked -| 185|0x000000008b900000, 0x000000008b900000, 0x000000008ba00000| 0%| F| |TAMS 0x000000008b900000, 0x000000008b900000| Untracked -| 186|0x000000008ba00000, 0x000000008ba00000, 0x000000008bb00000| 0%| F| |TAMS 0x000000008ba00000, 0x000000008ba00000| Untracked -| 187|0x000000008bb00000, 0x000000008bb00000, 0x000000008bc00000| 0%| F| |TAMS 0x000000008bb00000, 0x000000008bb00000| Untracked -| 188|0x000000008bc00000, 0x000000008bc00000, 0x000000008bd00000| 0%| F| |TAMS 0x000000008bc00000, 0x000000008bc00000| Untracked -| 189|0x000000008bd00000, 0x000000008bd00000, 0x000000008be00000| 0%| F| |TAMS 0x000000008bd00000, 0x000000008bd00000| Untracked -| 190|0x000000008be00000, 0x000000008be00000, 0x000000008bf00000| 0%| F| |TAMS 0x000000008be00000, 0x000000008be00000| Untracked -| 191|0x000000008bf00000, 0x000000008bf00000, 0x000000008c000000| 0%| F| |TAMS 0x000000008bf00000, 0x000000008bf00000| Untracked -| 192|0x000000008c000000, 0x000000008c000000, 0x000000008c100000| 0%| F| |TAMS 0x000000008c000000, 0x000000008c000000| Untracked -| 193|0x000000008c100000, 0x000000008c100000, 0x000000008c200000| 0%| F| |TAMS 0x000000008c100000, 0x000000008c100000| Untracked -| 194|0x000000008c200000, 0x000000008c200000, 0x000000008c300000| 0%| F| |TAMS 0x000000008c200000, 0x000000008c200000| Untracked -| 195|0x000000008c300000, 0x000000008c300000, 0x000000008c400000| 0%| F| |TAMS 0x000000008c300000, 0x000000008c300000| Untracked -| 196|0x000000008c400000, 0x000000008c400000, 0x000000008c500000| 0%| F| |TAMS 0x000000008c400000, 0x000000008c400000| Untracked -| 197|0x000000008c500000, 0x000000008c500000, 0x000000008c600000| 0%| F| |TAMS 0x000000008c500000, 0x000000008c500000| Untracked -| 198|0x000000008c600000, 0x000000008c600000, 0x000000008c700000| 0%| F| |TAMS 0x000000008c600000, 0x000000008c600000| Untracked -| 199|0x000000008c700000, 0x000000008c700000, 0x000000008c800000| 0%| F| |TAMS 0x000000008c700000, 0x000000008c700000| Untracked -| 200|0x000000008c800000, 0x000000008c800000, 0x000000008c900000| 0%| F| |TAMS 0x000000008c800000, 0x000000008c800000| Untracked -| 201|0x000000008c900000, 0x000000008c900000, 0x000000008ca00000| 0%| F| |TAMS 0x000000008c900000, 0x000000008c900000| Untracked -| 202|0x000000008ca00000, 0x000000008ca00000, 0x000000008cb00000| 0%| F| |TAMS 0x000000008ca00000, 0x000000008ca00000| Untracked -| 203|0x000000008cb00000, 0x000000008cb00000, 0x000000008cc00000| 0%| F| |TAMS 0x000000008cb00000, 0x000000008cb00000| Untracked -| 204|0x000000008cc00000, 0x000000008cc00000, 0x000000008cd00000| 0%| F| |TAMS 0x000000008cc00000, 0x000000008cc00000| Untracked -| 205|0x000000008cd00000, 0x000000008cd00000, 0x000000008ce00000| 0%| F| |TAMS 0x000000008cd00000, 0x000000008cd00000| Untracked -| 206|0x000000008ce00000, 0x000000008ce00000, 0x000000008cf00000| 0%| F| |TAMS 0x000000008ce00000, 0x000000008ce00000| Untracked -| 207|0x000000008cf00000, 0x000000008cf00000, 0x000000008d000000| 0%| F| |TAMS 0x000000008cf00000, 0x000000008cf00000| Untracked -| 208|0x000000008d000000, 0x000000008d000000, 0x000000008d100000| 0%| F| |TAMS 0x000000008d000000, 0x000000008d000000| Untracked -| 209|0x000000008d100000, 0x000000008d100000, 0x000000008d200000| 0%| F| |TAMS 0x000000008d100000, 0x000000008d100000| Untracked -| 210|0x000000008d200000, 0x000000008d200000, 0x000000008d300000| 0%| F| |TAMS 0x000000008d200000, 0x000000008d200000| Untracked -| 211|0x000000008d300000, 0x000000008d300000, 0x000000008d400000| 0%| F| |TAMS 0x000000008d300000, 0x000000008d300000| Untracked -| 212|0x000000008d400000, 0x000000008d400000, 0x000000008d500000| 0%| F| |TAMS 0x000000008d400000, 0x000000008d400000| Untracked -| 213|0x000000008d500000, 0x000000008d500000, 0x000000008d600000| 0%| F| |TAMS 0x000000008d500000, 0x000000008d500000| Untracked -| 214|0x000000008d600000, 0x000000008d600000, 0x000000008d700000| 0%| F| |TAMS 0x000000008d600000, 0x000000008d600000| Untracked -| 215|0x000000008d700000, 0x000000008d700000, 0x000000008d800000| 0%| F| |TAMS 0x000000008d700000, 0x000000008d700000| Untracked -| 216|0x000000008d800000, 0x000000008d800000, 0x000000008d900000| 0%| F| |TAMS 0x000000008d800000, 0x000000008d800000| Untracked -| 217|0x000000008d900000, 0x000000008d900000, 0x000000008da00000| 0%| F| |TAMS 0x000000008d900000, 0x000000008d900000| Untracked -| 218|0x000000008da00000, 0x000000008da00000, 0x000000008db00000| 0%| F| |TAMS 0x000000008da00000, 0x000000008da00000| Untracked -| 219|0x000000008db00000, 0x000000008db00000, 0x000000008dc00000| 0%| F| |TAMS 0x000000008db00000, 0x000000008db00000| Untracked -| 220|0x000000008dc00000, 0x000000008dc00000, 0x000000008dd00000| 0%| F| |TAMS 0x000000008dc00000, 0x000000008dc00000| Untracked -| 221|0x000000008dd00000, 0x000000008dd00000, 0x000000008de00000| 0%| F| |TAMS 0x000000008dd00000, 0x000000008dd00000| Untracked -| 222|0x000000008de00000, 0x000000008de00000, 0x000000008df00000| 0%| F| |TAMS 0x000000008de00000, 0x000000008de00000| Untracked -| 223|0x000000008df00000, 0x000000008df00000, 0x000000008e000000| 0%| F| |TAMS 0x000000008df00000, 0x000000008df00000| Untracked -| 224|0x000000008e000000, 0x000000008e000000, 0x000000008e100000| 0%| F| |TAMS 0x000000008e000000, 0x000000008e000000| Untracked -| 225|0x000000008e100000, 0x000000008e100000, 0x000000008e200000| 0%| F| |TAMS 0x000000008e100000, 0x000000008e100000| Untracked -| 226|0x000000008e200000, 0x000000008e200000, 0x000000008e300000| 0%| F| |TAMS 0x000000008e200000, 0x000000008e200000| Untracked -| 227|0x000000008e300000, 0x000000008e300000, 0x000000008e400000| 0%| F| |TAMS 0x000000008e300000, 0x000000008e300000| Untracked -| 228|0x000000008e400000, 0x000000008e400000, 0x000000008e500000| 0%| F| |TAMS 0x000000008e400000, 0x000000008e400000| Untracked -| 229|0x000000008e500000, 0x000000008e500000, 0x000000008e600000| 0%| F| |TAMS 0x000000008e500000, 0x000000008e500000| Untracked -| 230|0x000000008e600000, 0x000000008e600000, 0x000000008e700000| 0%| F| |TAMS 0x000000008e600000, 0x000000008e600000| Untracked -| 231|0x000000008e700000, 0x000000008e700000, 0x000000008e800000| 0%| F| |TAMS 0x000000008e700000, 0x000000008e700000| Untracked -| 232|0x000000008e800000, 0x000000008e800000, 0x000000008e900000| 0%| F| |TAMS 0x000000008e800000, 0x000000008e800000| Untracked -| 233|0x000000008e900000, 0x000000008e900000, 0x000000008ea00000| 0%| F| |TAMS 0x000000008e900000, 0x000000008e900000| Untracked -| 234|0x000000008ea00000, 0x000000008ea00000, 0x000000008eb00000| 0%| F| |TAMS 0x000000008ea00000, 0x000000008ea00000| Untracked -| 235|0x000000008eb00000, 0x000000008eb00000, 0x000000008ec00000| 0%| F| |TAMS 0x000000008eb00000, 0x000000008eb00000| Untracked -| 236|0x000000008ec00000, 0x000000008ec00000, 0x000000008ed00000| 0%| F| |TAMS 0x000000008ec00000, 0x000000008ec00000| Untracked -| 237|0x000000008ed00000, 0x000000008ed00000, 0x000000008ee00000| 0%| F| |TAMS 0x000000008ed00000, 0x000000008ed00000| Untracked -| 238|0x000000008ee00000, 0x000000008ee00000, 0x000000008ef00000| 0%| F| |TAMS 0x000000008ee00000, 0x000000008ee00000| Untracked -| 239|0x000000008ef00000, 0x000000008ef00000, 0x000000008f000000| 0%| F| |TAMS 0x000000008ef00000, 0x000000008ef00000| Untracked -| 240|0x000000008f000000, 0x000000008f000000, 0x000000008f100000| 0%| F| |TAMS 0x000000008f000000, 0x000000008f000000| Untracked -| 241|0x000000008f100000, 0x000000008f100000, 0x000000008f200000| 0%| F| |TAMS 0x000000008f100000, 0x000000008f100000| Untracked -| 242|0x000000008f200000, 0x000000008f200000, 0x000000008f300000| 0%| F| |TAMS 0x000000008f200000, 0x000000008f200000| Untracked -| 243|0x000000008f300000, 0x000000008f300000, 0x000000008f400000| 0%| F| |TAMS 0x000000008f300000, 0x000000008f300000| Untracked -| 244|0x000000008f400000, 0x000000008f400000, 0x000000008f500000| 0%| F| |TAMS 0x000000008f400000, 0x000000008f400000| Untracked -| 245|0x000000008f500000, 0x000000008f500000, 0x000000008f600000| 0%| F| |TAMS 0x000000008f500000, 0x000000008f500000| Untracked -| 246|0x000000008f600000, 0x000000008f600000, 0x000000008f700000| 0%| F| |TAMS 0x000000008f600000, 0x000000008f600000| Untracked -| 247|0x000000008f700000, 0x000000008f700000, 0x000000008f800000| 0%| F| |TAMS 0x000000008f700000, 0x000000008f700000| Untracked -| 248|0x000000008f800000, 0x000000008f800000, 0x000000008f900000| 0%| F| |TAMS 0x000000008f800000, 0x000000008f800000| Untracked -| 249|0x000000008f900000, 0x000000008f900000, 0x000000008fa00000| 0%| F| |TAMS 0x000000008f900000, 0x000000008f900000| Untracked -| 250|0x000000008fa00000, 0x000000008fa00000, 0x000000008fb00000| 0%| F| |TAMS 0x000000008fa00000, 0x000000008fa00000| Untracked -| 251|0x000000008fb00000, 0x000000008fb00000, 0x000000008fc00000| 0%| F| |TAMS 0x000000008fb00000, 0x000000008fb00000| Untracked -| 252|0x000000008fc00000, 0x000000008fc00000, 0x000000008fd00000| 0%| F| |TAMS 0x000000008fc00000, 0x000000008fc00000| Untracked -| 253|0x000000008fd00000, 0x000000008fd00000, 0x000000008fe00000| 0%| F| |TAMS 0x000000008fd00000, 0x000000008fd00000| Untracked -| 254|0x000000008fe00000, 0x000000008fe00000, 0x000000008ff00000| 0%| F| |TAMS 0x000000008fe00000, 0x000000008fe00000| Untracked -| 255|0x000000008ff00000, 0x000000008ff00000, 0x0000000090000000| 0%| F| |TAMS 0x000000008ff00000, 0x000000008ff00000| Untracked -| 256|0x0000000090000000, 0x0000000090000000, 0x0000000090100000| 0%| F| |TAMS 0x0000000090000000, 0x0000000090000000| Untracked -| 257|0x0000000090100000, 0x0000000090100000, 0x0000000090200000| 0%| F| |TAMS 0x0000000090100000, 0x0000000090100000| Untracked -| 258|0x0000000090200000, 0x0000000090200000, 0x0000000090300000| 0%| F| |TAMS 0x0000000090200000, 0x0000000090200000| Untracked -| 259|0x0000000090300000, 0x0000000090300000, 0x0000000090400000| 0%| F| |TAMS 0x0000000090300000, 0x0000000090300000| Untracked -| 260|0x0000000090400000, 0x0000000090400000, 0x0000000090500000| 0%| F| |TAMS 0x0000000090400000, 0x0000000090400000| Untracked -| 261|0x0000000090500000, 0x0000000090500000, 0x0000000090600000| 0%| F| |TAMS 0x0000000090500000, 0x0000000090500000| Untracked -| 262|0x0000000090600000, 0x0000000090600000, 0x0000000090700000| 0%| F| |TAMS 0x0000000090600000, 0x0000000090600000| Untracked -| 263|0x0000000090700000, 0x0000000090700000, 0x0000000090800000| 0%| F| |TAMS 0x0000000090700000, 0x0000000090700000| Untracked -| 264|0x0000000090800000, 0x0000000090800000, 0x0000000090900000| 0%| F| |TAMS 0x0000000090800000, 0x0000000090800000| Untracked -| 265|0x0000000090900000, 0x0000000090900000, 0x0000000090a00000| 0%| F| |TAMS 0x0000000090900000, 0x0000000090900000| Untracked -| 266|0x0000000090a00000, 0x0000000090a00000, 0x0000000090b00000| 0%| F| |TAMS 0x0000000090a00000, 0x0000000090a00000| Untracked -| 267|0x0000000090b00000, 0x0000000090b00000, 0x0000000090c00000| 0%| F| |TAMS 0x0000000090b00000, 0x0000000090b00000| Untracked -| 268|0x0000000090c00000, 0x0000000090c00000, 0x0000000090d00000| 0%| F| |TAMS 0x0000000090c00000, 0x0000000090c00000| Untracked -| 269|0x0000000090d00000, 0x0000000090d00000, 0x0000000090e00000| 0%| F| |TAMS 0x0000000090d00000, 0x0000000090d00000| Untracked -| 270|0x0000000090e00000, 0x0000000090e00000, 0x0000000090f00000| 0%| F| |TAMS 0x0000000090e00000, 0x0000000090e00000| Untracked -| 271|0x0000000090f00000, 0x0000000090fb8a30, 0x0000000091000000| 72%| S|CS|TAMS 0x0000000090f00000, 0x0000000090f00000| Complete -| 272|0x0000000091000000, 0x0000000091000000, 0x0000000091100000| 0%| F| |TAMS 0x0000000091000000, 0x0000000091000000| Untracked -| 273|0x0000000091100000, 0x0000000091100000, 0x0000000091200000| 0%| F| |TAMS 0x0000000091100000, 0x0000000091100000| Untracked -| 274|0x0000000091200000, 0x0000000091200000, 0x0000000091300000| 0%| F| |TAMS 0x0000000091200000, 0x0000000091200000| Untracked -| 275|0x0000000091300000, 0x0000000091300000, 0x0000000091400000| 0%| F| |TAMS 0x0000000091300000, 0x0000000091300000| Untracked -| 276|0x0000000091400000, 0x0000000091400000, 0x0000000091500000| 0%| F| |TAMS 0x0000000091400000, 0x0000000091400000| Untracked -| 277|0x0000000091500000, 0x0000000091500000, 0x0000000091600000| 0%| F| |TAMS 0x0000000091500000, 0x0000000091500000| Untracked - -Card table byte_map: [0x000002252a680000,0x000002252aa80000] _byte_map_base: 0x000002252a280000 - -Marking Bits (Prev, Next): (CMBitMap*) 0x0000022517b9ab60, (CMBitMap*) 0x0000022517b9ab28 - Prev Bits: [0x000002252ce80000, 0x000002252ee80000) - Next Bits: [0x000002252ae80000, 0x000002252ce80000) - -Polling page: 0x0000022515b10000 - -Metaspace: - -Usage: - Non-class: 80.88 MB capacity, 79.13 MB ( 98%) used, 1.46 MB ( 2%) free+waste, 302.69 KB ( <1%) overhead. - Class: 13.36 MB capacity, 12.30 MB ( 92%) used, 941.90 KB ( 7%) free+waste, 145.25 KB ( 1%) overhead. - Both: 94.24 MB capacity, 91.42 MB ( 97%) used, 2.38 MB ( 3%) free+waste, 447.94 KB ( <1%) overhead. - -Virtual space: - Non-class space: 90.00 MB reserved, 80.92 MB ( 90%) committed - Class space: 1.00 GB reserved, 13.38 MB ( 1%) committed - Both: 1.09 GB reserved, 94.30 MB ( 8%) committed - -Chunk freelists: - Non-Class: 42.00 KB - Class: 18.00 KB - Both: 60.00 KB - -MaxMetaspaceSize: 17179869184.00 GB -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 20.80 MB -Current GC threshold: 146.24 MB -CDS: off - -CodeHeap 'non-profiled nmethods': size=120064Kb used=5951Kb max_used=5951Kb free=114112Kb - bounds [0x0000022523140000, 0x0000022523710000, 0x000002252a680000] -CodeHeap 'profiled nmethods': size=120000Kb used=21698Kb max_used=21698Kb free=98301Kb - bounds [0x000002251bc10000, 0x000002251d150000, 0x0000022523140000] -CodeHeap 'non-nmethods': size=5696Kb used=2390Kb max_used=2412Kb free=3305Kb - bounds [0x000002251b680000, 0x000002251b8f0000, 0x000002251bc10000] - total_blobs=10637 nmethods=9720 adapters=829 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 79.992 Thread 0x0000022531a68800 nmethod 9783 0x000002251d13ca10 code [0x000002251d13cda0, 0x000002251d13ee58] -Event: 80.099 Thread 0x0000022531a66800 nmethod 9770 0x0000022523707d10 code [0x0000022523707f60, 0x000002252370a340] -Event: 80.100 Thread 0x0000022531a66800 9771 4 java.lang.StringUTF16::compress (50 bytes) -Event: 80.106 Thread 0x0000022531a66800 nmethod 9771 0x000002252370b210 code [0x000002252370b3a0, 0x000002252370b698] -Event: 80.107 Thread 0x0000022531a66800 9776 % 4 sun.nio.cs.UTF_8$Decoder::decodeArrayLoop @ 106 (691 bytes) -Event: 80.149 Thread 0x0000022531a68800 9784 2 sun.net.util.URLUtil::urlNoFragString (114 bytes) -Event: 80.150 Thread 0x0000022531a66800 nmethod 9776% 0x000002252370b790 code [0x000002252370b9e0, 0x000002252370c7b8] -Event: 80.151 Thread 0x0000022531a66800 9774 4 java.lang.String::startsWith (138 bytes) -Event: 80.151 Thread 0x0000022531a68800 nmethod 9784 0x000002251d13f890 code [0x000002251d13fb00, 0x000002251d140058] -Event: 80.151 Thread 0x0000022531a68800 9785 2 java.net.URL::getDefaultPort (8 bytes) -Event: 80.152 Thread 0x0000022531a68800 nmethod 9785 0x000002251d140390 code [0x000002251d140540, 0x000002251d140668] -Event: 80.157 Thread 0x0000022531a66800 nmethod 9774 0x000002252370d590 code [0x000002252370d720, 0x000002252370d918] -Event: 80.158 Thread 0x0000022531a66800 9773 4 java.lang.String::startsWith (7 bytes) -Event: 80.164 Thread 0x0000022531a66800 nmethod 9773 0x000002252370da90 code [0x000002252370dc20, 0x000002252370ddf8] -Event: 80.191 Thread 0x0000022531a66800 9786 4 java.lang.ClassLoader::preDefineClass (116 bytes) -Event: 80.241 Thread 0x0000022531a66800 nmethod 9786 0x000002252370df90 code [0x000002252370e1a0, 0x000002252370efc8] -Event: 80.242 Thread 0x0000022531a66800 9787 4 java.lang.String::hashCode (49 bytes) -Event: 80.250 Thread 0x0000022531a66800 nmethod 9787 0x000002252370f890 code [0x000002252370fa20, 0x000002252370fc78] -Event: 80.281 Thread 0x0000022531a68800 9788 3 org.slf4j.impl.StaticLoggerBinder::getSingleton (4 bytes) -Event: 80.281 Thread 0x0000022531a68800 nmethod 9788 0x000002251d140710 code [0x000002251d1408c0, 0x000002251d1409b8] - -GC Heap History (20 events): -Event: 40.469 GC heap before -{Heap before GC invocations=56 (full 0): - garbage-first heap total 176128K, used 133402K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 55 young (56320K), 4 survivors (4096K) - Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K - class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K -} -Event: 40.493 GC heap after -{Heap after GC invocations=57 (full 0): - garbage-first heap total 176128K, used 85256K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K - class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K -} -Event: 43.393 GC heap before -{Heap before GC invocations=57 (full 0): - garbage-first heap total 176128K, used 142600K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 63 young (64512K), 7 survivors (7168K) - Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K - class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K -} -Event: 43.441 GC heap after -{Heap after GC invocations=58 (full 0): - garbage-first heap total 176128K, used 87003K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 6 young (6144K), 6 survivors (6144K) - Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K - class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K -} -Event: 45.839 GC heap before -{Heap before GC invocations=58 (full 0): - garbage-first heap total 176128K, used 144347K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 63 young (64512K), 6 survivors (6144K) - Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K - class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K -} -Event: 45.877 GC heap after -{Heap after GC invocations=59 (full 0): - garbage-first heap total 176128K, used 89690K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 5 young (5120K), 5 survivors (5120K) - Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K - class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K -} -Event: 48.274 GC heap before -{Heap before GC invocations=60 (full 0): - garbage-first heap total 176128K, used 153178K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 61 young (62464K), 5 survivors (5120K) - Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K - class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K -} -Event: 48.337 GC heap after -{Heap after GC invocations=61 (full 0): - garbage-first heap total 211968K, used 99725K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K - class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K -} -Event: 52.007 GC heap before -{Heap before GC invocations=61 (full 0): - garbage-first heap total 211968K, used 167309K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 73 young (74752K), 7 survivors (7168K) - Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K - class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K -} -Event: 52.081 GC heap after -{Heap after GC invocations=62 (full 0): - garbage-first heap total 211968K, used 102211K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 6 young (6144K), 6 survivors (6144K) - Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K - class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K -} -Event: 63.878 GC heap before -{Heap before GC invocations=62 (full 0): - garbage-first heap total 211968K, used 175939K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 79 young (80896K), 6 survivors (6144K) - Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K - class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K -} -Event: 64.071 GC heap after -{Heap after GC invocations=63 (full 0): - garbage-first heap total 211968K, used 106847K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K - class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K -} -Event: 72.632 GC heap before -{Heap before GC invocations=64 (full 0): - garbage-first heap total 211968K, used 177503K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 76 young (77824K), 7 survivors (7168K) - Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K - class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K -} -Event: 72.787 GC heap after -{Heap after GC invocations=65 (full 0): - garbage-first heap total 211968K, used 109366K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K - class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K -} -Event: 73.860 GC heap before -{Heap before GC invocations=65 (full 0): - garbage-first heap total 211968K, used 119606K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 18 young (18432K), 7 survivors (7168K) - Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K - class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K -} -Event: 73.917 GC heap after -{Heap after GC invocations=66 (full 0): - garbage-first heap total 284672K, used 110080K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 4 young (4096K), 4 survivors (4096K) - Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K - class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K -} -Event: 80.027 GC heap before -{Heap before GC invocations=67 (full 0): - garbage-first heap total 284672K, used 179712K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 55 young (56320K), 4 survivors (4096K) - Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K - class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K -} -Event: 80.095 GC heap after -{Heap after GC invocations=68 (full 0): - garbage-first heap total 284672K, used 136936K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K - class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K -} -Event: 80.287 GC heap before -{Heap before GC invocations=68 (full 0): - garbage-first heap total 284672K, used 142056K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 13 young (13312K), 7 survivors (7168K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -} -Event: 80.394 GC heap after -{Heap after GC invocations=69 (full 0): - garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 1 young (1024K), 1 survivors (1024K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -} - -Deoptimization events (20 events): -Event: 79.976 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.976 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.977 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.977 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x0000022523146710 relative=0x0000000000000170 -Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000022523146710 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 79.981 Thread 0x00000225324c0800 DEOPT PACKING pc=0x0000022523146710 sp=0x0000008c56ffca00 -Event: 79.981 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc928 mode 2 -Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225236c90cc relative=0x00000000000013cc -Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225236c90cc method=java.util.concurrent.ConcurrentHashMap.putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object; @ 401 c2 -Event: 79.984 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225236c90cc sp=0x0000008c56ffca30 -Event: 79.984 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc9c0 mode 2 -Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225232060cc relative=0x000000000000124c -Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225232060cc method=java.util.concurrent.ConcurrentHashMap.transfer([Ljava/util/concurrent/ConcurrentHashMap$Node;[Ljava/util/concurrent/ConcurrentHashMap$Node;)V @ 352 c2 -Event: 79.993 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225232060cc sp=0x0000008c56ffc810 -Event: 79.993 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc788 mode 2 - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 77.831 Thread 0x000002253253b800 Exception (0x000000008ff476c8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.835 Thread 0x000002253253b800 Exception (0x000000008ff6ac98) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.836 Thread 0x000002253253b800 Exception (0x000000008ff83d68) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.837 Thread 0x000002253253b800 Exception (0x000000008ff9bd00) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.839 Thread 0x000002253253b800 Exception (0x000000008ffb3428) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.841 Thread 0x000002253253b800 Exception (0x000000008ffcb900) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.842 Thread 0x000002253253b800 Exception (0x000000008ffe3350) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.844 Thread 0x000002253253b800 Exception (0x000000008ffedb28) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.845 Thread 0x000002253253b800 Exception (0x000000008fff83a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.848 Thread 0x000002253253b800 Exception (0x000000008fe19198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.851 Thread 0x000002253253b800 Exception (0x000000008fe4e380) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.856 Thread 0x000002253253b800 Exception (0x000000008fe8b638) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.860 Thread 0x000002253253b800 Exception (0x000000008feb77a0) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.863 Thread 0x000002253253b800 Exception (0x000000008fee37a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.866 Thread 0x000002253253b800 Exception (0x000000008fd12198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.871 Thread 0x000002253253b800 Exception (0x000000008fd44978) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.901 Thread 0x000002253253b800 Exception (0x000000008fdf3650) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.903 Thread 0x000002253253b800 Exception (0x000000008fc06b90) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 78.412 Thread 0x00000225324c0800 Implicit null exception at 0x00000225234c7165 to 0x00000225234c79dc -Event: 78.846 Thread 0x00000225324c0800 Exception (0x000000008f2f9b78) thrown at [./src/hotspot/share/prims/jni.cpp, line 616] - -Events (20 events): -Event: 80.272 loading class org/apache/http/impl/execchain/RedirectExec done -Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore -Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore done -Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator -Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator done -Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 -Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 done -Event: 80.277 loading class org/apache/http/client/ClientProtocolException -Event: 80.277 loading class org/apache/http/client/ClientProtocolException done -Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager -Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager done -Event: 80.281 loading class org/apache/http/client/utils/URIUtils -Event: 80.281 loading class org/apache/http/client/utils/URIUtils done -Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag -Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag done -Event: 80.285 loading class org/apache/http/HttpHost -Event: 80.285 loading class org/apache/http/HttpHost done -Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper -Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper done -Event: 80.287 Executing VM operation: CollectForMetadataAllocation - - -Dynamic libraries: -0x00007ff668680000 - 0x00007ff66868a000 C:\Program Files\Android\Android Studio1\jre\bin\java.exe -0x00007ffb8e7d0000 - 0x00007ffb8e9c8000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffb8e630000 - 0x00007ffb8e6ef000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffb8bfb0000 - 0x00007ffb8c2a6000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffb8c2b0000 - 0x00007ffb8c3b0000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffb5be60000 - 0x00007ffb5be79000 C:\Program Files\Android\Android Studio1\jre\bin\jli.dll -0x00007ffb5be40000 - 0x00007ffb5be57000 C:\Program Files\Android\Android Studio1\jre\bin\VCRUNTIME140.dll -0x00007ffb8d450000 - 0x00007ffb8d5ed000 C:\WINDOWS\System32\USER32.dll -0x00007ffb8c540000 - 0x00007ffb8c562000 C:\WINDOWS\System32\win32u.dll -0x00007ffb8db60000 - 0x00007ffb8db8c000 C:\WINDOWS\System32\GDI32.dll -0x00007ffb8c710000 - 0x00007ffb8c825000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffb8c670000 - 0x00007ffb8c70d000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffb7c7e0000 - 0x00007ffb7ca7a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll -0x00007ffb8dac0000 - 0x00007ffb8db5e000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffb8ccd0000 - 0x00007ffb8cd00000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffb3f2a0000 - 0x00007ffb3f33d000 C:\Program Files\Android\Android Studio1\jre\bin\msvcp140.dll -0x00007ffb23b50000 - 0x00007ffb24652000 C:\Program Files\Android\Android Studio1\jre\bin\server\jvm.dll -0x00007ffb8ca80000 - 0x00007ffb8cb2f000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffb8e6f0000 - 0x00007ffb8e78c000 C:\WINDOWS\System32\sechost.dll -0x00007ffb8c830000 - 0x00007ffb8c956000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffb8ca70000 - 0x00007ffb8ca78000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ffb85130000 - 0x00007ffb85139000 C:\WINDOWS\SYSTEM32\WSOCK32.dll -0x00007ffb8df00000 - 0x00007ffb8df6b000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffb816a0000 - 0x00007ffb816aa000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffb816b0000 - 0x00007ffb816d7000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffb8a6f0000 - 0x00007ffb8a702000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffb84710000 - 0x00007ffb84721000 C:\Program Files\Android\Android Studio1\jre\bin\verify.dll -0x00007ffb8a4e0000 - 0x00007ffb8a6c4000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffb76690000 - 0x00007ffb766c4000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffb8c5e0000 - 0x00007ffb8c662000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffb7c210000 - 0x00007ffb7c239000 C:\Program Files\Android\Android Studio1\jre\bin\java.dll -0x00007ffb84330000 - 0x00007ffb8433b000 C:\Program Files\Android\Android Studio1\jre\bin\jimage.dll -0x00007ffb72a00000 - 0x00007ffb72a18000 C:\Program Files\Android\Android Studio1\jre\bin\zip.dll -0x00007ffb8cd00000 - 0x00007ffb8d444000 C:\WINDOWS\System32\SHELL32.dll -0x00007ffb89c00000 - 0x00007ffb8a393000 C:\WINDOWS\SYSTEM32\windows.storage.dll -0x00007ffb8e120000 - 0x00007ffb8e474000 C:\WINDOWS\System32\combase.dll -0x00007ffb8b890000 - 0x00007ffb8b8be000 C:\WINDOWS\SYSTEM32\Wldp.dll -0x00007ffb8c960000 - 0x00007ffb8ca0d000 C:\WINDOWS\System32\SHCORE.dll -0x00007ffb8cb30000 - 0x00007ffb8cb85000 C:\WINDOWS\System32\shlwapi.dll -0x00007ffb8bdf0000 - 0x00007ffb8be0f000 C:\WINDOWS\SYSTEM32\profapi.dll -0x00007ffb729e0000 - 0x00007ffb729fa000 C:\Program Files\Android\Android Studio1\jre\bin\net.dll -0x00007ffb7d4d0000 - 0x00007ffb7d5da000 C:\WINDOWS\SYSTEM32\WINHTTP.dll -0x00007ffb8b580000 - 0x00007ffb8b5ea000 C:\WINDOWS\system32\mswsock.dll -0x00007ffb729c0000 - 0x00007ffb729d4000 C:\Program Files\Android\Android Studio1\jre\bin\nio.dll -0x00007ffb64870000 - 0x00007ffb64897000 C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64\native-platform.dll -0x00007ffb3f150000 - 0x00007ffb3f294000 C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64\native-platform-file-events.dll -0x00007ffb7f180000 - 0x00007ffb7f18a000 C:\Program Files\Android\Android Studio1\jre\bin\management.dll -0x00007ffb7c200000 - 0x00007ffb7c20d000 C:\Program Files\Android\Android Studio1\jre\bin\management_ext.dll -0x00007ffb8b780000 - 0x00007ffb8b798000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll -0x00007ffb8aea0000 - 0x00007ffb8aed4000 C:\WINDOWS\system32\rsaenh.dll -0x00007ffb8c510000 - 0x00007ffb8c537000 C:\WINDOWS\System32\bcrypt.dll -0x00007ffb8bd70000 - 0x00007ffb8bd9e000 C:\WINDOWS\SYSTEM32\USERENV.dll -0x00007ffb8b770000 - 0x00007ffb8b77c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll -0x00007ffb8b270000 - 0x00007ffb8b2ac000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL -0x00007ffb8e5a0000 - 0x00007ffb8e5a8000 C:\WINDOWS\System32\NSI.dll -0x00007ffb7dfb0000 - 0x00007ffb7dfc7000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL -0x00007ffb7e4f0000 - 0x00007ffb7e50d000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL -0x00007ffb8b2b0000 - 0x00007ffb8b37a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll -0x00007ffb72570000 - 0x00007ffb72587000 C:\WINDOWS\system32\napinsp.dll -0x00007ffb72550000 - 0x00007ffb7256b000 C:\WINDOWS\system32\pnrpnsp.dll -0x00007ffb863a0000 - 0x00007ffb863b5000 C:\WINDOWS\system32\wshbth.dll -0x00007ffb874f0000 - 0x00007ffb8750d000 C:\WINDOWS\system32\NLAapi.dll -0x00007ffb72530000 - 0x00007ffb72542000 C:\WINDOWS\System32\winrnr.dll -0x00007ffb828b0000 - 0x00007ffb828ba000 C:\Windows\System32\rasadhlp.dll -0x00007ffb7b200000 - 0x00007ffb7b282000 C:\WINDOWS\System32\fwpuclnt.dll -0x00007ffb7f1a0000 - 0x00007ffb7f1c7000 C:\Program Files\Android\Android Studio1\jre\bin\sunec.dll - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio1\jre\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Android\Android Studio1\jre\bin\server;C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64;C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64 - -VM Arguments: -jvm_args: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant -java_command: org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 -java_class_path (initial): C:\Users\USER\.gradle\wrapper\dists\gradle-8.0.2-bin\25jlreiuz6u3xu2phlpa2vv4m\gradle-8.0.2\lib\gradle-launcher-8.0.2.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 2 {product} {ergonomic} - uint ConcGCThreads = 1 {product} {ergonomic} - uint G1ConcRefinementThreads = 2 {product} {ergonomic} - size_t G1HeapRegionSize = 1048576 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 58720256 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 2147483648 {product} {command line} - size_t MaxNewSize = 1287651328 {product} {ergonomic} - size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5825164 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - bool UseCompressedClassPointers = true {lp64_product} {ergonomic} - bool UseCompressedOops = true {lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags - #1: stderr all=off uptime,level,tags - -Environment Variables: -PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\USER\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3\bin;;C:\Users\USER\Programming\Maven\apache-maven-3.6.3\bin;C:\Users\USER\.dotnet\tools;C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USER\Programming\effective_android\flutter\bin; -USERNAME=USER -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD - - - ---------------- S Y S T E M --------------- - -OS: Windows 10 , 64 bit Build 19041 (10.0.19041.3031) -OS uptime: 6 days 20:35 hours - -CPU:total 2 (initial active 2) (2 cores per cpu, 1 threads per core) family 21 model 112 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1, bmi2, fma - -Memory: 4k page, system-wide physical 3471M (45M free) -TotalPageFile size 14223M (AvailPageFile size 4M) -current process WorkingSet (physical memory assigned to process): 250M, peak: 323M -current process commit charge ("private bytes"): 537M, peak: 538M - -vm_info: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866) for windows-amd64 JRE (11.0.13+0-b1751.21-8125866), built on Feb 2 2022 03:00:22 by "builder" with MS VC++ 14.0 (VS2015) - -END. -- GitLab From ee59ac04e5eeb808351f6ca21e13c2611f169b87 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:41:46 +0600 Subject: [PATCH 27/63] [Feature] Add free negotiations screen --- assets/person.svg | 4 + .../FreeNegotiationsComponent.kt | 12 ++ .../FreeNegotiationsScreen.kt | 141 ++++++++++++++++++ .../free_negotiations/components/RoomCard.kt | 86 +++++++++++ .../components/Room\320\241haracteristics.kt" | 36 +++++ .../ui/free_negotiations/models/RoomItem.kt | 13 ++ .../office/elevator/ui/main/MainComponent.kt | 7 +- .../office/elevator/ui/main/MainScreen.kt | 3 + 8 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 assets/person.svg create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt create mode 100644 "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt diff --git a/assets/person.svg b/assets/person.svg new file mode 100644 index 00000000..89371094 --- /dev/null +++ b/assets/person.svg @@ -0,0 +1,4 @@ + + + + diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt new file mode 100644 index 00000000..da14e870 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt @@ -0,0 +1,12 @@ +package band.effective.office.elevator.ui.free_negotiations + +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.mvikotlin.core.store.StoreFactory + + +class FreeNegotiationsComponent( + componentContext: ComponentContext, + storeFactory: StoreFactory +) : + ComponentContext by componentContext { +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt new file mode 100644 index 00000000..35a202c6 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt @@ -0,0 +1,141 @@ +package band.effective.office.elevator.ui.free_negotiations + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.Text +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.Person +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.elevator.ui.free_negotiations.components.RoomCard +import band.effective.office.elevator.ui.free_negotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.free_negotiations.models.RoomItem + + +@Composable +fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { + FreeNegotiationsContent(date = "5 июля", timeStart = "17:49", timeEnd = "19:00", onClick = {}) + +} + +@OptIn(ExperimentalLayoutApi::class) +@Composable +internal fun FreeNegotiationsContent( + date: String?, + timeStart: String?, + timeEnd: String?, + onClick: () -> Unit +) { + val rooms: List = listOf( + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + ) + + Column( + modifier = Modifier + .fillMaxSize() + .background(Color(0XFF1E1C1A)) + .verticalScroll( + rememberScrollState() + ) + ) { + Row( + modifier = Modifier + .fillMaxWidth() + .height(100.dp) + .background(Color(0xFFF252322)), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Spacer(modifier = Modifier.height(60.dp)) + IconButton(onClick = { onClick() }) { + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + Icons.Filled.ArrowBack, + contentDescription = null, + tint = Color(0xFFFA362F8) + ) + } + } + Spacer(modifier = Modifier.width(4.dp)) + Text( + text = "Занять $date с $timeStart до $timeEnd", + style = TextStyle( + color = Color(0xFFFA362F8), + fontSize = 20.sp + ) + ) + } + FlowRow(modifier = Modifier.padding(24.dp)) { + for (room in rooms) { + RoomCard( + roomItem = room, + onClick = {}, + modifier = Modifier.fillMaxWidth(0.3F) + ) + Spacer(modifier = Modifier.width(24.dp)) + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt new file mode 100644 index 00000000..fe82f81a --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt @@ -0,0 +1,86 @@ +package band.effective.office.elevator.ui.free_negotiations.components + +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.elevator.ui.free_negotiations.models.RoomItem + +@OptIn(ExperimentalLayoutApi::class) +@Composable +fun RoomCard( + roomItem: RoomItem, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + Column(modifier = modifier) { + Card( + modifier = Modifier + .fillMaxWidth().height(288.dp), + shape = RoundedCornerShape(16.dp), + backgroundColor = Color(0xFFF3A3736) + ) { + Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { + Text( + text = roomItem.name, + style = TextStyle( + color = Color.White, + fontSize = 48.sp + ) + ) + Spacer(modifier = Modifier.height(28.dp)) + FlowRow( + horizontalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.padding(horizontal = 32.dp, vertical = 28.dp), + maxItemsInEachRow = 2 + ) { + for (stuff in roomItem.stuff) { + RoomCharacteristics( + icon = stuff.icon, + text = stuff.text + ) + } + } + Spacer(modifier = Modifier.height(50.dp)) + } + } + Spacer(modifier = Modifier.height(16.dp)) + Button( + onClick = { onClick() }, + modifier = Modifier + .border(2.dp, shape = RoundedCornerShape(40.dp), color = Color(0xFFFEF7234)) + .fillMaxWidth(), + shape = RoundedCornerShape(40.dp), + colors = ButtonDefaults.buttonColors( + backgroundColor = Color( + 0xFFFF1E1C1A + ) + ) + ) { + Text( + text = "Занять ${roomItem.name}", + style = TextStyle( + color = Color(0xFFFEF7234), + fontSize = 18.sp + ) + ) + } + Spacer(modifier = Modifier.height(16.dp)) + } +} \ No newline at end of file diff --git "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" "b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" new file mode 100644 index 00000000..1baedbf2 --- /dev/null +++ "b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" @@ -0,0 +1,36 @@ +package band.effective.office.elevator.ui.free_negotiations.components + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.material.Icon +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun RoomCharacteristics(icon: ImageVector, text: String) { + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + imageVector = icon, + contentDescription = null, + tint = Color.White, + modifier = Modifier.size(30.dp) + ) + Spacer(modifier = Modifier.width(8.dp)) + Text( + text = text, + style = TextStyle( + color = Color.White, + fontSize = 16.sp + ) + ) + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt new file mode 100644 index 00000000..fb9128eb --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt @@ -0,0 +1,13 @@ +package band.effective.office.elevator.ui.free_negotiations.models + +import androidx.compose.ui.graphics.vector.ImageVector + +class RoomItem( + val name: String, + val stuff: List +) + +class RoomCharacteristicsItem( + val icon: ImageVector, + val text: String +) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt index 491dd20e..86822ffc 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt @@ -1,6 +1,7 @@ package band.effective.office.elevator.ui.main import band.effective.office.elevator.ui.elevator.ElevatorComponent +import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsComponent import band.effective.office.elevator.ui.profile.ProfileComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.ChildStack @@ -22,7 +23,7 @@ class MainComponent( private val navigation = StackNavigation() private val stack = childStack( source = navigation, - initialStack = { listOf(Config.Elevator) }, + initialStack = { listOf(Config.FreeNegotiations) }, childFactory = ::child, ) val childStack: Value> = stack @@ -36,6 +37,7 @@ class MainComponent( ::profileOutput ) ) + is Config.FreeNegotiations -> Child.FreeNegotiations(FreeNegotiationsComponent(componentContext, storeFactory)) } fun onOutput(output: Output) { @@ -54,6 +56,7 @@ class MainComponent( sealed class Child { class Elevator(val component: ElevatorComponent) : Child() class Profile(val component: ProfileComponent) : Child() + class FreeNegotiations(val component: FreeNegotiationsComponent) : Child() } private sealed interface Config : Parcelable { @@ -62,6 +65,8 @@ class MainComponent( @Parcelize object Profile : Config + @Parcelize + object FreeNegotiations : Config } sealed class Output { diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt index 33e32eff..f41a0596 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt @@ -13,6 +13,7 @@ import band.effective.office.elevator.components.TabNavigationItem import band.effective.office.elevator.navigation.ElevatorTab import band.effective.office.elevator.navigation.ProfileTab import band.effective.office.elevator.ui.elevator.ElevatorScreen +import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsScreen import band.effective.office.elevator.ui.profile.ProfileScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.Direction @@ -39,6 +40,7 @@ fun MainScreen(component: MainComponent) { when (val child = it.instance) { is MainComponent.Child.Elevator -> ElevatorScreen(child.component) is MainComponent.Child.Profile -> ProfileScreen(child.component) + is MainComponent.Child.FreeNegotiations -> FreeNegotiationsScreen(child.component) } } } @@ -69,6 +71,7 @@ private val MainComponent.Child.index: Int when (this) { is MainComponent.Child.Elevator -> 0 is MainComponent.Child.Profile -> 1 + is MainComponent.Child.FreeNegotiations -> 2 } @Composable -- GitLab From 19efabd2c30bcc1f45d997ec5c95df9fe8108c61 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:43:37 +0600 Subject: [PATCH 28/63] [Feature] Add free negotiations screen --- .../FreeNegotiationsComponent.kt | 12 ---- .../office/elevator/ui/main/MainComponent.kt | 7 +- .../office/elevator/ui/main/MainScreen.kt | 3 - .../FreeNegotiationsComponent.kt | 61 +++++++++++++++++ .../FreeNegotiationsScreen.kt | 68 ++++--------------- .../components/RoomCard.kt | 4 +- .../components/Room\320\241haracteristics.kt" | 2 +- .../models/RoomItem.kt | 2 +- 8 files changed, 80 insertions(+), 79 deletions(-) delete mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/FreeNegotiationsScreen.kt (62%) rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/components/RoomCard.kt (95%) rename "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" => "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" (93%) rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/models/RoomItem.kt (76%) diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt deleted file mode 100644 index da14e870..00000000 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt +++ /dev/null @@ -1,12 +0,0 @@ -package band.effective.office.elevator.ui.free_negotiations - -import com.arkivanov.decompose.ComponentContext -import com.arkivanov.mvikotlin.core.store.StoreFactory - - -class FreeNegotiationsComponent( - componentContext: ComponentContext, - storeFactory: StoreFactory -) : - ComponentContext by componentContext { -} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt index 86822ffc..491dd20e 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt @@ -1,7 +1,6 @@ package band.effective.office.elevator.ui.main import band.effective.office.elevator.ui.elevator.ElevatorComponent -import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsComponent import band.effective.office.elevator.ui.profile.ProfileComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.ChildStack @@ -23,7 +22,7 @@ class MainComponent( private val navigation = StackNavigation() private val stack = childStack( source = navigation, - initialStack = { listOf(Config.FreeNegotiations) }, + initialStack = { listOf(Config.Elevator) }, childFactory = ::child, ) val childStack: Value> = stack @@ -37,7 +36,6 @@ class MainComponent( ::profileOutput ) ) - is Config.FreeNegotiations -> Child.FreeNegotiations(FreeNegotiationsComponent(componentContext, storeFactory)) } fun onOutput(output: Output) { @@ -56,7 +54,6 @@ class MainComponent( sealed class Child { class Elevator(val component: ElevatorComponent) : Child() class Profile(val component: ProfileComponent) : Child() - class FreeNegotiations(val component: FreeNegotiationsComponent) : Child() } private sealed interface Config : Parcelable { @@ -65,8 +62,6 @@ class MainComponent( @Parcelize object Profile : Config - @Parcelize - object FreeNegotiations : Config } sealed class Output { diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt index f41a0596..33e32eff 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt @@ -13,7 +13,6 @@ import band.effective.office.elevator.components.TabNavigationItem import band.effective.office.elevator.navigation.ElevatorTab import band.effective.office.elevator.navigation.ProfileTab import band.effective.office.elevator.ui.elevator.ElevatorScreen -import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsScreen import band.effective.office.elevator.ui.profile.ProfileScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.Direction @@ -40,7 +39,6 @@ fun MainScreen(component: MainComponent) { when (val child = it.instance) { is MainComponent.Child.Elevator -> ElevatorScreen(child.component) is MainComponent.Child.Profile -> ProfileScreen(child.component) - is MainComponent.Child.FreeNegotiations -> FreeNegotiationsScreen(child.component) } } } @@ -71,7 +69,6 @@ private val MainComponent.Child.index: Int when (this) { is MainComponent.Child.Elevator -> 0 is MainComponent.Child.Profile -> 1 - is MainComponent.Child.FreeNegotiations -> 2 } @Composable diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt new file mode 100644 index 00000000..ec82b835 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt @@ -0,0 +1,61 @@ +package band.effective.office.elevator.ui.freeNegotiations + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Person +import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.mvikotlin.core.store.StoreFactory + + +class FreeNegotiationsComponent( + componentContext: ComponentContext, + storeFactory: StoreFactory +) : ComponentContext by componentContext { + val rooms: List = listOf( + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + ) + +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt similarity index 62% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 35a202c6..1451f995 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations +package band.effective.office.elevator.ui.freeNegotiations import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -27,15 +27,20 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.free_negotiations.components.RoomCard -import band.effective.office.elevator.ui.free_negotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.free_negotiations.models.RoomItem +import band.effective.office.elevator.ui.freeNegotiations.components.RoomCard +import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem @Composable fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { - FreeNegotiationsContent(date = "5 июля", timeStart = "17:49", timeEnd = "19:00", onClick = {}) - + FreeNegotiationsContent( + date = "5 июля", + timeStart = "17:49", + timeEnd = "19:00", + onClick = {}, + component = component, + ) } @OptIn(ExperimentalLayoutApi::class) @@ -44,54 +49,9 @@ internal fun FreeNegotiationsContent( date: String?, timeStart: String?, timeEnd: String?, - onClick: () -> Unit + onClick: () -> Unit, + component: FreeNegotiationsComponent ) { - val rooms: List = listOf( - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - ) - Column( modifier = Modifier .fillMaxSize() @@ -128,7 +88,7 @@ internal fun FreeNegotiationsContent( ) } FlowRow(modifier = Modifier.padding(24.dp)) { - for (room in rooms) { + for (room in component.rooms) { RoomCard( roomItem = room, onClick = {}, diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt similarity index 95% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index fe82f81a..db9cdebb 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.components +package band.effective.office.elevator.ui.freeNegotiations.components import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement @@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.free_negotiations.models.RoomItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem @OptIn(ExperimentalLayoutApi::class) @Composable diff --git "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" similarity index 93% rename from "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" rename to "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index 1baedbf2..cce06584 100644 --- "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.components +package band.effective.office.elevator.ui.freeNegotiations.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt similarity index 76% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt index fb9128eb..277858fb 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.models +package band.effective.office.elevator.ui.freeNegotiations.models import androidx.compose.ui.graphics.vector.ImageVector -- GitLab From 5460be2f365ef39505475882027eecdd2c679bab Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:45:40 +0600 Subject: [PATCH 29/63] [~] fix package name --- .../FreeNegotiationsComponent.kt | 10 ++++------ .../freeNegotiationsScreen/FreeNegotiationsScreen.kt | 7 ++----- .../ui/freeNegotiationsScreen/components/RoomCard.kt | 4 ++-- .../components/Room\320\241haracteristics.kt" | 2 +- .../ui/freeNegotiationsScreen/models/RoomItem.kt | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt index ec82b835..70b6caf5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt @@ -1,16 +1,14 @@ -package band.effective.office.elevator.ui.freeNegotiations +package band.effective.office.tablet.ui.freeNegotiationsScreen import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Person -import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomCharacteristicsItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem import com.arkivanov.decompose.ComponentContext -import com.arkivanov.mvikotlin.core.store.StoreFactory class FreeNegotiationsComponent( - componentContext: ComponentContext, - storeFactory: StoreFactory + componentContext: ComponentContext ) : ComponentContext by componentContext { val rooms: List = listOf( RoomItem( diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 1451f995..19d8bc10 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations +package band.effective.office.tablet.ui.freeNegotiationsScreen import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -19,7 +19,6 @@ import androidx.compose.material.IconButton import androidx.compose.material.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack -import androidx.compose.material.icons.filled.Person import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -27,9 +26,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.freeNegotiations.components.RoomCard -import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.components.RoomCard @Composable diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index db9cdebb..f5b83a4f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.components +package band.effective.office.tablet.ui.freeNegotiationsScreen.components import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement @@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem @OptIn(ExperimentalLayoutApi::class) @Composable diff --git "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index cce06584..a175a241 100644 --- "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.components +package band.effective.office.tablet.ui.freeNegotiationsScreen.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt index 277858fb..e4e650c1 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.models +package band.effective.office.tablet.ui.freeNegotiationsScreen.models import androidx.compose.ui.graphics.vector.ImageVector -- GitLab From eb750f025afbb5ceeff2096764a75cd0fc113990 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:50:51 +0600 Subject: [PATCH 30/63] [~] add switch on FreeNegotiationsScreen --- .../kotlin/band/effective/office/tablet/ui/root/Root.kt | 3 ++- .../band/effective/office/tablet/ui/root/RootComponent.kt | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index 0e0fbed1..d8d20b5f 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.root import androidx.compose.runtime.Composable +import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen import band.effective.office.tablet.ui.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import tablet.ui.selectRoomScreen.SelectRoomScreen @@ -12,7 +13,7 @@ fun Root(component: RootComponent) { ) { child -> when (val instance = child.instance) { is RootComponent.Child.MainChild -> MainScreen(instance.component) - is RootComponent.Child.SelectRoomChild -> SelectRoomScreen(instance.component) + is RootComponent.Child.SelectRoomChild -> FreeNegotiationsScreen(instance.component) } } } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index b628bde0..7321ebe0 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.root +import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsComponent import band.effective.office.tablet.ui.mainScreen.RealMainComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.StackNavigation @@ -35,12 +36,12 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co } is Config.SelectRoom -> { - Child.SelectRoomChild(SelectRoomComponent(componentContext)) + Child.SelectRoomChild(FreeNegotiationsComponent(componentContext)) } } sealed class Child { - data class SelectRoomChild(val component: SelectRoomComponent) : Child() + data class SelectRoomChild(val component: FreeNegotiationsComponent) : Child() data class MainChild(val component: RealMainComponent) : Child() } -- GitLab From baad3092e68b2d4273ba07dbf81769a8b04fd6b8 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:58:46 +0600 Subject: [PATCH 31/63] [~] move new code in separate package --- settings.gradle.kts | 3 +- tabletApp/build.gradle.kts | 2 ++ .../freeNegotiationsScreen/build.gradle.kts | 34 +++++++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 +++ .../FreeNegotiationsComponent.kt | 0 .../FreeNegotiationsScreen.kt | 0 .../components/RoomCard.kt | 0 .../components/Room\320\241haracteristics.kt" | 0 .../freeNegotiationsScreen/models/RoomItem.kt | 0 9 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tabletApp/features/freeNegotiationsScreen/build.gradle.kts create mode 100644 tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt (100%) rename "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" => "tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt (100%) diff --git a/settings.gradle.kts b/settings.gradle.kts index 70289411..759ebb62 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,4 +5,5 @@ include("common") include("composeApp") include(":tabletApp") include(":tabletApp:features:selectRoom") -include(":tabletApp:features:roomInfo") \ No newline at end of file +include(":tabletApp:features:roomInfo") +include(":tabletApp:features:freeNegotiationsScreen") \ No newline at end of file diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index b2017966..497d9eb8 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -53,6 +53,8 @@ kotlin { implementation(project(":tabletApp:features:selectRoom")) implementation(project(":tabletApp:features:roomInfo")) + implementation(project(":tabletApp:features:freeNegotiationsScreen")) + } } val androidMain by getting { diff --git a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts new file mode 100644 index 00000000..f3da50b5 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) + id(Plugins.Parcelize.plugin) +} + +android { + compileSdk = 33 +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + + // Decompose + implementation(Dependencies.Decompose.decompose) + implementation(Dependencies.Decompose.extensions) + } + } + } +} diff --git a/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml b/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..c5c2a6c3 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt diff --git "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" similarity index 100% rename from "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" rename to "tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt -- GitLab From bf693662e3615525b279eab68279506033e96de4 Mon Sep 17 00:00:00 2001 From: Margarita Date: Fri, 7 Jul 2023 13:37:55 +0600 Subject: [PATCH 32/63] [+] libres, modal window layout without close logic and successstate --- tabletApp/build.gradle.kts | 3 + .../features/selectRoom/build.gradle.kts | 17 +++ .../ui/selectRoomScreen/SelectRoomScreen.kt | 102 +++++++++++++++++- .../uiComponents/BookingButtonView.kt | 45 ++++++++ .../uiComponents/DateTimeView.kt | 69 ++++++++++++ .../uiComponents/LengthEventView.kt | 48 +++++++++ .../uiComponents/OrganizerEventView.kt | 34 ++++++ .../uiComponents/TitleFieldView.kt | 29 +++++ .../commonMain/libres/strings/strings_ru.xml | 9 ++ .../src/main/res/drawable/cross.xml | 4 + 10 files changed, 359 insertions(+), 1 deletion(-) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml create mode 100644 tabletApp/features/selectRoom/src/main/res/drawable/cross.xml diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index deb3bd59..5da9ed73 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -47,6 +47,9 @@ kotlin { implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + //Libres + implementation(Dependencies.Libres.libresCompose) + implementation(project(":tabletApp:features:selectRoom")) implementation(project(":tabletApp:features:roomInfo")) } diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index 1815ff28..3f2d3d1c 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -3,10 +3,15 @@ plugins { id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) id(Plugins.Parcelize.plugin) + id(Plugins.Libres.plugin) } android { compileSdk = 33 + sourceSets["main"].apply { + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } } kotlin { @@ -32,6 +37,9 @@ kotlin { //Koin api(Dependencies.Koin.core) + + //Libres + implementation(Dependencies.Libres.libresCompose) } } @@ -43,4 +51,13 @@ kotlin { } } + libres { + // https://github.com/Skeptick/libres#setup + generatedClassName = "MainRes" // "Res" by default + generateNamedArguments = true // false by default + baseLocaleLanguageCode = "ru" // "en" by default + camelCaseNamesForAppleFramework = true // false by default + + } + } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index 2daab3df..3e3e811b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,9 +1,37 @@ package tablet.ui.selectRoomScreen +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun SelectRoomScreen(component: RealSelectRoomComponent){ @@ -31,5 +59,77 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ fun SelectRoomView( component: RealSelectRoomComponent ){ - Text(text = component.booking.nameRoom) + val modifier = Modifier.background(Color(0xFF3A3736)) + val shape = RoundedCornerShape(16) + + + Dialog( + onDismissRequest = {} + ) + { + Box( + modifier = Modifier + .size(575.dp, 510.dp) + .clip(RoundedCornerShape(5)) + .background(Color(0xFF302D2C)), + contentAlignment = Alignment.Center + ) { + Column{ + Text( + modifier = Modifier.width(415.dp), + text = "Занять ${component.booking.nameRoom}?", + fontSize = 28.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center + ) + Spacer(modifier = Modifier.height(24.dp)) + TitleFieldView( + modifier = Modifier.width(415.dp), + title = "когда" + ) + Spacer(modifier = Modifier.height(16.dp)) + DateTimeView( + modifier = modifier.height(64.dp).width(415.dp), + shape = shape, + booking = component.booking + ) + Spacer(modifier = Modifier.height(24.dp)) + Row { + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(156.dp), + title = "на сколько" + ) + LengthEventView( + modifier = modifier.height(64.dp).width(156.dp), + shape = shape, + booking = component.booking + ) + } + Spacer(modifier = Modifier.width(16.dp)) + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(243.dp), + title = "организатор" + ) + OrganizerEventView( + modifier = modifier.height(64.dp).width(243.dp), + shape = shape, + booking = component.booking + ) + } + } + Spacer(modifier = Modifier.height(40.dp)) + BookingButtonView( + modifier = Modifier.height(64.dp).width(415.dp), + color = Color(0xFFEF7234), + shape = RoundedCornerShape(40), + booking = component.booking + ) + } + } + } + } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt new file mode 100644 index 00000000..31a2344e --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -0,0 +1,45 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking + +@Composable +fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { + val isPressed = remember { mutableStateOf(false) } + val colorButton = if(isPressed.value) Color(0xFFED6521) else color + + Button( + modifier = modifier, + colors = ButtonDefaults.buttonColors(colorButton), + shape = shape, + onClick = { isPressed.value = !isPressed.value} + ) { + Box(contentAlignment = Alignment.Center) + { + Text( + text = "Занять с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + fontSize = 20.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt new file mode 100644 index 00000000..fd2a29a3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -0,0 +1,69 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.LineHeightStyle +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Locale + +@Composable +fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736) + ) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center + ) { + Row { + Text( + text = booking.eventInfo.startTime.date(), + fontSize = 20.sp, + fontWeight = FontWeight(700), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFA362F8) + ) + + Spacer(modifier = Modifier.width(5.dp)) + + Text( + text = "с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + fontSize = 20.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } + + } +} + +private fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + + SimpleDateFormat("MMMM", Locale("ru")).format(this.time) + +fun Calendar.time24() = SimpleDateFormat( + "HH:mm", + Locale("ru") +).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt new file mode 100644 index 00000000..589b774f --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -0,0 +1,48 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking +import java.util.Calendar + +@Composable +fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + + val hours = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) / 60 + val minutes = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) % 60 + val lengthEvent: String = when(hours){ + 0 -> "$minutes мин" + else -> "${hours}ч ${minutes}мин" + } + + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736) + ) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center + ) { + Text( + text = lengthEvent, + fontSize = 20.sp, + fontWeight = FontWeight(700), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} + +private fun getLengthEvent(start: Calendar, finish: Calendar) = + finish.get(Calendar.MINUTE) - start.get(Calendar.MINUTE) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt new file mode 100644 index 00000000..4a317e25 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -0,0 +1,34 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking + +@Composable +fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736)) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center) { + Text( + text = booking.eventInfo.organizer, + fontWeight = FontWeight(700), + fontSize = 20.sp, + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt new file mode 100644 index 00000000..af465560 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun TitleFieldView(modifier: Modifier, title: String) { + Box( + modifier = modifier.padding(0.dp), + contentAlignment = Alignment.CenterStart + ) { + Text( + text = title, + fontSize = 16.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFF808080) + ) + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml new file mode 100644 index 00000000..a5e70883 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml @@ -0,0 +1,9 @@ + + + Занять c ${startTime} до ${finishTime} + с ${startTime} до ${finishTime} + Занять ${nameRoom}? + когда + на сколько + организатор + \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml new file mode 100644 index 00000000..336fd8bb --- /dev/null +++ b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml @@ -0,0 +1,4 @@ + + + -- GitLab From f60b2963a1465d61b21fd53e9d6156bc7c9b0afc Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Sun, 9 Jul 2023 17:15:12 +0600 Subject: [PATCH 33/63] [+] add network and domain module --- settings.gradle.kts | 4 +- tabletApp/features/domain/build.gradle.kts | 42 +++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 ++ .../office/tablet/di/DomainModule.kt | 32 ++++++++++++ .../tablet/domain/CurrentEventController.kt | 48 +++++++++++++++++ .../domain/CurrentEventControllerImpl.kt | 28 ++++++++++ .../CurrentEventControllerServerImpl.kt | 14 +++++ .../office/tablet/domain/MockController.kt | 16 ++++++ .../office/tablet/domain/model/EventInfo.kt | 18 +++++++ .../office/tablet/domain/model/RoomInfo.kt | 23 +++++++++ .../tablet/domain/useCase/BookingUseCase.kt | 7 +++ .../domain/useCase/CheckBookingUseCase.kt | 24 +++++++++ .../domain/useCase/OrganizersInfoUseCase.kt | 7 +++ .../tablet/domain/useCase/RoomInfoUseCase.kt | 7 +++ .../tablet/domain/useCase/UpdateUseCase.kt | 51 +++++++++++++++++++ tabletApp/features/network/build.gradle.kts | 42 +++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 ++ .../office/tablet/di/NetworkModule.kt | 7 +++ .../office/tablet/network/api/Api.kt | 14 +++++ .../office/tablet/network/api/WorkApi.kt | 41 +++++++++++++++ .../tablet/network/model/WebServerEvent.kt | 6 +++ .../network/repository/BookingReposutory.kt | 5 ++ .../network/repository/CancelRepository.kt | 5 ++ .../network/repository/OrganizerRepository.kt | 5 ++ .../network/repository/RoomRepository.kt | 7 +++ .../repository/ServerUpdateRepository.kt | 11 ++++ .../repository/impl/BookingRepositoryImpl.kt | 8 +++ .../repository/impl/CancelRepositoryImpl.kt | 8 +++ .../impl/OrganizerRepositoryImpl.kt | 8 +++ .../repository/impl/RoomRepositoryImpl.kt | 9 ++++ .../impl/ServerUpdateRepositoryImpl.kt | 21 ++++++++ 31 files changed, 525 insertions(+), 1 deletion(-) create mode 100644 tabletApp/features/domain/build.gradle.kts create mode 100644 tabletApp/features/domain/src/androidMain/AndroidManifest.xml create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerImpl.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/BookingUseCase.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/OrganizersInfoUseCase.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/RoomInfoUseCase.kt create mode 100644 tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt create mode 100644 tabletApp/features/network/build.gradle.kts create mode 100644 tabletApp/features/network/src/androidMain/AndroidManifest.xml create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/model/WebServerEvent.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/BookingReposutory.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/CancelRepository.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/OrganizerRepository.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/RoomRepository.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/ServerUpdateRepository.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/BookingRepositoryImpl.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/CancelRepositoryImpl.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/OrganizerRepositoryImpl.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/RoomRepositoryImpl.kt create mode 100644 tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index 70289411..667173e0 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -5,4 +5,6 @@ include("common") include("composeApp") include(":tabletApp") include(":tabletApp:features:selectRoom") -include(":tabletApp:features:roomInfo") \ No newline at end of file +include(":tabletApp:features:roomInfo") +include(":tabletApp:features:network") +include(":tabletApp:features:domain") \ No newline at end of file diff --git a/tabletApp/features/domain/build.gradle.kts b/tabletApp/features/domain/build.gradle.kts new file mode 100644 index 00000000..4ff3725c --- /dev/null +++ b/tabletApp/features/domain/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) +} + + +android { + compileSdk = 33 + sourceSets["main"].apply { + manifest.srcFile("src/androidMain/AndroidManifest.xml") + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + // Koin + api(Dependencies.Koin.core) + + implementation(project(":tabletApp:features:network")) + } + } + val androidMain by getting { + dependencies{ + // Koin + api(Dependencies.Koin.android) + } + } + } +} diff --git a/tabletApp/features/domain/src/androidMain/AndroidManifest.xml b/tabletApp/features/domain/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..c428412f --- /dev/null +++ b/tabletApp/features/domain/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt new file mode 100644 index 00000000..c6245d1c --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt @@ -0,0 +1,32 @@ +package band.effective.office.tablet.di + +import band.effective.office.tablet.domain.CurrentEventController +import band.effective.office.tablet.domain.CurrentEventControllerServerImpl +import band.effective.office.tablet.domain.useCase.BookingUseCase +import band.effective.office.tablet.domain.useCase.OrganizersInfoUseCase +import band.effective.office.tablet.domain.useCase.RoomInfoUseCase +import band.effective.office.tablet.network.repository.BookingRepository +import band.effective.office.tablet.network.repository.CancelRepository +import band.effective.office.tablet.network.repository.OrganizerRepository +import band.effective.office.tablet.network.repository.RoomRepository +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import band.effective.office.tablet.network.repository.impl.BookingRepositoryImpl +import band.effective.office.tablet.network.repository.impl.CancelRepositoryImpl +import band.effective.office.tablet.network.repository.impl.OrganizerRepositoryImpl +import band.effective.office.tablet.network.repository.impl.RoomRepositoryImpl +import band.effective.office.tablet.network.repository.impl.ServerUpdateRepositoryImpl +import org.koin.dsl.module + +val domainModule = module { + single { RoomRepositoryImpl(get()) } + single { OrganizerRepositoryImpl(get()) } + single { CancelRepositoryImpl(get()) } + single { BookingRepositoryImpl(get()) } + single { ServerUpdateRepositoryImpl(get()) } + + single { RoomInfoUseCase(get()) } + single { OrganizersInfoUseCase(get()) } + single { BookingUseCase(get()) } + single { CurrentEventControllerServerImpl(get(), get(), get()) } + //single { UpdateUseCase(get(), get(), get(), get()) } +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt new file mode 100644 index 00000000..c27a6f59 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt @@ -0,0 +1,48 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.useCase.RoomInfoUseCase +import band.effective.office.tablet.network.repository.CancelRepository +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Job +import kotlinx.coroutines.launch + +abstract class CurrentEventController( + private val roomUseCase: RoomInfoUseCase, + private val serverUpdateRepository: ServerUpdateRepository, + private val cancelRepository: CancelRepository +) { + private lateinit var job: Job + protected lateinit var scope: CoroutineScope + protected var currentEvent: EventInfo? = null + protected val handlersList: MutableList<() -> Unit> = mutableListOf() + + fun start(scope: CoroutineScope) { + this.scope = scope + job = update() + scope.launch { serverUpdateRepository.subscribeOnUpdates(scope, { onServerUpdate() }, {}) } + } + + private fun cancelCurrentEvent() { + scope.launch { + if (cancelRepository.cancelEvent()) { + onServerUpdate() + } + } + } + + private fun onServerUpdate() { + scope.launch { + job.cancel() + currentEvent = roomUseCase().currentEvent + job = update() + } + } + + fun subscribe(onEvent: () -> Unit) { + handlersList.add(onEvent) + } + + protected abstract fun update(): Job +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerImpl.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerImpl.kt new file mode 100644 index 00000000..904eea29 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerImpl.kt @@ -0,0 +1,28 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.useCase.RoomInfoUseCase +import band.effective.office.tablet.network.repository.CancelRepository +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import kotlinx.coroutines.delay +import kotlinx.coroutines.launch +import java.util.GregorianCalendar + +class CurrentEventControllerImpl( + private val roomUseCase: RoomInfoUseCase, + private val serverUpdateRepository: ServerUpdateRepository, + private val cancelRepository: CancelRepository +) : CurrentEventController(roomUseCase, serverUpdateRepository, cancelRepository) { + override fun update() = scope.launch { + while (true) { + val roomInfo = roomUseCase() + val nextEventTime = + roomInfo.currentEvent?.finishTime ?: roomInfo.eventList.firstOrNull()?.startTime + if (nextEventTime != null) { + val timeToUpdate = nextEventTime.time.time - GregorianCalendar().time.time + delay(timeToUpdate) + currentEvent = roomUseCase().currentEvent + handlersList.forEach { it() } + } + } + } +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt new file mode 100644 index 00000000..371dfa2a --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt @@ -0,0 +1,14 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.useCase.RoomInfoUseCase +import band.effective.office.tablet.network.repository.CancelRepository +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import kotlinx.coroutines.launch + +class CurrentEventControllerServerImpl( + private val roomUseCase: RoomInfoUseCase, + private val serverUpdateRepository: ServerUpdateRepository, + private val cancelRepository: CancelRepository +) : CurrentEventController(roomUseCase, serverUpdateRepository, cancelRepository) { + override fun update() = scope.launch {} +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt new file mode 100644 index 00000000..daef944f --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -0,0 +1,16 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.network.api.WorkApi +import kotlinx.coroutines.flow.update + +class MockController( + val workApi: WorkApi, + /*var isBusy: Boolean = false, + var isManyEvent: Boolean = false, + var isHaveTV: Boolean = false, + var isBusyTime: Boolean = false*/ +){ + fun changeBusy(newValue: Boolean){ + + } +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..888fea56 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -0,0 +1,18 @@ +package band.effective.office.tablet.domain.model + +import java.util.Calendar +import java.util.GregorianCalendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +){ + companion object{ + val emptyEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "" + ) + } +} diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt new file mode 100644 index 00000000..a9683647 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt @@ -0,0 +1,23 @@ +package band.effective.office.tablet.domain.model + +data class RoomInfo( + val name: String, + val capacity: Int, + val isHaveTv: Boolean, + val electricSocketCount: Int, + val eventList: List, + //NOTE(Maksim Mishenko): currentEvent is null if room is free + val currentEvent: EventInfo? +){ + companion object{ + val defaultValue = + RoomInfo( + name = "Default", + capacity = 0, + isHaveTv = false, + electricSocketCount = 0, + eventList = listOf(), + currentEvent = null + ) + } +} diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/BookingUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/BookingUseCase.kt new file mode 100644 index 00000000..43b3b887 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/BookingUseCase.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.domain.useCase + +import band.effective.office.tablet.network.repository.BookingRepository + +class BookingUseCase(private val repository: BookingRepository) { + suspend fun invoke() = repository.bookingRoom() +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt new file mode 100644 index 00000000..6e21e99c --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt @@ -0,0 +1,24 @@ +package band.effective.office.tablet.domain.useCase + +import band.effective.office.tablet.domain.model.EventInfo +import java.util.Calendar + +class CheckBookingUseCase(private val roomInfoUseCase: RoomInfoUseCase) { + suspend operator fun invoke(event: EventInfo): Boolean { + val roomInfo = roomInfoUseCase() + val eventsList: List = + if (roomInfo.currentEvent == null) roomInfo.eventList + else roomInfo.eventList + roomInfo.currentEvent + val predicate = startEventBelongList(event.startTime, eventsList) || startNewEventBelongList( event, eventsList ) + return !predicate + } + + private fun startNewEventBelongList(event: EventInfo, eventsList: List) = + eventsList.any { it.startTime.belong(event) } + + private fun startEventBelongList(calendar: Calendar, eventsList: List) = + eventsList.any { calendar.belong(it) } + + private fun Calendar.belong(event: EventInfo) = + this > event.startTime && this < event.finishTime +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/OrganizersInfoUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/OrganizersInfoUseCase.kt new file mode 100644 index 00000000..c8ad08be --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/OrganizersInfoUseCase.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.domain.useCase + +import band.effective.office.tablet.network.repository.OrganizerRepository + +class OrganizersInfoUseCase(private val repository: OrganizerRepository) { + suspend operator fun invoke() = repository.getOrganizersList() +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/RoomInfoUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/RoomInfoUseCase.kt new file mode 100644 index 00000000..9f423168 --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/RoomInfoUseCase.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.domain.useCase + +import band.effective.office.tablet.network.repository.RoomRepository + +class RoomInfoUseCase(private val repository: RoomRepository) { + suspend operator fun invoke() = repository.getRoomInfo() +} \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt new file mode 100644 index 00000000..9529645d --- /dev/null +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt @@ -0,0 +1,51 @@ +package band.effective.office.tablet.domain.useCase + +import band.effective.office.tablet.domain.CurrentEventController +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.launch + +class UpdateUseCase( + private val roomInfoUseCase: RoomInfoUseCase, + private val organizersInfoUseCase: OrganizersInfoUseCase, + private val currentEventController: CurrentEventController, + private val serverUpdateRepository: ServerUpdateRepository +) { + suspend fun invoke( + scope: CoroutineScope, + roomUpdateHandler: (RoomInfo) -> Unit, + organizerUpdateHandler: (List) -> Unit + ) { + serverUpdateRepository.subscribeOnUpdates(scope, { + roomUpdateHandler(roomUpdate(scope)) + }, { + organizerUpdateHandler(organizerUpdate(scope)) + }) + currentEventController.subscribe { + roomUpdateHandler(roomUpdate(scope)) + } + } + + private fun roomUpdate(scope: CoroutineScope): RoomInfo { + var newRoomInfo: RoomInfo? = null + scope.launch { + newRoomInfo = roomInfoUseCase() + } + while (newRoomInfo == null) { + } + return newRoomInfo!! + } + + private fun organizerUpdate( + scope: CoroutineScope + ): List { + var newOrgListInfo: List? = null + scope.launch { + newOrgListInfo = organizersInfoUseCase() + } + while (newOrgListInfo == null) { + } + return newOrgListInfo!! + } +} \ No newline at end of file diff --git a/tabletApp/features/network/build.gradle.kts b/tabletApp/features/network/build.gradle.kts new file mode 100644 index 00000000..b1104dd1 --- /dev/null +++ b/tabletApp/features/network/build.gradle.kts @@ -0,0 +1,42 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) +} + + +android { + compileSdk = 33 + sourceSets["main"].apply { + manifest.srcFile("src/androidMain/AndroidManifest.xml") + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + // Koin + api(Dependencies.Koin.core) + + implementation(project(":tabletApp:features:domain")) + } + } + val androidMain by getting { + dependencies{ + // Koin + api(Dependencies.Koin.android) + } + } + } +} diff --git a/tabletApp/features/network/src/androidMain/AndroidManifest.xml b/tabletApp/features/network/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..28fe6ddf --- /dev/null +++ b/tabletApp/features/network/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt new file mode 100644 index 00000000..c8f1b8c9 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt @@ -0,0 +1,7 @@ +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.api.WorkApi +import org.koin.dsl.module + +val networkModule = module { + single { WorkApi() } +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt new file mode 100644 index 00000000..fbd5008d --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt @@ -0,0 +1,14 @@ +package band.effective.office.tablet.network.api + +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.model.WebServerEvent +import kotlinx.coroutines.CoroutineScope + +interface Api { + //TODO("change return value") + suspend fun getRoomInfo(): RoomInfo + suspend fun getOrganizers(): List + suspend fun cancelEvent(): Boolean + suspend fun bookingRoom(): Boolean + fun subscribeOnWebHock(scope: CoroutineScope,handler: (event: WebServerEvent) -> Unit) +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt new file mode 100644 index 00000000..74812e65 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt @@ -0,0 +1,41 @@ +package band.effective.office.tablet.network.api + +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.model.WebServerEvent +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.collect +import kotlinx.coroutines.launch + +class WorkApi : Api { + val mutableRoomInfo = MutableStateFlow(RoomInfo.defaultValue) + val mutableOrgList = MutableStateFlow(listOf("a", "b", "c")) + override suspend fun getRoomInfo(): RoomInfo { + delay(1000L) + return mutableRoomInfo.value + } + + override suspend fun getOrganizers(): List { + delay(1000L) + return mutableOrgList.value + } + + override suspend fun cancelEvent(): Boolean { + delay(1000L) + return false + } + + override suspend fun bookingRoom(): Boolean { + delay(1000L) + return false + } + + override fun subscribeOnWebHock( + scope: CoroutineScope, + handler: (event: WebServerEvent) -> Unit + ) { + scope.launch { mutableRoomInfo.collect { handler(WebServerEvent.RoomInfoUpdate) } } + scope.launch { mutableOrgList.collect { handler(WebServerEvent.OrganizerInfoUpdate) } } + } +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/model/WebServerEvent.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/model/WebServerEvent.kt new file mode 100644 index 00000000..d2b17158 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/model/WebServerEvent.kt @@ -0,0 +1,6 @@ +package band.effective.office.tablet.network.model + +sealed interface WebServerEvent { + object RoomInfoUpdate : WebServerEvent + object OrganizerInfoUpdate : WebServerEvent +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/BookingReposutory.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/BookingReposutory.kt new file mode 100644 index 00000000..627544e3 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/BookingReposutory.kt @@ -0,0 +1,5 @@ +package band.effective.office.tablet.network.repository + +interface BookingRepository { + suspend fun bookingRoom(): Boolean +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/CancelRepository.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/CancelRepository.kt new file mode 100644 index 00000000..4de789b4 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/CancelRepository.kt @@ -0,0 +1,5 @@ +package band.effective.office.tablet.network.repository + +interface CancelRepository { + suspend fun cancelEvent(): Boolean +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/OrganizerRepository.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/OrganizerRepository.kt new file mode 100644 index 00000000..44d41dca --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/OrganizerRepository.kt @@ -0,0 +1,5 @@ +package band.effective.office.tablet.network.repository + +interface OrganizerRepository { + suspend fun getOrganizersList(): List +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/RoomRepository.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/RoomRepository.kt new file mode 100644 index 00000000..caecf742 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/RoomRepository.kt @@ -0,0 +1,7 @@ +package band.effective.office.tablet.network.repository + +import band.effective.office.tablet.domain.model.RoomInfo + +interface RoomRepository { + suspend fun getRoomInfo(): RoomInfo +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/ServerUpdateRepository.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/ServerUpdateRepository.kt new file mode 100644 index 00000000..c73f3c7d --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/ServerUpdateRepository.kt @@ -0,0 +1,11 @@ +package band.effective.office.tablet.network.repository + +import kotlinx.coroutines.CoroutineScope + +interface ServerUpdateRepository { + suspend fun subscribeOnUpdates( + scope: CoroutineScope, + roomInfoUpdateHandler: () -> Unit, + organizersListUpdateHandler: () -> Unit + ) +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/BookingRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/BookingRepositoryImpl.kt new file mode 100644 index 00000000..63572fa4 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/BookingRepositoryImpl.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.network.repository.impl + +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.repository.BookingRepository + +class BookingRepositoryImpl(private val api: Api) : BookingRepository { + override suspend fun bookingRoom(): Boolean = api.bookingRoom() +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/CancelRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/CancelRepositoryImpl.kt new file mode 100644 index 00000000..6247df8d --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/CancelRepositoryImpl.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.network.repository.impl + +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.repository.CancelRepository + +class CancelRepositoryImpl(private val api: Api) : CancelRepository { + override suspend fun cancelEvent(): Boolean = api.cancelEvent() +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/OrganizerRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/OrganizerRepositoryImpl.kt new file mode 100644 index 00000000..b3590e6f --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/OrganizerRepositoryImpl.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.network.repository.impl + +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.repository.OrganizerRepository + +class OrganizerRepositoryImpl(private val api: Api) : OrganizerRepository { + override suspend fun getOrganizersList(): List = api.getOrganizers() +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/RoomRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/RoomRepositoryImpl.kt new file mode 100644 index 00000000..23525a5d --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/RoomRepositoryImpl.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.network.repository.impl + +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.repository.RoomRepository + +class RoomRepositoryImpl(private val api: Api): RoomRepository { + override suspend fun getRoomInfo() = api.getRoomInfo() +} \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt new file mode 100644 index 00000000..49251e31 --- /dev/null +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt @@ -0,0 +1,21 @@ +package band.effective.office.tablet.network.repository.impl + +import band.effective.office.tablet.network.api.Api +import band.effective.office.tablet.network.model.WebServerEvent +import band.effective.office.tablet.network.repository.ServerUpdateRepository +import kotlinx.coroutines.CoroutineScope + +class ServerUpdateRepositoryImpl(private val api: Api) : ServerUpdateRepository { + override suspend fun subscribeOnUpdates( + scope: CoroutineScope, + roomInfoUpdateHandler: () -> Unit, + organizersListUpdateHandler: () -> Unit + ) { + api.subscribeOnWebHock(scope) { event -> + when (event) { + WebServerEvent.OrganizerInfoUpdate -> organizersListUpdateHandler() + WebServerEvent.RoomInfoUpdate -> roomInfoUpdateHandler() + } + } + } +} \ No newline at end of file -- GitLab From a75856d7053dea14e520d15a768edf2eff88fb72 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Sun, 9 Jul 2023 19:22:32 +0600 Subject: [PATCH 34/63] [+] refactor main screen components --- settings.gradle.kts | 3 +- tabletApp/features/core/build.gradle.kts | 25 ++++++ .../core/src/androidMain/AndroidManifest.xml | 4 + .../office/tablet/domain/model/EventInfo.kt | 0 .../office/tablet/domain/model/RoomInfo.kt | 0 tabletApp/features/domain/build.gradle.kts | 2 +- .../src/androidMain/AndroidManifest.xml | 2 +- .../office/tablet/di/DomainModule.kt | 3 +- .../tablet/domain/CurrentEventController.kt | 2 +- .../domain/useCase/CheckBookingUseCase.kt | 32 +++++-- .../tablet/domain/useCase/UpdateUseCase.kt | 10 ++- tabletApp/features/network/build.gradle.kts | 5 +- .../office/tablet/di/NetworkModule.kt | 4 +- .../office/tablet/network/api/WorkApi.kt | 1 - tabletApp/features/roomInfo/build.gradle.kts | 6 +- .../office/tablet/di/CommonModule.kt | 12 +-- .../effective/office/tablet/di/UiModule.kt | 13 +++ .../office/tablet/domain/MockController.kt | 9 -- .../office/tablet/domain/RoomInteractor.kt | 18 ---- .../tablet/domain/RoomInteractorImpl.kt | 23 ----- .../office/tablet/domain/model/EventInfo.kt | 18 ---- .../office/tablet/domain/model/RoomInfo.kt | 23 ----- .../tablet/network/MockRoomInfoRepository.kt | 88 ------------------- .../tablet/network/RoomInfoRepository.kt | 11 --- .../tablet/ui/mainScreen/MainScreenState.kt | 2 +- .../tablet/ui/mainScreen/RealMainComponent.kt | 19 ++-- .../mainScreen/components/MainScreenView.kt | 2 +- .../BookingRoomComponent.kt | 1 - .../RealBookingRoomComponent.kt | 46 +++++----- .../uiComponents/BusyAlertView.kt | 2 +- .../RealMockSettingsComponent.kt | 8 +- .../BusyRoomInfoComponent.kt | 2 +- .../FreeRoomInfoComponent.kt | 2 +- .../RoomEventListComponent.kt | 2 +- .../roomInfoComponents/RoomInfoComponent.kt | 6 +- .../office/tablet/utils/DecomposeUtils.kt | 24 +++++ 36 files changed, 161 insertions(+), 269 deletions(-) create mode 100644 tabletApp/features/core/build.gradle.kts create mode 100644 tabletApp/features/core/src/androidMain/AndroidManifest.xml rename tabletApp/features/{domain => core}/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt (100%) rename tabletApp/features/{domain => core}/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt (100%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/UiModule.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/DecomposeUtils.kt diff --git a/settings.gradle.kts b/settings.gradle.kts index 667173e0..9f929f38 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -7,4 +7,5 @@ include(":tabletApp") include(":tabletApp:features:selectRoom") include(":tabletApp:features:roomInfo") include(":tabletApp:features:network") -include(":tabletApp:features:domain") \ No newline at end of file +include(":tabletApp:features:domain") +include(":tabletApp:features:core") \ No newline at end of file diff --git a/tabletApp/features/core/build.gradle.kts b/tabletApp/features/core/build.gradle.kts new file mode 100644 index 00000000..b4db953e --- /dev/null +++ b/tabletApp/features/core/build.gradle.kts @@ -0,0 +1,25 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.Kotlin.plugin) +} + +android { + compileSdk = 33 +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + } + } + } +} diff --git a/tabletApp/features/core/src/androidMain/AndroidManifest.xml b/tabletApp/features/core/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..591c12d4 --- /dev/null +++ b/tabletApp/features/core/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt similarity index 100% rename from tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt similarity index 100% rename from tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt diff --git a/tabletApp/features/domain/build.gradle.kts b/tabletApp/features/domain/build.gradle.kts index 4ff3725c..ddb3f9af 100644 --- a/tabletApp/features/domain/build.gradle.kts +++ b/tabletApp/features/domain/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id(Plugins.AndroidLib.plugin) - id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) } @@ -29,6 +28,7 @@ kotlin { // Koin api(Dependencies.Koin.core) + implementation(project(":tabletApp:features:core")) implementation(project(":tabletApp:features:network")) } } diff --git a/tabletApp/features/domain/src/androidMain/AndroidManifest.xml b/tabletApp/features/domain/src/androidMain/AndroidManifest.xml index c428412f..c3665bc4 100644 --- a/tabletApp/features/domain/src/androidMain/AndroidManifest.xml +++ b/tabletApp/features/domain/src/androidMain/AndroidManifest.xml @@ -1,4 +1,4 @@ - + diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt index c6245d1c..98c96896 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/di/DomainModule.kt @@ -2,9 +2,11 @@ package band.effective.office.tablet.di import band.effective.office.tablet.domain.CurrentEventController import band.effective.office.tablet.domain.CurrentEventControllerServerImpl +import band.effective.office.tablet.domain.MockController import band.effective.office.tablet.domain.useCase.BookingUseCase import band.effective.office.tablet.domain.useCase.OrganizersInfoUseCase import band.effective.office.tablet.domain.useCase.RoomInfoUseCase +import band.effective.office.tablet.network.api.WorkApi import band.effective.office.tablet.network.repository.BookingRepository import band.effective.office.tablet.network.repository.CancelRepository import band.effective.office.tablet.network.repository.OrganizerRepository @@ -28,5 +30,4 @@ val domainModule = module { single { OrganizersInfoUseCase(get()) } single { BookingUseCase(get()) } single { CurrentEventControllerServerImpl(get(), get(), get()) } - //single { UpdateUseCase(get(), get(), get(), get()) } } \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt index c27a6f59..8fa49693 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt @@ -15,7 +15,7 @@ abstract class CurrentEventController( ) { private lateinit var job: Job protected lateinit var scope: CoroutineScope - protected var currentEvent: EventInfo? = null + protected var currentEvent: band.effective.office.tablet.domain.model.EventInfo? = null protected val handlersList: MutableList<() -> Unit> = mutableListOf() fun start(scope: CoroutineScope) { diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt index 6e21e99c..215d9066 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt @@ -4,21 +4,35 @@ import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar class CheckBookingUseCase(private val roomInfoUseCase: RoomInfoUseCase) { - suspend operator fun invoke(event: EventInfo): Boolean { + suspend operator fun invoke(event: band.effective.office.tablet.domain.model.EventInfo): Boolean { + val eventsList: List = eventList() + return !predicate(event, eventsList) + } + + suspend fun busyEvent(event: band.effective.office.tablet.domain.model.EventInfo): band.effective.office.tablet.domain.model.EventInfo? { + val eventsList: List = eventList() + return eventsList.firstOrNull() { predicate(event, eventsList) } + } + + + private fun predicate(event: band.effective.office.tablet.domain.model.EventInfo, eventsList: List) = + startEventBelongList(event.startTime, eventsList) || startNewEventBelongList( + event, + eventsList + ) + + private suspend fun eventList(): List { val roomInfo = roomInfoUseCase() - val eventsList: List = - if (roomInfo.currentEvent == null) roomInfo.eventList - else roomInfo.eventList + roomInfo.currentEvent - val predicate = startEventBelongList(event.startTime, eventsList) || startNewEventBelongList( event, eventsList ) - return !predicate + return if (roomInfo.currentEvent != null) roomInfo.eventList + roomInfo.currentEvent!! + else roomInfo.eventList } - private fun startNewEventBelongList(event: EventInfo, eventsList: List) = + private fun startNewEventBelongList(event: band.effective.office.tablet.domain.model.EventInfo, eventsList: List) = eventsList.any { it.startTime.belong(event) } - private fun startEventBelongList(calendar: Calendar, eventsList: List) = + private fun startEventBelongList(calendar: Calendar, eventsList: List) = eventsList.any { calendar.belong(it) } - private fun Calendar.belong(event: EventInfo) = + private fun Calendar.belong(event: band.effective.office.tablet.domain.model.EventInfo) = this > event.startTime && this < event.finishTime } \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt index 9529645d..5ccf6a12 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt @@ -12,9 +12,11 @@ class UpdateUseCase( private val currentEventController: CurrentEventController, private val serverUpdateRepository: ServerUpdateRepository ) { - suspend fun invoke( + suspend fun getRoomInfo() = roomInfoUseCase() + suspend fun getOrganizersList() = organizersInfoUseCase() + suspend operator fun invoke( scope: CoroutineScope, - roomUpdateHandler: (RoomInfo) -> Unit, + roomUpdateHandler: (band.effective.office.tablet.domain.model.RoomInfo) -> Unit, organizerUpdateHandler: (List) -> Unit ) { serverUpdateRepository.subscribeOnUpdates(scope, { @@ -27,8 +29,8 @@ class UpdateUseCase( } } - private fun roomUpdate(scope: CoroutineScope): RoomInfo { - var newRoomInfo: RoomInfo? = null + private fun roomUpdate(scope: CoroutineScope): band.effective.office.tablet.domain.model.RoomInfo { + var newRoomInfo: band.effective.office.tablet.domain.model.RoomInfo? = null scope.launch { newRoomInfo = roomInfoUseCase() } diff --git a/tabletApp/features/network/build.gradle.kts b/tabletApp/features/network/build.gradle.kts index b1104dd1..3910626a 100644 --- a/tabletApp/features/network/build.gradle.kts +++ b/tabletApp/features/network/build.gradle.kts @@ -1,6 +1,5 @@ plugins { id(Plugins.AndroidLib.plugin) - id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) } @@ -29,11 +28,11 @@ kotlin { // Koin api(Dependencies.Koin.core) - implementation(project(":tabletApp:features:domain")) + implementation(project(":tabletApp:features:core")) } } val androidMain by getting { - dependencies{ + dependencies { // Koin api(Dependencies.Koin.android) } diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt index c8f1b8c9..558ae485 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/di/NetworkModule.kt @@ -3,5 +3,7 @@ import band.effective.office.tablet.network.api.WorkApi import org.koin.dsl.module val networkModule = module { - single { WorkApi() } + val workApi = WorkApi() + single { workApi } + single { workApi } } \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt index 74812e65..0ac6f677 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt @@ -5,7 +5,6 @@ import band.effective.office.tablet.network.model.WebServerEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.collect import kotlinx.coroutines.launch class WorkApi : Api { diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index 5129e305..250ed26e 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -41,10 +41,14 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + + implementation(project(":tabletApp:features:core")) + implementation(project(":tabletApp:features:network")) + implementation(project(":tabletApp:features:domain")) } } val androidMain by getting { - dependencies{ + dependencies { // Koin api(Dependencies.Koin.android) } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt index 5a4aa86c..4935727d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/CommonModule.kt @@ -1,15 +1,9 @@ package band.effective.office.tablet.di -import band.effective.office.tablet.domain.MockController -import band.effective.office.tablet.domain.RoomInteractor -import band.effective.office.tablet.domain.RoomInteractorImpl -import band.effective.office.tablet.network.MockRoomInfoRepository -import band.effective.office.tablet.network.RoomInfoRepository +import networkModule +import org.koin.core.context.loadKoinModules import org.koin.dsl.module -/*NOTE(Maksim Mishenko) write one di module because few dependence now*/ val commonModule = module { - single { MockController() } - single { MockRoomInfoRepository() } - single { RoomInteractorImpl(get()) } + loadKoinModules(listOf(networkModule, domainModule, uiModule)) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/UiModule.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/UiModule.kt new file mode 100644 index 00000000..4dc19774 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/di/UiModule.kt @@ -0,0 +1,13 @@ +package band.effective.office.tablet.di + +import band.effective.office.tablet.domain.MockController +import band.effective.office.tablet.domain.useCase.BookingUseCase +import band.effective.office.tablet.domain.useCase.CheckBookingUseCase +import band.effective.office.tablet.domain.useCase.UpdateUseCase +import org.koin.dsl.module + +val uiModule = module { + single { UpdateUseCase(get(), get(), get(), get()) } + single { CheckBookingUseCase(get()) } + single { MockController(get()) } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt deleted file mode 100644 index 8ca15f5b..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt +++ /dev/null @@ -1,9 +0,0 @@ -package band.effective.office.tablet.domain - -/**Contain mock's flags*/ -data class MockController( - var isBusy: Boolean = false, - var isManyEvent: Boolean = false, - var isHaveTV: Boolean = false, - var isBusyTime: Boolean = false -) \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt deleted file mode 100644 index 99ad3ab2..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractor.kt +++ /dev/null @@ -1,18 +0,0 @@ -package band.effective.office.tablet.domain - -import band.effective.office.tablet.domain.model.EventInfo -import band.effective.office.tablet.domain.model.RoomInfo -import java.util.Calendar - -/**Interface for get information about room and send booking request*/ -interface RoomInteractor { - /**Get room information by room's name*/ - fun getRoomInfo(name: String): RoomInfo - - /**Get list peoples have rights for booking room*/ - fun getOrganizers(): List - - /**Check opportunity book room - * @return Return null if room is free, if room busy then return interfering event*/ - fun checkRoom(name: String, dateTime: Calendar): EventInfo? -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt deleted file mode 100644 index b32db1dd..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/RoomInteractorImpl.kt +++ /dev/null @@ -1,23 +0,0 @@ -package band.effective.office.tablet.domain - -import band.effective.office.tablet.domain.model.EventInfo -import band.effective.office.tablet.domain.model.RoomInfo -import band.effective.office.tablet.network.RoomInfoRepository -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject -import java.util.Calendar -import java.util.GregorianCalendar - -class RoomInteractorImpl(private val roomInfoRepository: RoomInfoRepository) : RoomInteractor, - KoinComponent { - private val mockController: MockController by inject() - override fun getRoomInfo(name: String): RoomInfo = roomInfoRepository.getRoomInfo(name) - override fun getOrganizers(): List = roomInfoRepository.getOrganizers() - override fun checkRoom(name: String, dateTime: Calendar): EventInfo? = - if (mockController.isBusyTime) EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), - organizer = "Ольга Белозерова" - ) - else null -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt deleted file mode 100644 index 888fea56..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ /dev/null @@ -1,18 +0,0 @@ -package band.effective.office.tablet.domain.model - -import java.util.Calendar -import java.util.GregorianCalendar - -data class EventInfo( - val startTime: Calendar, - val finishTime: Calendar, - val organizer: String -){ - companion object{ - val emptyEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), - organizer = "" - ) - } -} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt deleted file mode 100644 index a9683647..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/RoomInfo.kt +++ /dev/null @@ -1,23 +0,0 @@ -package band.effective.office.tablet.domain.model - -data class RoomInfo( - val name: String, - val capacity: Int, - val isHaveTv: Boolean, - val electricSocketCount: Int, - val eventList: List, - //NOTE(Maksim Mishenko): currentEvent is null if room is free - val currentEvent: EventInfo? -){ - companion object{ - val defaultValue = - RoomInfo( - name = "Default", - capacity = 0, - isHaveTv = false, - electricSocketCount = 0, - eventList = listOf(), - currentEvent = null - ) - } -} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt deleted file mode 100644 index 42a9a440..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/MockRoomInfoRepository.kt +++ /dev/null @@ -1,88 +0,0 @@ -package band.effective.office.tablet.network - -import band.effective.office.tablet.domain.MockController -import band.effective.office.tablet.domain.model.EventInfo -import band.effective.office.tablet.domain.model.RoomInfo -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject -import java.util.Calendar -import java.util.GregorianCalendar - -class MockRoomInfoRepository : RoomInfoRepository, KoinComponent { - private val mockController: MockController by inject() - private fun isBusy() = mockController.isBusy - private fun isManyEvent() = mockController.isManyEvent - private fun isHaveTv() = mockController.isHaveTV - - private val startCurrentEvent: Calendar - private val finishCurrentEvent: Calendar - - /**It's field contain time for mocks, when it is used it needs to be increment, so that different mocks have different times*/ - private val currentTime: Calendar - - init { - val calendar = GregorianCalendar() - calendar.add(Calendar.MINUTE, -10) - startCurrentEvent = calendar.clone() as Calendar - calendar.add(Calendar.MINUTE, 30) - finishCurrentEvent = calendar.clone() as Calendar - currentTime = calendar.clone() as Calendar - } - - /**Reset current time field*/ - private fun updateCurrentTime() { - val calendar = GregorianCalendar() - calendar.add(Calendar.MINUTE, 20) - currentTime.time = calendar.time - } - - /**Get and increment current time*/ - private fun getTime(): Calendar { - currentTime.add(Calendar.MINUTE, 30) - return currentTime.clone() as Calendar - } - - private fun currentEvent() = EventInfo( - startTime = startCurrentEvent, - finishTime = finishCurrentEvent, - organizer = "Ольга Белозерова" - ) - - private fun olyaEvent() = EventInfo( - startTime = getTime(), - finishTime = getTime(), - organizer = "Ольга Белозерова" - ) - - private fun matveyEvent() = EventInfo( - startTime = getTime(), - finishTime = getTime(), - organizer = "Матвей Авгуль" - ) - - private fun lilaEvent() = EventInfo( - startTime = getTime(), - finishTime = getTime(), - organizer = "Лилия Акентьева" - ) - - private fun eventsList() = listOf(olyaEvent(), matveyEvent(), lilaEvent()) - - private fun bigEventList() = - eventsList() + eventsList() + eventsList() + eventsList() + eventsList() - - override fun getRoomInfo(name: String): RoomInfo { - updateCurrentTime() - return RoomInfo( - name = "Sirius", - capacity = 8, - isHaveTv = isHaveTv(), - electricSocketCount = 4, - eventList = if (isManyEvent()) bigEventList() else eventsList(), - currentEvent = if (isBusy()) currentEvent() else null - ) - } - - override fun getOrganizers(): List = - listOf("Ольга Белозерова", "Матвей Авгуль", "Лилия Акентьева") -} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt deleted file mode 100644 index 4c46495b..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/network/RoomInfoRepository.kt +++ /dev/null @@ -1,11 +0,0 @@ -package band.effective.office.tablet.network - -import band.effective.office.tablet.domain.model.RoomInfo - -/**Repository for get information about rooms*/ -interface RoomInfoRepository { - /**Get information about room by room's name*/ - fun getRoomInfo(name: String): RoomInfo - - fun getOrganizers(): List -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt index 7371ec82..665e0a71 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt @@ -1,7 +1,7 @@ package band.effective.office.tablet.ui.mainScreen import band.effective.office.tablet.domain.model.RoomInfo -import band.effective.office.tablet.network.RoomInfoRepository + data class MainScreenState( val isLoad: Boolean, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 98ceaade..634a3392 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -1,15 +1,17 @@ package band.effective.office.tablet.ui.mainScreen -import band.effective.office.tablet.domain.RoomInteractor +import band.effective.office.tablet.domain.useCase.UpdateUseCase import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealBookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent +import band.effective.office.tablet.utils.componentCoroutineScope import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject @@ -18,7 +20,9 @@ class RealMainComponent( private val OnSelectOtherRoomRequest: () -> Unit ) : ComponentContext by componentContext, KoinComponent, MainComponent { - private val interactor: RoomInteractor by inject() + private val updateUseCase: UpdateUseCase by inject() + + private val scope = componentContext.componentCoroutineScope() private var mutableState = MutableStateFlow(MainScreenState.defaultState) override val state = mutableState.asStateFlow() @@ -26,7 +30,7 @@ class RealMainComponent( override val mockSettingsComponent: MockSettingsComponent = RealMockSettingsComponent( componentContext = childContext(key = "mock"), - updateData = { updateData() } + updateData = { /*updateData()*/ } ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), @@ -38,15 +42,18 @@ class RealMainComponent( updateData() } - private fun updateData() { + private fun updateData() = scope.launch { + updateUseCase( + scope = scope, + roomUpdateHandler = { roomInfo -> mutableState.update { it.copy(roomInfo = roomInfo) } }, + organizerUpdateHandler = {}) mutableState.update { it.copy( isLoad = false, isData = true, - roomInfo = interactor.getRoomInfo("sirius") + roomInfo = updateUseCase.getRoomInfo() ) } - bookingRoomComponent.update() } override fun sendEvent(event: MainScreenEvent) = diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 1c557f3b..19f38af7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -26,7 +26,7 @@ import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents. @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreenView( - room: RoomInfo, + room: band.effective.office.tablet.domain.model.RoomInfo, mockComponent: MockSettingsComponent, bookingRoomComponent: BookingRoomComponent ) { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt index 1b5f924d..bfffb1b7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt @@ -10,5 +10,4 @@ interface BookingRoomComponent { val eventOrganizerComponent: RealEventOrganizerComponent fun sendEvent(event: BookingRoomViewEvent) - fun update() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 2e77125e..24a75310 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,15 +1,11 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents -import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.useCase.CheckBookingUseCase +import band.effective.office.tablet.domain.useCase.UpdateUseCase +import band.effective.office.tablet.utils.componentCoroutineScope import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext -import com.arkivanov.essenty.lifecycle.Lifecycle -import com.arkivanov.essenty.lifecycle.doOnDestroy -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.cancel import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow @@ -42,7 +38,8 @@ class RealBookingRoomComponent( childContext("organizer"), onSelectOrganizer = { selectOrganizer(it) }) - private val roomInfoInteractor: RoomInteractor by inject() + private val updateUseCase: UpdateUseCase by inject() + private val checkBookingUseCase: CheckBookingUseCase by inject() init { mutableState.update { it.copy(roomName = roomName) } @@ -62,13 +59,13 @@ class RealBookingRoomComponent( } } - override fun update() { + private fun update() = componentCoroutineScope().launch { mutableState.update { it.copy( - organizers = roomInfoInteractor.getOrganizers(), - isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, - busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) - ?: EventInfo.emptyEvent, + organizers = updateUseCase.getOrganizersList(), + isBusy = checkBookingUseCase(state.value.toEvent()), + busyEvent = checkBookingUseCase.busyEvent(state.value.toEvent()) + ?: band.effective.office.tablet.domain.model.EventInfo.emptyEvent, ) } } @@ -76,6 +73,7 @@ class RealBookingRoomComponent( private fun changeLength(delta: Int) { if (state.value.length + delta >= 0) { mutableState.update { it.copy(length = it.length + delta) } + update() } } @@ -83,6 +81,7 @@ class RealBookingRoomComponent( val newValue = state.value.selectDate.clone() as Calendar newValue.add(Calendar.DAY_OF_MONTH, day) mutableState.update { it.copy(selectDate = newValue) } + update() } //TODO(Maksim Mishenko): think about while(true) @@ -99,19 +98,14 @@ class RealBookingRoomComponent( private fun selectOrganizer(organizer: String) { mutableState.update { it.copy(organizer = organizer) } } -} - -//NOTE(Maksim Mishenko): https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 -fun ComponentContext.componentCoroutineScope(): CoroutineScope { - val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) - if (lifecycle.state != Lifecycle.State.DESTROYED) { - lifecycle.doOnDestroy { - scope.cancel() - } - } else { - scope.cancel() + private fun BookingRoomState.toEvent(): EventInfo { + val finishTime = selectDate.clone() as Calendar + finishTime.add(Calendar.MINUTE, length) + return EventInfo( + startTime = selectDate, + finishTime = finishTime, + organizer = organizer + ) } - - return scope } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt index 2fe9500f..7ec603f0 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt @@ -25,7 +25,7 @@ import java.util.Calendar @OptIn(ExperimentalMaterialApi::class) @Composable -fun BusyAlertView(modifier: Modifier, event: EventInfo, onClick: () -> Unit) { +fun BusyAlertView(modifier: Modifier, event: band.effective.office.tablet.domain.model.EventInfo, onClick: () -> Unit) { Column(modifier = modifier) { Row( modifier = Modifier.fillMaxWidth(), diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt index 19b64316..0d8fe589 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt @@ -23,18 +23,18 @@ class RealMockSettingsComponent( /**Synchronize data in mock controller and in state*/ private fun reloadData() { - mutableState.update { + /*mutableState.update { it.copy( isBusy = mockController.isBusy, isManyEvent = mockController.isManyEvent, isHaveTv = mockController.isHaveTV, isBusyTime = mockController.isBusyTime ) - } + }*/ } override fun sendEvent(event: MockSettingsEvent) { - when (event) { + /*when (event) { is MockSettingsEvent.OnSwitchBusy -> mockController.isBusy = event.newState is MockSettingsEvent.OnSwitchEventCount -> mockController.isManyEvent = event.newState is MockSettingsEvent.OnSwitchTv -> mockController.isHaveTV = event.newState @@ -42,7 +42,7 @@ class RealMockSettingsComponent( is MockSettingsEvent.OnSwitchVisible -> mutableState.update { it.copy(isVisible = !it.isVisible) } } reloadData() - updateData() + updateData()*/ } } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt index b6621155..06870fc7 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt @@ -30,7 +30,7 @@ fun BusyRoomInfoComponent( capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, - event: EventInfo? + event: band.effective.office.tablet.domain.model.EventInfo? ) { val backgroundColor = Color(0xFFF94C4C) Surface { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt index 98b8e1b4..1a76ac22 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt @@ -15,7 +15,7 @@ fun FreeRoomInfoComponent( capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, - nextEvent: EventInfo? + nextEvent: band.effective.office.tablet.domain.model.EventInfo? ) { CommonRoomInfoComponent( modifier = modifier, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt index 18f7dc7e..7772bc1e 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt @@ -25,7 +25,7 @@ import band.effective.office.tablet.utils.CalendarStringConverter import java.util.Calendar @Composable -fun RoomEventListComponent(modifier: Modifier = Modifier, eventsList: List) { +fun RoomEventListComponent(modifier: Modifier = Modifier, eventsList: List) { Column(modifier = modifier) { Text( text = "Занятое время", diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt index 42ac5c3f..864821c8 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt @@ -13,7 +13,7 @@ import band.effective.office.tablet.domain.model.RoomInfo @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable -fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { +fun RoomInfoComponent(modifier: Modifier = Modifier, room: band.effective.office.tablet.domain.model.RoomInfo) { val paddings = 30.dp Column(modifier = modifier) { DateTimeComponent(modifier = Modifier.padding(paddings)) @@ -45,5 +45,5 @@ fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { } } -private fun RoomInfo.isFree() = currentEvent == null -private fun RoomInfo.isBusy() = currentEvent != null \ No newline at end of file +private fun band.effective.office.tablet.domain.model.RoomInfo.isFree() = currentEvent == null +private fun band.effective.office.tablet.domain.model.RoomInfo.isBusy() = currentEvent != null \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/DecomposeUtils.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/DecomposeUtils.kt new file mode 100644 index 00000000..07d0f0f6 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/utils/DecomposeUtils.kt @@ -0,0 +1,24 @@ +package band.effective.office.tablet.utils + +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.essenty.lifecycle.Lifecycle +import com.arkivanov.essenty.lifecycle.doOnDestroy +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.cancel + +//NOTE(Maksim Mishenko): https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 +fun ComponentContext.componentCoroutineScope(): CoroutineScope { + val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO) + + if (lifecycle.state != Lifecycle.State.DESTROYED) { + lifecycle.doOnDestroy { + scope.cancel() + } + } else { + scope.cancel() + } + + return scope +} \ No newline at end of file -- GitLab From de4688498e94806263f684ef96443f8064b0c591 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Sun, 9 Jul 2023 21:03:34 +0600 Subject: [PATCH 35/63] [~] refactor mock logic --- .../office/tablet/domain/MockController.kt | 14 ++- .../domain/useCase/CheckBookingUseCase.kt | 22 ++-- .../tablet/domain/useCase/UpdateUseCase.kt | 7 +- .../office/tablet/network/api/WorkApi.kt | 105 ++++++++++++++++-- .../impl/ServerUpdateRepositoryImpl.kt | 4 +- .../tablet/ui/mainScreen/RealMainComponent.kt | 3 +- .../mainScreen/components/MainScreenView.kt | 2 +- .../RealBookingRoomComponent.kt | 19 +++- .../mockComponets/MockSettingView.kt | 6 - .../mockComponets/MockSettingsEvent.kt | 1 - .../RealMockSettingsComponent.kt | 40 +++---- 11 files changed, 159 insertions(+), 64 deletions(-) diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt index daef944f..9668f2ad 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/MockController.kt @@ -4,13 +4,17 @@ import band.effective.office.tablet.network.api.WorkApi import kotlinx.coroutines.flow.update class MockController( - val workApi: WorkApi, - /*var isBusy: Boolean = false, - var isManyEvent: Boolean = false, - var isHaveTV: Boolean = false, - var isBusyTime: Boolean = false*/ + val workApi: WorkApi ){ fun changeBusy(newValue: Boolean){ + workApi.changeBusy(newValue) + } + + fun changeEventCount(isMany: Boolean){ + workApi.changeEventCount(isMany) + } + fun changeHaveTv(newValue: Boolean){ + workApi.mutableRoomInfo.update { it.copy(isHaveTv = newValue) } } } \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt index 215d9066..f4e31e8b 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/CheckBookingUseCase.kt @@ -4,35 +4,35 @@ import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar class CheckBookingUseCase(private val roomInfoUseCase: RoomInfoUseCase) { - suspend operator fun invoke(event: band.effective.office.tablet.domain.model.EventInfo): Boolean { - val eventsList: List = eventList() + suspend operator fun invoke(event: EventInfo): Boolean { + val eventsList: List = eventList() return !predicate(event, eventsList) } - suspend fun busyEvent(event: band.effective.office.tablet.domain.model.EventInfo): band.effective.office.tablet.domain.model.EventInfo? { - val eventsList: List = eventList() - return eventsList.firstOrNull() { predicate(event, eventsList) } + suspend fun busyEvent(event: EventInfo): EventInfo? { + val eventsList: List = eventList() + return eventsList.firstOrNull() { it.startTime.belong(event) || event.startTime.belong(it) }?.copy() } - private fun predicate(event: band.effective.office.tablet.domain.model.EventInfo, eventsList: List) = + private fun predicate(event: EventInfo, eventsList: List) = startEventBelongList(event.startTime, eventsList) || startNewEventBelongList( event, eventsList ) - private suspend fun eventList(): List { + private suspend fun eventList(): List { val roomInfo = roomInfoUseCase() return if (roomInfo.currentEvent != null) roomInfo.eventList + roomInfo.currentEvent!! else roomInfo.eventList } - private fun startNewEventBelongList(event: band.effective.office.tablet.domain.model.EventInfo, eventsList: List) = + private fun startNewEventBelongList(event: EventInfo, eventsList: List) = eventsList.any { it.startTime.belong(event) } - private fun startEventBelongList(calendar: Calendar, eventsList: List) = + private fun startEventBelongList(calendar: Calendar, eventsList: List) = eventsList.any { calendar.belong(it) } - private fun Calendar.belong(event: band.effective.office.tablet.domain.model.EventInfo) = - this > event.startTime && this < event.finishTime + private fun Calendar.belong(event: EventInfo) = + this >= event.startTime && this <= event.finishTime } \ No newline at end of file diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt index 5ccf6a12..c67ecbb2 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.domain.useCase +import android.util.Log import band.effective.office.tablet.domain.CurrentEventController import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.repository.ServerUpdateRepository @@ -16,7 +17,7 @@ class UpdateUseCase( suspend fun getOrganizersList() = organizersInfoUseCase() suspend operator fun invoke( scope: CoroutineScope, - roomUpdateHandler: (band.effective.office.tablet.domain.model.RoomInfo) -> Unit, + roomUpdateHandler: (RoomInfo) -> Unit, organizerUpdateHandler: (List) -> Unit ) { serverUpdateRepository.subscribeOnUpdates(scope, { @@ -29,8 +30,8 @@ class UpdateUseCase( } } - private fun roomUpdate(scope: CoroutineScope): band.effective.office.tablet.domain.model.RoomInfo { - var newRoomInfo: band.effective.office.tablet.domain.model.RoomInfo? = null + private fun roomUpdate(scope: CoroutineScope): RoomInfo { + var newRoomInfo: RoomInfo? = null scope.launch { newRoomInfo = roomInfoUseCase() } diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt index 0ac6f677..d590dad7 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt @@ -1,32 +1,34 @@ package band.effective.office.tablet.network.api +import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.model.WebServerEvent import kotlinx.coroutines.CoroutineScope import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch +import java.util.Calendar +import java.util.GregorianCalendar class WorkApi : Api { val mutableRoomInfo = MutableStateFlow(RoomInfo.defaultValue) - val mutableOrgList = MutableStateFlow(listOf("a", "b", "c")) + val mutableOrgList = + MutableStateFlow(listOf("Ольга Белозерова", "Матвей Авгуль", "Лилия Акентьева")) + override suspend fun getRoomInfo(): RoomInfo { - delay(1000L) return mutableRoomInfo.value } override suspend fun getOrganizers(): List { - delay(1000L) return mutableOrgList.value } override suspend fun cancelEvent(): Boolean { - delay(1000L) return false } override suspend fun bookingRoom(): Boolean { - delay(1000L) return false } @@ -34,7 +36,96 @@ class WorkApi : Api { scope: CoroutineScope, handler: (event: WebServerEvent) -> Unit ) { - scope.launch { mutableRoomInfo.collect { handler(WebServerEvent.RoomInfoUpdate) } } - scope.launch { mutableOrgList.collect { handler(WebServerEvent.OrganizerInfoUpdate) } } + scope.launch { + mutableRoomInfo.collect { handler(WebServerEvent.RoomInfoUpdate) } + } + scope.launch { + mutableOrgList.collect { + handler(WebServerEvent.OrganizerInfoUpdate) + } + } + } + + private val startCurrentEvent: Calendar + private val finishCurrentEvent: Calendar + + /**It's field contain time for mocks, when it is used it needs to be increment, so that different mocks have different times*/ + private val currentTime: Calendar + + init { + val calendar = GregorianCalendar() + calendar.add(Calendar.MINUTE, -10) + startCurrentEvent = calendar.clone() as Calendar + calendar.add(Calendar.MINUTE, 30) + finishCurrentEvent = calendar.clone() as Calendar + currentTime = calendar.clone() as Calendar + + mutableRoomInfo.update { + RoomInfo( + name = "Sirius", + capacity = 4, + isHaveTv = false, + electricSocketCount = 2, + eventList = eventsList(), + currentEvent = currentEvent() + ) + } + } + + private fun getTime(): Calendar { + currentTime.add(Calendar.MINUTE, 30) + return currentTime.clone() as Calendar + } + + private fun currentEvent() = EventInfo( + startTime = startCurrentEvent, + finishTime = finishCurrentEvent, + organizer = "Ольга Белозерова" + ) + + private fun olyaEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), + organizer = "Ольга Белозерова" + ) + + private fun matveyEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), + organizer = "Матвей Авгуль" + ) + + private fun lilaEvent() = EventInfo( + startTime = getTime(), + finishTime = getTime(), + organizer = "Лилия Акентьева" + ) + + private fun eventsList() = listOf(olyaEvent(), matveyEvent(), lilaEvent()) + + private fun bigEventList() = + eventsList() + eventsList() + eventsList() + eventsList() + eventsList() + + fun changeBusy(newValue: Boolean) { + if (newValue) { + mutableRoomInfo.update { it.copy(currentEvent = null) } + } else { + mutableRoomInfo.update { it.copy(currentEvent = currentEvent()) } + } + } + + fun changeEventCount(isMany: Boolean) { + updateCurrentTime() + if (isMany) { + mutableRoomInfo.update { it.copy(eventList = bigEventList()) } + } else { + mutableRoomInfo.update { it.copy(eventList = eventsList()) } + } + } + + private fun updateCurrentTime() { + val calendar = GregorianCalendar() + calendar.add(Calendar.MINUTE, 20) + currentTime.time = calendar.time } } \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt index 49251e31..72b410cd 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/repository/impl/ServerUpdateRepositoryImpl.kt @@ -13,8 +13,8 @@ class ServerUpdateRepositoryImpl(private val api: Api) : ServerUpdateRepository ) { api.subscribeOnWebHock(scope) { event -> when (event) { - WebServerEvent.OrganizerInfoUpdate -> organizersListUpdateHandler() - WebServerEvent.RoomInfoUpdate -> roomInfoUpdateHandler() + is WebServerEvent.OrganizerInfoUpdate -> organizersListUpdateHandler() + is WebServerEvent.RoomInfoUpdate -> roomInfoUpdateHandler() } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 634a3392..9cff7774 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -29,8 +29,7 @@ class RealMainComponent( override val mockSettingsComponent: MockSettingsComponent = RealMockSettingsComponent( - componentContext = childContext(key = "mock"), - updateData = { /*updateData()*/ } + componentContext = childContext(key = "mock") ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 19f38af7..1c557f3b 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -26,7 +26,7 @@ import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents. @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreenView( - room: band.effective.office.tablet.domain.model.RoomInfo, + room: RoomInfo, mockComponent: MockSettingsComponent, bookingRoomComponent: BookingRoomComponent ) { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 24a75310..3728a41a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import android.util.Log import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.useCase.CheckBookingUseCase import band.effective.office.tablet.domain.useCase.UpdateUseCase @@ -45,6 +46,20 @@ class RealBookingRoomComponent( mutableState.update { it.copy(roomName = roomName) } updateSelectTime() update() + componentCoroutineScope().launch { + updateUseCase(scope = componentCoroutineScope(), roomUpdateHandler = { + componentContext.componentCoroutineScope().launch { + mutableState.update { + it.copy( + organizers = updateUseCase.getOrganizersList(), + isBusy = !checkBookingUseCase(state.value.toEvent()), + busyEvent = checkBookingUseCase.busyEvent(state.value.toEvent()) + ?: EventInfo.emptyEvent, + ) + } + } + }, organizerUpdateHandler = {}) + } } override fun sendEvent(event: BookingRoomViewEvent) { @@ -63,9 +78,9 @@ class RealBookingRoomComponent( mutableState.update { it.copy( organizers = updateUseCase.getOrganizersList(), - isBusy = checkBookingUseCase(state.value.toEvent()), + isBusy = !checkBookingUseCase(state.value.toEvent()), busyEvent = checkBookingUseCase.busyEvent(state.value.toEvent()) - ?: band.effective.office.tablet.domain.model.EventInfo.emptyEvent, + ?: EventInfo.emptyEvent, ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt index 986fa696..5e0f65c4 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt @@ -52,12 +52,6 @@ fun MockSettingView(component: MockSettingsComponent) { text = "Есть tv" ) } - - Item( - checked = state.isBusyTime, - onCheckedChange = { component.sendEvent(MockSettingsEvent.OnSwitchBusyTime(it)) }, - text = "Невожможно забронировть" - ) } } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt index b6de0548..ccce7a4f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt @@ -4,7 +4,6 @@ sealed interface MockSettingsEvent{ data class OnSwitchEventCount(val newState: Boolean): MockSettingsEvent data class OnSwitchBusy(val newState: Boolean): MockSettingsEvent data class OnSwitchTv(val newState: Boolean): MockSettingsEvent - data class OnSwitchBusyTime(val newState: Boolean): MockSettingsEvent object OnSwitchVisible: MockSettingsEvent } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt index 0d8fe589..50339853 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt @@ -9,40 +9,32 @@ import org.koin.core.component.KoinComponent import org.koin.core.component.inject class RealMockSettingsComponent( - componentContext: ComponentContext, - private val updateData: () -> Unit + componentContext: ComponentContext ) : ComponentContext by componentContext, KoinComponent, MockSettingsComponent { private var mutableState = MutableStateFlow(MockState()) override val state = mutableState.asStateFlow() private val mockController: MockController by inject() - init { - reloadData() - } + override fun sendEvent(event: MockSettingsEvent) { + when (event) { + is MockSettingsEvent.OnSwitchBusy -> { + mockController.changeBusy(event.newState) + mutableState.update { it.copy(isBusy = event.newState) } + } - /**Synchronize data in mock controller and in state*/ - private fun reloadData() { - /*mutableState.update { - it.copy( - isBusy = mockController.isBusy, - isManyEvent = mockController.isManyEvent, - isHaveTv = mockController.isHaveTV, - isBusyTime = mockController.isBusyTime - ) - }*/ - } + is MockSettingsEvent.OnSwitchEventCount -> { + mockController.changeEventCount(event.newState) + mutableState.update { it.copy(isManyEvent = event.newState) } + } + + is MockSettingsEvent.OnSwitchTv -> { + mockController.changeHaveTv(event.newState) + mutableState.update { it.copy(isHaveTv = event.newState) } + } - override fun sendEvent(event: MockSettingsEvent) { - /*when (event) { - is MockSettingsEvent.OnSwitchBusy -> mockController.isBusy = event.newState - is MockSettingsEvent.OnSwitchEventCount -> mockController.isManyEvent = event.newState - is MockSettingsEvent.OnSwitchTv -> mockController.isHaveTV = event.newState - is MockSettingsEvent.OnSwitchBusyTime -> mockController.isBusyTime = event.newState is MockSettingsEvent.OnSwitchVisible -> mutableState.update { it.copy(isVisible = !it.isVisible) } } - reloadData() - updateData()*/ } } \ No newline at end of file -- GitLab From 2c92beb44c238b9a1eb595b30812e5e2d04b2add Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 10 Jul 2023 01:49:55 +0600 Subject: [PATCH 36/63] A class was created containing different levels of headings in the form of fields of the TextStyle type. Tweaked color palettes --- .../effective/office/tablet/ui/theme/Color.kt | 71 +++++++-- .../effective/office/tablet/ui/theme/Theme.kt | 140 +++++++++++++++--- .../office/tablet/ui/theme/Typography.kt | 13 ++ 3 files changed, 188 insertions(+), 36 deletions(-) create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt index 89e6000f..1ad874a8 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt @@ -2,15 +2,62 @@ package band.effective.office.tablet.ui.theme import androidx.compose.ui.graphics.Color -internal val md_theme_dark_primary = Color(0xFFEF7234) -internal val md_theme_dark_onPrimary = Color(0xFFFAFAFA) -internal val md_theme_dark_primaryContainer = Color(0xFF004E5C) -internal val md_theme_dark_secondary = Color(0xFFA362F8) -internal val md_theme_dark_onSecondary = Color(0xFF00373A) -internal val md_theme_dark_secondaryContainer = Color(0xFF004F53) -internal val md_theme_dark_error = Color(0xFFEB4C2A) -internal val md_theme_dark_onError = Color(0xFF690005) -internal val md_theme_dark_background = Color(0xFF1E1C1A) -internal val md_theme_dark_onBackground = Color(0xFFFFE264) -internal val md_theme_dark_surface = Color(0xFF252322) -internal val md_theme_dark_onSurface = Color(0xFFFFFFFF) \ No newline at end of file +internal val md_theme_dark_onPrimary = Color(0xFFEE7234) +internal val md_theme_dark_onSecondary = Color(0xFFA262F7) +internal val md_theme_dark_primaryBackground = Color(0xFF1E1C1A) +internal val md_theme_dark_surfaceBackground = Color(0xFF252322) +internal val md_theme_dark_elevationBackground = Color(0xFF302D2C) +internal val md_theme_dark_mountainBackground = Color(0xFF3A3736) +internal val md_theme_dark_busyStatus = Color(0xFFF84C4C) +internal val md_theme_dark_freeStatus = Color(0xFF36C85F) +internal val md_theme_dark_onError = Color(0xFFEA4C2A) +internal val md_theme_dark_onSuccess = Color(0xFF25C050) +internal val md_theme_dark_secondaryButton = Color(0xFFFEFEFE) +internal val md_theme_dark_primaryTextAndIcon = Color(0xFFF9F9F9) +internal val md_theme_dark_secondaryTextAndIcon = Color(0xFF7F7F7F) +internal val md_theme_dark_tertiaryTextAndIcon = Color(0xFF777777) +internal val md_theme_dark_pressedPrimaryButton = Color(0xFFEC6521) +internal val md_theme_dark_disabledPrimaryButton = Color(0xFF342C28) + + +internal val md_theme_light_onPrimary = Color(0xFFE55A0F) +internal val md_theme_light_onSecondary = Color(0xFF6E00FE) +internal val md_theme_light_primaryBackground = Color(0xFFFEFEFE) +internal val md_theme_light_surfaceBackground = Color(0xFFF9F9F9) +internal val md_theme_light_elevationBackground = Color(0xFFEFEFEF) +internal val md_theme_light_mountainBackground = Color(0xFFEFEFEF) +internal val md_theme_light_busyStatus = Color(0xFFF84343) +internal val md_theme_light_freeStatus = Color(0xFF36C85F) +internal val md_theme_light_onError = Color(0xFFEA4C2A) +internal val md_theme_light_onSuccess = Color(0xFF25C050) +internal val md_theme_light_secondaryButton = Color(0xFFE55A0F) +internal val md_theme_light_primaryTextAndIcon = Color(0xFF1F1814) +internal val md_theme_light_secondaryTextAndIcon = Color(0xFF747474) +internal val md_theme_light_tertiaryTextAndIcon = Color(0xFF979797) +internal val md_theme_light_pressedPrimaryButton = Color(0xFFED6F2F) +internal val md_theme_light_disabledPrimaryButton = Color(0xFFD1C9C5) + + +data class AppThemeColors( + val onPrimary: Color, + val onSecondary: Color, + + val primaryBackground: Color, + val surfaceBackground: Color, + val elevationBackground: Color, + val mountainBackground: Color, + + val busyStatus: Color, + val freeStatus: Color, + + val onError: Color, + val onSuccess: Color, + + val secondaryButton: Color, + val primaryTextAndIcon: Color, + val secondaryTextAndIcon: Color, + val tertiaryTextAndIcon: Color, + + val pressedPrimaryButton: Color, + val disabledPrimaryButton: Color +) \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt index 8b423a53..0d6b3d2d 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -1,42 +1,134 @@ package band.effective.office.tablet.ui.theme import androidx.compose.foundation.isSystemInDarkTheme -import androidx.compose.material.MaterialTheme import androidx.compose.material.Surface -import androidx.compose.material.Typography -import androidx.compose.material.darkColors -import androidx.compose.ui.text.font.FontFamily import androidx.compose.runtime.Composable +import androidx.compose.runtime.CompositionLocalProvider +import androidx.compose.runtime.staticCompositionLocalOf +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp -private val DarkColors = darkColors( - primary = md_theme_dark_primary, - primaryVariant = md_theme_dark_primaryContainer, - secondary = md_theme_dark_secondary, - secondaryVariant = md_theme_dark_secondaryContainer, - background = md_theme_dark_background, - surface = md_theme_dark_surface, - error = md_theme_dark_error, +private val DarkColors = AppThemeColors( onPrimary = md_theme_dark_onPrimary, onSecondary = md_theme_dark_onSecondary, - onBackground = md_theme_dark_onBackground, - onSurface = md_theme_dark_onSurface, - onError = md_theme_dark_onError + primaryBackground = md_theme_dark_primaryBackground, + surfaceBackground = md_theme_dark_surfaceBackground, + elevationBackground = md_theme_dark_elevationBackground, + mountainBackground = md_theme_dark_mountainBackground, + busyStatus = md_theme_dark_busyStatus, + freeStatus = md_theme_dark_freeStatus, + onError = md_theme_dark_onError, + onSuccess = md_theme_dark_onSuccess, + secondaryButton = md_theme_dark_secondaryButton, + primaryTextAndIcon = md_theme_dark_primaryTextAndIcon, + secondaryTextAndIcon = md_theme_dark_secondaryTextAndIcon, + tertiaryTextAndIcon = md_theme_dark_tertiaryTextAndIcon, + pressedPrimaryButton = md_theme_dark_pressedPrimaryButton, + disabledPrimaryButton = md_theme_dark_disabledPrimaryButton ) +private val LightColors = AppThemeColors( + onPrimary = md_theme_light_onPrimary, + onSecondary = md_theme_light_onSecondary, + primaryBackground = md_theme_light_primaryBackground, + surfaceBackground = md_theme_light_surfaceBackground, + elevationBackground = md_theme_light_elevationBackground, + mountainBackground = md_theme_light_mountainBackground, + busyStatus = md_theme_light_busyStatus, + freeStatus = md_theme_light_freeStatus, + onError = md_theme_light_onError, + onSuccess = md_theme_light_onSuccess, + secondaryButton = md_theme_light_secondaryButton, + primaryTextAndIcon = md_theme_light_primaryTextAndIcon, + secondaryTextAndIcon = md_theme_light_secondaryTextAndIcon, + tertiaryTextAndIcon = md_theme_light_tertiaryTextAndIcon, + pressedPrimaryButton = md_theme_light_pressedPrimaryButton, + disabledPrimaryButton = md_theme_light_disabledPrimaryButton +) +object AppTheme { + val colors: AppThemeColors + @Composable + get() = LocalColors.current + + val typography: AppThemeTypography + @Composable + get() = LocalTypography.current +} + +val LocalColors = staticCompositionLocalOf { + error("No colors provided") +} + +val LocalTypography = staticCompositionLocalOf { + error("No typography provided") +} + @Composable internal fun AppTheme( useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit ) { val colors = DarkColors - val typography = Typography(defaultFontFamily = FontFamily.Default) + val typography = AppThemeTypography( + header1 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 56.sp, + lineHeight = 56.sp * 1.5f, + letterSpacing = 56.sp * 0.02f + ), + header2 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 48.sp, + lineHeight = 48.sp * 1.5f, + letterSpacing = 48.sp * 0.02f + ), + header3 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 36.sp, + lineHeight = 36.sp * 1.5f, + letterSpacing = 36.sp * 0.02f + ), + header4 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 28.sp, + lineHeight = 28.sp * 1.5f, + letterSpacing = 28.sp * 0.02f + ), + header5 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 24.sp, + lineHeight = 24.sp * 1.5f, + letterSpacing = 24.sp * 0.02f + ), + header6 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 20.sp, + lineHeight = 20.sp * 1.5f, + letterSpacing = 20.sp * 0.02f + ), + header7 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 18.sp, + lineHeight = 18.sp * 1.5f, + letterSpacing = 18.sp * 0.02f + ), + ) - MaterialTheme( - colors = colors, - typography = typography, - content = { - Surface(content = content) - } - ) -} \ No newline at end of file + CompositionLocalProvider( + LocalColors provides colors, + LocalTypography provides typography + ) { + Surface (content = content) + } + +} diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt new file mode 100644 index 00000000..836ce50c --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt @@ -0,0 +1,13 @@ +package band.effective.office.tablet.ui.theme + +import androidx.compose.ui.text.TextStyle + +data class AppThemeTypography( + val header1: TextStyle, + val header2: TextStyle, + val header3: TextStyle, + val header4: TextStyle, + val header5: TextStyle, + val header6: TextStyle, + val header7: TextStyle +) -- GitLab From 203581600601f163920e2247fbaa7c4f24366b88 Mon Sep 17 00:00:00 2001 From: Margarita Date: Mon, 10 Jul 2023 05:42:42 +0600 Subject: [PATCH 37/63] [+] closing modal, mocks, length calculation bug fixed --- .../kotlin/tablet/domain/MockBooking.kt | 49 +++++++ .../RealSelectRoomComponent.kt | 8 +- .../selectRoomScreen/SelectRoomComponent.kt | 2 - .../ui/selectRoomScreen/SelectRoomScreen.kt | 111 +------------- .../ui/selectRoomScreen/SelectRoomView.kt | 135 ++++++++++++++++++ .../uiComponents/BookingButtonView.kt | 16 ++- .../uiComponents/CrossButtonView.kt | 39 +++++ .../uiComponents/DateTimeView.kt | 25 +--- .../uiComponents/LengthEventView.kt | 11 +- .../uiComponents/OrganizerEventView.kt | 4 +- .../uiComponents/TitleModal.kt | 29 ++++ .../tablet/utils/ConvertCalendarToTime.kt | 10 ++ .../src/commonMain/libres/images/cross.svg | 3 + .../commonMain/libres/strings/strings_ru.xml | 2 + .../src/main/res/drawable/cross.xml | 4 - .../office/tablet/ui/root/RootComponent.kt | 14 +- 16 files changed, 299 insertions(+), 163 deletions(-) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg delete mode 100644 tabletApp/features/selectRoom/src/main/res/drawable/cross.xml diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt new file mode 100644 index 00000000..6ad5aff4 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt @@ -0,0 +1,49 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import java.util.Calendar + +object MockBooking { + val bookingCheckTime15min = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 4, 20, 15, 20), + finishTime = setTime(2023, 4, 20, 15, 35), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckTime1h = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 11, 11, 15, 20), + finishTime = setTime(2023, 11, 11, 16, 20), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckTime1h15min = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 11, 11, 15, 20), + finishTime = setTime(2023, 11, 11, 16, 35), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckOrganizer = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 1, 7, 9, 20), + finishTime = setTime(2023, 1, 7, 11, 35), + organizer = "Абдурахмангаджи Константинопольский" + ) + ) + + private fun setTime(y: Int, m: Int, d: Int, h: Int, min: Int): Calendar { + val currentTime = Calendar.getInstance() + currentTime.set(y, m, d, h, min) + return currentTime + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt index 1de4be7e..12451cc4 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -9,21 +9,15 @@ import tablet.domain.ISelectRoomInteractor import tablet.domain.model.Booking class RealSelectRoomComponent(componentContext: ComponentContext, - booking: Booking) + val booking: Booking) : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ private val interactor: ISelectRoomInteractor by inject() - val booking = booking private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) override val state = _state.asStateFlow() override fun bookRoom() { - TODO("Not yet implemented") - } - - override fun close() { - TODO("Not yet implemented") } } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index cdfdf472..498c251b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -5,7 +5,5 @@ import tablet.domain.model.Booking interface SelectRoomComponent { val state: StateFlow - fun bookRoom() - fun close() } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index 3e3e811b..b1bed1ea 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,37 +1,8 @@ package tablet.ui.selectRoomScreen -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import androidx.compose.ui.window.Dialog -import androidx.compose.ui.window.DialogProperties -import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView -import tablet.ui.selectRoomScreen.uiComponents.DateTimeView -import tablet.ui.selectRoomScreen.uiComponents.LengthEventView -import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView -import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun SelectRoomScreen(component: RealSelectRoomComponent){ @@ -39,7 +10,8 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ when{ state.isData -> { - SelectRoomView(component) + // SelectRoomView(component) + CheckButton(component) } state.isLoad -> { @@ -53,83 +25,4 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ } } -} - -@Composable -fun SelectRoomView( - component: RealSelectRoomComponent -){ - val modifier = Modifier.background(Color(0xFF3A3736)) - val shape = RoundedCornerShape(16) - - - Dialog( - onDismissRequest = {} - ) - { - Box( - modifier = Modifier - .size(575.dp, 510.dp) - .clip(RoundedCornerShape(5)) - .background(Color(0xFF302D2C)), - contentAlignment = Alignment.Center - ) { - Column{ - Text( - modifier = Modifier.width(415.dp), - text = "Занять ${component.booking.nameRoom}?", - fontSize = 28.sp, - fontWeight = FontWeight(500), - fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA), - textAlign = TextAlign.Center - ) - Spacer(modifier = Modifier.height(24.dp)) - TitleFieldView( - modifier = Modifier.width(415.dp), - title = "когда" - ) - Spacer(modifier = Modifier.height(16.dp)) - DateTimeView( - modifier = modifier.height(64.dp).width(415.dp), - shape = shape, - booking = component.booking - ) - Spacer(modifier = Modifier.height(24.dp)) - Row { - Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { - TitleFieldView( - modifier = Modifier.width(156.dp), - title = "на сколько" - ) - LengthEventView( - modifier = modifier.height(64.dp).width(156.dp), - shape = shape, - booking = component.booking - ) - } - Spacer(modifier = Modifier.width(16.dp)) - Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { - TitleFieldView( - modifier = Modifier.width(243.dp), - title = "организатор" - ) - OrganizerEventView( - modifier = modifier.height(64.dp).width(243.dp), - shape = shape, - booking = component.booking - ) - } - } - Spacer(modifier = Modifier.height(40.dp)) - BookingButtonView( - modifier = Modifier.height(64.dp).width(415.dp), - color = Color(0xFFEF7234), - shape = RoundedCornerShape(40), - booking = component.booking - ) - } - } - } - } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt new file mode 100644 index 00000000..c3b21f2a --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt @@ -0,0 +1,135 @@ +package tablet.ui.selectRoomScreen + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import tablet.ui.selectRoomScreen.uiComponents.CrossButtonView +import tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import tablet.ui.selectRoomScreen.uiComponents.Title +import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView + +@Composable +fun CheckButton(component: RealSelectRoomComponent) { + val showDialog = remember { mutableStateOf(false) } + Button( + onClick = { showDialog.value = true } + ) { + Text( + text = "check", + ) + } + + if(showDialog.value){ + SelectRoomView(component, showDialog) + } +} + +@Composable +fun SelectRoomView( + component: RealSelectRoomComponent, + showDialog: MutableState +) { + // val showDialog = remember { mutableStateOf(true) } + val modifier = Modifier.background(Color(0xFF3A3736)) + val shape = RoundedCornerShape(16) + + if (!showDialog.value) return + + Dialog( + onDismissRequest = { showDialog.value = false } + ) + { + Box( + modifier = Modifier + .size(575.dp, 510.dp) + .clip(RoundedCornerShape(5)) + .background(Color(0xFF302D2C)), + ) { + Column( + modifier = Modifier.matchParentSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Spacer(modifier = Modifier.height(30.dp)) + CrossButtonView( + Modifier.width(575.dp), + onDismissRequest = { showDialog.value = false } + ) + Title(component) + Spacer(modifier = Modifier.height(24.dp)) + TitleFieldView( + modifier = Modifier.width(415.dp), + title = MainRes.string.whenEvent + ) + Spacer(modifier = Modifier.height(16.dp)) + DateTimeView( + modifier = modifier.height(64.dp).width(415.dp), + shape = shape, + booking = component.booking + ) + Spacer(modifier = Modifier.height(24.dp)) + RowInfoLengthAndOrganizer(modifier, shape, component) + Spacer(modifier = Modifier.height(40.dp)) + BookingButtonView( + modifier = Modifier.height(64.dp).width(415.dp), + color = Color(0xFFEF7234), + shape = RoundedCornerShape(40), + booking = component.booking + ) + Spacer(modifier = Modifier.height(80.dp)) + } + } + } +} + +@Composable +fun RowInfoLengthAndOrganizer(modifier: Modifier, shape: RoundedCornerShape, component: RealSelectRoomComponent){ + Row { + Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { + TitleFieldView( + modifier = Modifier.width(156.dp), + title = MainRes.string.how_much + ) + LengthEventView( + modifier = modifier.height(64.dp).width(156.dp), + shape = shape, + booking = component.booking + ) + } + Spacer(modifier = Modifier.width(16.dp)) + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(243.dp), + title = MainRes.string.organizer + ) + OrganizerEventView( + modifier = modifier.height(64.dp).width(243.dp), + shape = shape, + booking = component.booking + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt index 31a2344e..3613b943 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -1,8 +1,6 @@ package tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults @@ -15,10 +13,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking +import tablet.utils.time24 @Composable fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { @@ -34,11 +32,15 @@ fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShap Box(contentAlignment = Alignment.Center) { Text( - text = "Занять с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + text = MainRes.string.booking_time_button.format( + startTime = booking.eventInfo.startTime.time24(), + finishTime = booking.eventInfo.finishTime.time24() + ), fontSize = 20.sp, fontWeight = FontWeight(500), - fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA) + color = Color(0xFFFAFAFA), + letterSpacing = 0.1.sp, + fontFamily = FontFamily.SansSerif ) } } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt new file mode 100644 index 00000000..d1dfc7e0 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt @@ -0,0 +1,39 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.background +import androidx.compose.material.Icon +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.IconButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.unit.dp +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.domain.model.Booking + +@Composable +fun CrossButtonView(modifier: Modifier, onDismissRequest:() -> Unit) { + + Box( + modifier = modifier.padding(end = 54.dp), + contentAlignment = Alignment.CenterEnd + ) { + IconButton( + onClick = { onDismissRequest() }, + modifier = Modifier + .size(40.dp) + ) { + Icon( + imageVector = ImageVector.vectorResource(MainRes.image.cross), + contentDescription = "Cross", + modifier = Modifier.size(25.dp), + tint = Color(0xFF808080) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt index fd2a29a3..83140c52 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -1,8 +1,5 @@ package tablet.ui.selectRoomScreen.uiComponents -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -13,18 +10,15 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.LineHeightStyle -import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Locale +import tablet.utils.date +import tablet.utils.time24 @Composable fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { @@ -48,7 +42,10 @@ fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking Spacer(modifier = Modifier.width(5.dp)) Text( - text = "с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + text = MainRes.string.booking_time.format( + startTime = booking.eventInfo.startTime.time24(), + finishTime = booking.eventInfo.finishTime.time24() + ), fontSize = 20.sp, fontWeight = FontWeight(500), fontFamily = FontFamily.SansSerif, @@ -59,11 +56,3 @@ fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking } } - -private fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + - SimpleDateFormat("MMMM", Locale("ru")).format(this.time) - -fun Calendar.time24() = SimpleDateFormat( - "HH:mm", - Locale("ru") -).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt index 589b774f..d55125c8 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -12,6 +12,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking import java.util.Calendar @@ -21,8 +22,11 @@ fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Book val hours = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) / 60 val minutes = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) % 60 val lengthEvent: String = when(hours){ - 0 -> "$minutes мин" - else -> "${hours}ч ${minutes}мин" + 0 -> MainRes.string.minutes.format( minutes = minutes.toString()) + else -> MainRes.string.hours_minutes.format( + hours = hours.toString(), + minutes = minutes.toString() + ) } Card( @@ -45,4 +49,5 @@ fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Book } private fun getLengthEvent(start: Calendar, finish: Calendar) = - finish.get(Calendar.MINUTE) - start.get(Calendar.MINUTE) \ No newline at end of file + (finish.get(Calendar.HOUR) * 60 + finish.get(Calendar.MINUTE)) - + (start.get(Calendar.HOUR) * 60 + start.get(Calendar.MINUTE)) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt index 4a317e25..fe8ecb6b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp import tablet.domain.model.Booking @@ -27,7 +28,8 @@ fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: B fontWeight = FontWeight(700), fontSize = 20.sp, fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA) + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center ) } } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt new file mode 100644 index 00000000..ba1f0ea3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.width +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.ui.selectRoomScreen.RealSelectRoomComponent + +@Composable +fun Title(component: RealSelectRoomComponent){ + Text( + modifier = Modifier.width(415.dp), + text = MainRes.string.title_booking_dialog.format( + nameRoom = component.booking.nameRoom + ), + fontSize = 28.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center + ) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt new file mode 100644 index 00000000..0879e1b3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt @@ -0,0 +1,10 @@ +package tablet.utils + +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Locale + +fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + + SimpleDateFormat("MMMM", Locale("ru")).format(this.time) + +fun Calendar.time24() = SimpleDateFormat("HH:mm", Locale("ru")).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg b/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg new file mode 100644 index 00000000..626d0499 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg @@ -0,0 +1,3 @@ + + + diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml index a5e70883..281a0ebf 100644 --- a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml +++ b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml @@ -6,4 +6,6 @@ когда на сколько организатор + ${minutes} мин + ${hours}ч ${minutes}мин \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml deleted file mode 100644 index 336fd8bb..00000000 --- a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 0be3fc5d..25ec0e75 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -7,10 +7,8 @@ import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo +import tablet.domain.MockBooking import tablet.ui.selectRoomScreen.RealSelectRoomComponent -import java.util.Calendar class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -41,15 +39,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co Child.SelectRoomChild( RealSelectRoomComponent( componentContext, - Booking - ("Sirius", - EventInfo - ( - Calendar.getInstance(), - Calendar.getInstance(), - "Ольга Белозёрова" - ) - ) + MockBooking.bookingCheckTime15min ) ) } -- GitLab From aff7cc00e9fe715ca2a490f452ca762181ba2fb4 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 10 Jul 2023 12:39:54 +0600 Subject: [PATCH 38/63] [~] add booking dialog in main screen --- tabletApp/features/roomInfo/build.gradle.kts | 4 ++ .../office/tablet/di/InitRoomInfoKoin.kt | 2 +- .../office/tablet/domain/model/EventInfo.kt | 4 +- .../tablet/ui/mainScreen/MainComponent.kt | 2 + .../office/tablet/ui/mainScreen/MainScreen.kt | 6 ++- .../tablet/ui/mainScreen/MainScreenEvent.kt | 3 +- .../tablet/ui/mainScreen/MainScreenState.kt | 6 ++- .../tablet/ui/mainScreen/RealMainComponent.kt | 16 +++++++- .../mainScreen/components/MainScreenView.kt | 38 ++++++++++++------- .../RealBookingRoomComponent.kt | 7 ++-- .../features/selectRoom/build.gradle.kts | 1 + .../office}/tablet/di/initSelectRoomKoin.kt | 3 +- .../office/tablet/di/SelectRoomModule.kt | 9 +++++ .../tablet/domain/ISelectRoomInteractor.kt | 8 ++++ .../office}/tablet/domain/MockBooking.kt | 6 +-- .../tablet/domain/SelectRoomInteractorImpl.kt | 10 +++++ .../office}/tablet/domain/model/Booking.kt | 2 +- .../office/tablet/domain/model/EventInfo.kt | 18 +++++++++ .../tablet/network/ISelectRoomRepository.kt | 8 ++++ .../RealSelectRoomComponent.kt | 18 ++++++--- .../selectRoomScreen/SelectRoomComponent.kt | 4 +- .../ui/selectRoomScreen/SelectRoomScreen.kt | 2 +- .../selectRoomScreen/SelectRoomScreenState.kt | 2 +- .../ui/selectRoomScreen/SelectRoomView.kt | 37 +++++++++--------- .../uiComponents/BookingButtonView.kt | 6 +-- .../uiComponents/CrossButtonView.kt | 4 +- .../uiComponents/DateTimeView.kt | 8 ++-- .../uiComponents/LengthEventView.kt | 4 +- .../uiComponents/OrganizerEventView.kt | 4 +- .../uiComponents/TitleFieldView.kt | 2 +- .../uiComponents/TitleModal.kt | 4 +- .../tablet/utils/ConvertCalendarToTime.kt | 2 +- .../kotlin/tablet/di/SelectRoomModule.kt | 9 ----- .../tablet/domain/ISelectRoomInteractor.kt | 8 ---- .../tablet/domain/SelectRoomInteractorImpl.kt | 9 ----- .../kotlin/tablet/domain/model/EventInfo.kt | 9 ----- .../tablet/network/ISelectRoomRepository.kt | 8 ---- .../effective/office/tablet/MainActivity.kt | 3 +- .../effective/office/tablet/ui/root/Root.kt | 2 +- .../office/tablet/ui/root/RootComponent.kt | 4 +- 40 files changed, 177 insertions(+), 125 deletions(-) rename tabletApp/features/selectRoom/src/androidMain/kotlin/{ => band/effective/office}/tablet/di/initSelectRoomKoin.kt (53%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/domain/MockBooking.kt (89%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/domain/model/Booking.kt (59%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt (50%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomComponent.kt (55%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomScreen.kt (91%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt (86%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomView.kt (79%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt (89%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt (93%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt (92%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt (85%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/utils/ConvertCalendarToTime.kt (87%) delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index 5129e305..a9d5ca66 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -41,12 +41,16 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + + implementation(project(":tabletApp:features:selectRoom")) } } val androidMain by getting { dependencies{ // Koin api(Dependencies.Koin.android) + + implementation(project(":tabletApp:features:selectRoom")) } } } diff --git a/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt index d18a61df..07f2ebf4 100644 --- a/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt +++ b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt @@ -3,5 +3,5 @@ package band.effective.office.tablet.di import org.koin.core.context.startKoin fun initRoomInfoKoin() = startKoin { - modules(commonModule) + modules(commonModule, selectRoomModule) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt index 888fea56..f228f4fa 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -3,7 +3,7 @@ package band.effective.office.tablet.domain.model import java.util.Calendar import java.util.GregorianCalendar -data class EventInfo( +/*data class EventInfo( val startTime: Calendar, val finishTime: Calendar, val organizer: String @@ -15,4 +15,4 @@ data class EventInfo( organizer = "" ) } -} +}*/ diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index 03297ff7..d44b7123 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -2,11 +2,13 @@ package band.effective.office.tablet.ui.mainScreen import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent import kotlinx.coroutines.flow.StateFlow interface MainComponent { val state: StateFlow val mockSettingsComponent: MockSettingsComponent val bookingRoomComponent: BookingRoomComponent + val selectRoomComponent: RealSelectRoomComponent fun sendEvent(event: MainScreenEvent) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index 1fa780f8..5c261769 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -11,14 +11,16 @@ import band.effective.office.tablet.ui.mainScreen.components.MainScreenView @Composable fun MainScreen(component: MainComponent) { val state by component.state.collectAsState() - when{ + when { state.isError -> {} state.isLoad -> {} state.isData -> { MainScreenView( room = state.roomInfo, + showBookingModal = state.showBookingModal, mockComponent = component.mockSettingsComponent, - bookingRoomComponent = component.bookingRoomComponent + bookingRoomComponent = component.bookingRoomComponent, + selectRoomComponent = component.selectRoomComponent ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt index d5e0da17..3a01dde2 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen sealed class MainScreenEvent { - object OnCLick: MainScreenEvent() + object OnBookingCurentRoomRequest: MainScreenEvent() + object OnBookingOtherRoomRequest: MainScreenEvent() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt index 7371ec82..cfd23191 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt @@ -8,7 +8,8 @@ data class MainScreenState( val isData: Boolean, val isError: Boolean, val roomInfo: RoomInfo, - val error: String + val error: String, + val showBookingModal: Boolean ) { companion object { val defaultState = @@ -17,7 +18,8 @@ data class MainScreenState( isData = false, isError = false, roomInfo = RoomInfo.defaultValue, - error = "" + error = "", + showBookingModal = false ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 98ceaade..b0a9820a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -1,10 +1,12 @@ package band.effective.office.tablet.ui.mainScreen +import band.effective.office.tablet.domain.MockBooking import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealBookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import kotlinx.coroutines.flow.MutableStateFlow @@ -30,9 +32,15 @@ class RealMainComponent( ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), - onSelectOtherRoom = { OnSelectOtherRoomRequest() }, + onBookingRoom = { sendEvent(it) }, roomName = "Sirius" ) + override val selectRoomComponent: RealSelectRoomComponent = + RealSelectRoomComponent( + componentContext = childContext(key = "bookingCurrentRoom"), + booking = MockBooking.bookingCheckTime15min, + onCloseRequest = { mutableState.update { it.copy(showBookingModal = false) } } + ) init { updateData() @@ -51,7 +59,11 @@ class RealMainComponent( override fun sendEvent(event: MainScreenEvent) = when (event) { - is MainScreenEvent.OnCLick -> { + is MainScreenEvent.OnBookingCurentRoomRequest -> { + mutableState.update { it.copy(showBookingModal = true) } + } + + is MainScreenEvent.OnBookingOtherRoomRequest -> { OnSelectOtherRoomRequest() } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 1c557f3b..c38e2151 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -22,30 +22,42 @@ import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponen import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingView import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomInfoComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomView @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreenView( room: RoomInfo, + showBookingModal: Boolean, mockComponent: MockSettingsComponent, - bookingRoomComponent: BookingRoomComponent + bookingRoomComponent: BookingRoomComponent, + selectRoomComponent: RealSelectRoomComponent ) { - /*NOTE(Maksim Mishenko): + Box(modifier = Modifier.fillMaxSize()) { + /*NOTE(Maksim Mishenko): * infoViewWidth is part of the width occupied by roomInfoView * infoViewWidth = infoViewFrame.width / mainScreenFrame.width * where infoViewFrame, mainScreenFrame is frames from figma and all width I get from figma*/ - val infoViewWidth = 627f / 1133f - Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { - RoomInfoComponent( - modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), - room = room - ) - Box(modifier = Modifier.fillMaxSize()) { - BookingRoomView( - modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize().padding(25.dp), - bookingRoomComponent = bookingRoomComponent + val infoViewWidth = 627f / 1133f + Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { + RoomInfoComponent( + modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), + room = room ) - MockSettingView(mockComponent) + Box(modifier = Modifier.fillMaxSize()) { + BookingRoomView( + modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize() + .padding(25.dp), + bookingRoomComponent = bookingRoomComponent + ) + MockSettingView(mockComponent) + } + } + Box(modifier = Modifier.fillMaxSize()) { + if (showBookingModal) + SelectRoomView(component = selectRoomComponent) } } + } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 2e77125e..76887142 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -2,6 +2,7 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomCompone import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.ui.mainScreen.MainScreenEvent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import com.arkivanov.essenty.lifecycle.Lifecycle @@ -22,7 +23,7 @@ import java.util.GregorianCalendar class RealBookingRoomComponent( private val componentContext: ComponentContext, - private val onSelectOtherRoom: () -> Unit, + private val onBookingRoom: (MainScreenEvent) -> Unit, roomName: String ) : ComponentContext by componentContext, BookingRoomComponent, KoinComponent { @@ -53,11 +54,11 @@ class RealBookingRoomComponent( override fun sendEvent(event: BookingRoomViewEvent) { when (event) { is BookingRoomViewEvent.OnBookingCurrentRoom -> { - onSelectOtherRoom() + onBookingRoom(MainScreenEvent.OnBookingCurentRoomRequest) } is BookingRoomViewEvent.OnBookingOtherRoom -> { - onSelectOtherRoom() + onBookingRoom(MainScreenEvent.OnBookingOtherRoomRequest) } } } diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index 3f2d3d1c..8c7f4efc 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -40,6 +40,7 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + } } diff --git a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt b/tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt similarity index 53% rename from tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt rename to tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt index f0fca77e..30bfc57f 100644 --- a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt +++ b/tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt @@ -1,5 +1,6 @@ -package tablet.di +package band.effective.office.tablet.di +import band.effective.office.tablet.di.selectRoomModule import org.koin.core.context.startKoin fun initSelectRoomKoin() = startKoin { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt new file mode 100644 index 00000000..a4fda7ef --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.di + +import org.koin.dsl.module +import band.effective.office.tablet.domain.ISelectRoomInteractor +import band.effective.office.tablet.domain.SelectRoomInteractorImpl + +val selectRoomModule = module{ + single { SelectRoomInteractorImpl(get()) } +} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt new file mode 100644 index 00000000..16c84fcd --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo + +interface ISelectRoomInteractor { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt similarity index 89% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt index 6ad5aff4..6a073923 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt @@ -1,7 +1,7 @@ -package tablet.domain +package band.effective.office.tablet.domain -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar object MockBooking { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt new file mode 100644 index 00000000..e20e7048 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt @@ -0,0 +1,10 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.network.ISelectRoomRepository + +class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): + ISelectRoomInteractor { + override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt similarity index 59% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt index 3a81e0df..91345394 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt @@ -1,4 +1,4 @@ -package tablet.domain.model +package band.effective.office.tablet.domain.model data class Booking( val nameRoom: String, diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..65fbcc91 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -0,0 +1,18 @@ +package band.effective.office.tablet.domain.model + +import java.util.Calendar +import java.util.GregorianCalendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +){ + companion object{ + val emptyEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "" + ) + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt new file mode 100644 index 00000000..865247fc --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.network + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo + +interface ISelectRoomRepository { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt similarity index 50% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt index 12451cc4..d9a6c8db 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -1,16 +1,18 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import com.arkivanov.decompose.ComponentContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import org.koin.core.component.KoinComponent import org.koin.core.component.inject -import tablet.domain.ISelectRoomInteractor -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.ISelectRoomInteractor +import band.effective.office.tablet.domain.model.Booking -class RealSelectRoomComponent(componentContext: ComponentContext, - val booking: Booking) - : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ +class RealSelectRoomComponent( + componentContext: ComponentContext, + val booking: Booking, + private val onCloseRequest: () -> Unit +) : ComponentContext by componentContext, SelectRoomComponent, KoinComponent { private val interactor: ISelectRoomInteractor by inject() private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) @@ -20,4 +22,8 @@ class RealSelectRoomComponent(componentContext: ComponentContext, override fun bookRoom() { } + fun close() { + onCloseRequest() + } + } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt similarity index 55% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index 498c251b..a7e2ba39 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,7 +1,7 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import kotlinx.coroutines.flow.StateFlow -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking interface SelectRoomComponent { val state: StateFlow diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt similarity index 91% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index b1bed1ea..5967840e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt similarity index 86% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt index a0dc436d..9a09fb5f 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen data class SelectRoomScreenState( val isLoad: Boolean, diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt similarity index 79% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt index c3b21f2a..6003605e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -23,13 +23,13 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView -import tablet.ui.selectRoomScreen.uiComponents.CrossButtonView -import tablet.ui.selectRoomScreen.uiComponents.DateTimeView -import tablet.ui.selectRoomScreen.uiComponents.LengthEventView -import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView -import tablet.ui.selectRoomScreen.uiComponents.Title -import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.CrossButtonView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.Title +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun CheckButton(component: RealSelectRoomComponent) { @@ -42,24 +42,21 @@ fun CheckButton(component: RealSelectRoomComponent) { ) } - if(showDialog.value){ - SelectRoomView(component, showDialog) + if (showDialog.value) { + SelectRoomView(component) } } @Composable fun SelectRoomView( - component: RealSelectRoomComponent, - showDialog: MutableState + component: RealSelectRoomComponent ) { - // val showDialog = remember { mutableStateOf(true) } + // val showDialog = remember { mutableStateOf(true) } val modifier = Modifier.background(Color(0xFF3A3736)) val shape = RoundedCornerShape(16) - if (!showDialog.value) return - Dialog( - onDismissRequest = { showDialog.value = false } + onDismissRequest = { component.close() } ) { Box( @@ -76,7 +73,7 @@ fun SelectRoomView( Spacer(modifier = Modifier.height(30.dp)) CrossButtonView( Modifier.width(575.dp), - onDismissRequest = { showDialog.value = false } + onDismissRequest = { component.close() } ) Title(component) Spacer(modifier = Modifier.height(24.dp)) @@ -106,7 +103,11 @@ fun SelectRoomView( } @Composable -fun RowInfoLengthAndOrganizer(modifier: Modifier, shape: RoundedCornerShape, component: RealSelectRoomComponent){ +fun RowInfoLengthAndOrganizer( + modifier: Modifier, + shape: RoundedCornerShape, + component: RealSelectRoomComponent +) { Row { Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { TitleFieldView( diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt index 3613b943..b82bbb7b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -15,8 +15,8 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking -import tablet.utils.time24 +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.utils.time24 @Composable fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt index d1dfc7e0..ab21a65e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.background import androidx.compose.material.Icon @@ -14,7 +14,7 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking @Composable fun CrossButtonView(modifier: Modifier, onDismissRequest:() -> Unit) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt similarity index 89% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt index 83140c52..4cf008c1 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row @@ -16,9 +16,9 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking -import tablet.utils.date -import tablet.utils.time24 +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.utils.date +import band.effective.office.tablet.utils.time24 @Composable fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt similarity index 93% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt index d55125c8..616aaf6f 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -13,7 +13,7 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking import java.util.Calendar @Composable diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt index fe8ecb6b..a2585dd7 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -13,7 +13,7 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking @Composable fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt similarity index 92% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt index af465560..7a22a571 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt similarity index 85% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt index ba1f0ea3..a9aa93da 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.width import androidx.compose.material.Text @@ -11,7 +11,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.ui.selectRoomScreen.RealSelectRoomComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent @Composable fun Title(component: RealSelectRoomComponent){ diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt similarity index 87% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt index 0879e1b3..22157576 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt @@ -1,4 +1,4 @@ -package tablet.utils +package band.effective.office.tablet.utils import java.text.SimpleDateFormat import java.util.Calendar diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt deleted file mode 100644 index 32efc178..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.di - -import org.koin.dsl.module -import tablet.domain.ISelectRoomInteractor -import tablet.domain.SelectRoomInteractorImpl - -val selectRoomModule = module{ - single { SelectRoomInteractorImpl(get()) } -} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt deleted file mode 100644 index 22d5433d..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt +++ /dev/null @@ -1,8 +0,0 @@ -package tablet.domain - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo - -interface ISelectRoomInteractor { - suspend fun bookRoom(booking: Booking) -} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt deleted file mode 100644 index e7b69120..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.domain - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo -import tablet.network.ISelectRoomRepository - -class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): ISelectRoomInteractor { - override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) -} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt deleted file mode 100644 index c1c4627d..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.domain.model - -import java.util.Calendar - -data class EventInfo( - val startTime: Calendar, - val finishTime: Calendar, - val organizer: String -) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt deleted file mode 100644 index eb2dea3a..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt +++ /dev/null @@ -1,8 +0,0 @@ -package tablet.network - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo - -interface ISelectRoomRepository { - suspend fun bookRoom(booking: Booking) -} \ No newline at end of file diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index db3f3f99..63dfbb14 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -5,14 +5,13 @@ import androidx.appcompat.app.AppCompatActivity import androidx.activity.compose.setContent import band.effective.office.tablet.di.initRoomInfoKoin import com.arkivanov.decompose.defaultComponentContext -import tablet.di.initSelectRoomKoin +import band.effective.office.tablet.di.initSelectRoomKoin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) initRoomInfoKoin() setContent { - initSelectRoomKoin() App(defaultComponentContext()) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index d8d20b5f..31b22254 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen import band.effective.office.tablet.ui.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children -import tablet.ui.selectRoomScreen.SelectRoomScreen +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen @Composable fun Root(component: RootComponent) { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index cae223f0..eb968fed 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -8,8 +8,6 @@ import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.domain.MockBooking -import tablet.ui.selectRoomScreen.RealSelectRoomComponent class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -29,7 +27,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co is Config.Main -> { Child.MainChild(RealMainComponent( - componentContext = componentContext, + componentContext = componentContext, OnSelectOtherRoomRequest = { navigation.push(Config.SelectRoom) } -- GitLab From 46f1105ac8a318e364303a1cc30dbdec9671790e Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 10 Jul 2023 09:36:05 +0600 Subject: [PATCH 39/63] [~] fix --- .../office/tablet/domain/CurrentEventController.kt | 2 +- .../tablet/domain/CurrentEventControllerServerImpl.kt | 6 +++--- .../kotlin/band/effective/office/tablet/network/api/Api.kt | 2 +- .../bookingRoomComponents/RealBookingRoomComponent.kt | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt index 8fa49693..c27a6f59 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventController.kt @@ -15,7 +15,7 @@ abstract class CurrentEventController( ) { private lateinit var job: Job protected lateinit var scope: CoroutineScope - protected var currentEvent: band.effective.office.tablet.domain.model.EventInfo? = null + protected var currentEvent: EventInfo? = null protected val handlersList: MutableList<() -> Unit> = mutableListOf() fun start(scope: CoroutineScope) { diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt index 371dfa2a..9beb7e67 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/CurrentEventControllerServerImpl.kt @@ -6,9 +6,9 @@ import band.effective.office.tablet.network.repository.ServerUpdateRepository import kotlinx.coroutines.launch class CurrentEventControllerServerImpl( - private val roomUseCase: RoomInfoUseCase, - private val serverUpdateRepository: ServerUpdateRepository, - private val cancelRepository: CancelRepository + roomUseCase: RoomInfoUseCase, + serverUpdateRepository: ServerUpdateRepository, + cancelRepository: CancelRepository ) : CurrentEventController(roomUseCase, serverUpdateRepository, cancelRepository) { override fun update() = scope.launch {} } \ No newline at end of file diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt index fbd5008d..b8cbd69f 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/Api.kt @@ -5,7 +5,7 @@ import band.effective.office.tablet.network.model.WebServerEvent import kotlinx.coroutines.CoroutineScope interface Api { - //TODO("change return value") + //TODO(Maksim Mishenko): change return value suspend fun getRoomInfo(): RoomInfo suspend fun getOrganizers(): List suspend fun cancelEvent(): Boolean diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 3728a41a..6b33fdeb 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,6 +1,5 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents -import android.util.Log import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.useCase.CheckBookingUseCase import band.effective.office.tablet.domain.useCase.UpdateUseCase -- GitLab From b23443a1d1475f48d88a54fc6b9608538c033bd6 Mon Sep 17 00:00:00 2001 From: Margarita Date: Thu, 6 Jul 2023 10:46:10 +0600 Subject: [PATCH 40/63] write main structure and components --- buildSrc/hs_err_pid49948.log | 851 ++++++++++++++++++ .../features/selectRoom/build.gradle.kts | 12 + .../kotlin/tablet/di/initSelectRoomKoin.kt | 7 + .../kotlin/tablet/di/SelectRoomModule.kt | 9 + .../tablet/domain/ISelectRoomInteractor.kt | 8 + .../tablet/domain/SelectRoomInteractorImpl.kt | 9 + .../kotlin/tablet/domain/model/Booking.kt | 6 + .../kotlin/tablet/domain/model/EventInfo.kt | 9 + .../tablet/network/ISelectRoomRepository.kt | 8 + .../RealSelectRoomComponent.kt | 29 + .../selectRoomScreen/SelectRoomComponent.kt | 8 +- .../ui/selectRoomScreen/SelectRoomScreen.kt | 29 +- .../selectRoomScreen/SelectRoomScreenState.kt | 18 + .../effective/office/tablet/MainActivity.kt | 2 + .../office/tablet/ui/root/RootComponent.kt | 30 +- 15 files changed, 1022 insertions(+), 13 deletions(-) create mode 100644 buildSrc/hs_err_pid49948.log create mode 100644 tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt diff --git a/buildSrc/hs_err_pid49948.log b/buildSrc/hs_err_pid49948.log new file mode 100644 index 00000000..c6cc489d --- /dev/null +++ b/buildSrc/hs_err_pid49948.log @@ -0,0 +1,851 @@ +# +# There is insufficient memory for the Java Runtime Environment to continue. +# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap +# Possible reasons: +# The system is out of physical RAM or swap space +# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap +# Possible solutions: +# Reduce memory load on the system +# Increase physical memory or swap space +# Check if swap backing store is full +# Decrease Java heap size (-Xmx/-Xms) +# Decrease number of Java threads +# Decrease Java thread stack sizes (-Xss) +# Set larger code cache with -XX:ReservedCodeCacheSize= +# JVM is running with Unscaled Compressed Oops mode in which the Java heap is +# placed in the first 4GB address space. The Java Heap base address is the +# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress +# to set the Java Heap base and to place the Java Heap above 4GB virtual address. +# This output file may be truncated or incomplete. +# +# Out of Memory Error (./src/hotspot/share/memory/allocation.cpp:46), pid=49948, tid=54616 +# +# JRE version: OpenJDK Runtime Environment (11.0.13) (build 11.0.13+0-b1751.21-8125866) +# Java VM: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) +# No core dump will be written. Minidumps are not enabled by default on client versions of Windows +# + +--------------- S U M M A R Y ------------ + +Command Line: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 + +Host: AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G , 2 cores, 3G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031) +Time: Mon Jul 3 17:11:04 2023 elapsed time: 80.431619 seconds (0d 0h 1m 20s) + +--------------- T H R E A D --------------- + +Current thread (0x00000225319f6800): VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] + +Stack: [0x0000008c53200000,0x0000008c53300000] +[error occurred during error reporting (printing stack bounds), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002251b68112d] + +Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) +V [jvm.dll+0x6100fa] +V [jvm.dll+0x747090] +V [jvm.dll+0x7486ad] +V [jvm.dll+0x748ce5] +V [jvm.dll+0x748c9b] +V [jvm.dll+0x60f224] +V [jvm.dll+0x60f9b8] +C [ntdll.dll+0xa247f] +C [ntdll.dll+0x514f4] +C [ntdll.dll+0xa0f8e] +C 0x000002251b68112d + +VM_Operation (0x0000008c56ff9770): CollectForMetadataAllocation, mode: safepoint, requested by thread 0x00000225324c0800 + + +--------------- P R O C E S S --------------- + +Threads class SMR info: +_java_thread_list=0x0000022536238790, length=61, elements={ +0x0000022517b60800, 0x00000225319fa000, 0x0000022531a03800, 0x0000022531a19000, +0x0000022531a1c000, 0x0000022531a1d800, 0x0000022531a66800, 0x0000022531a68800, +0x0000022531a7c800, 0x0000022531cee800, 0x0000022532734000, 0x0000022532576800, +0x000002253351e800, 0x0000022531f56000, 0x000002253302a800, 0x000002253302b800, +0x000002253253b800, 0x00000225324ce000, 0x0000022531ecd000, 0x0000022531ea4800, +0x0000022531e9f000, 0x0000022531ea5800, 0x0000022531ea2000, 0x0000022531ea0800, +0x0000022531ea3000, 0x0000022531ea4000, 0x0000022531ea0000, 0x0000022531ea1800, +0x0000022533cce800, 0x0000022533ccb000, 0x0000022533ccf000, 0x0000022533cd0000, +0x0000022533cca800, 0x0000022533ccd000, 0x0000022533cd1000, 0x0000022533cd1800, +0x0000022533ccc000, 0x0000022533cd7800, 0x0000022533cd3800, 0x0000022533cd2800, +0x0000022533cd4000, 0x0000022533cd8000, 0x0000022533cd9000, 0x0000022533cd5000, +0x0000022533cd6000, 0x0000022533cd6800, 0x00000225324c2000, 0x00000225324c1800, +0x00000225324be000, 0x00000225324c3000, 0x00000225324c4000, 0x00000225324c4800, +0x00000225324bf000, 0x00000225324c5800, 0x00000225324bf800, 0x00000225324c6800, +0x00000225324c0800, 0x00000225324cb000, 0x00000225324cd000, 0x00000225324cc000, +0x00000225324c8000 +} + +Java Threads: ( => current thread ) + 0x0000022517b60800 JavaThread "main" [_thread_blocked, id=52892, stack(0x0000008c52c00000,0x0000008c52d00000)] + 0x00000225319fa000 JavaThread "Reference Handler" daemon [_thread_blocked, id=52232, stack(0x0000008c53300000,0x0000008c53400000)] + 0x0000022531a03800 JavaThread "Finalizer" daemon [_thread_blocked, id=44012, stack(0x0000008c53400000,0x0000008c53500000)] + 0x0000022531a19000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=53300, stack(0x0000008c53500000,0x0000008c53600000)] + 0x0000022531a1c000 JavaThread "Attach Listener" daemon [_thread_blocked, id=49748, stack(0x0000008c53600000,0x0000008c53700000)] + 0x0000022531a1d800 JavaThread "Service Thread" daemon [_thread_blocked, id=46864, stack(0x0000008c53700000,0x0000008c53800000)] + 0x0000022531a66800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=53760, stack(0x0000008c53800000,0x0000008c53900000)] + 0x0000022531a68800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=54680, stack(0x0000008c53900000,0x0000008c53a00000)] + 0x0000022531a7c800 JavaThread "Sweeper thread" daemon [_thread_blocked, id=46020, stack(0x0000008c53a00000,0x0000008c53b00000)] + 0x0000022531cee800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=55048, stack(0x0000008c53b00000,0x0000008c53c00000)] + 0x0000022532734000 JavaThread "Daemon health stats" [_thread_blocked, id=54880, stack(0x0000008c53e00000,0x0000008c53f00000)] + 0x0000022532576800 JavaThread "Incoming local TCP Connector on port 58623" [_thread_in_native, id=50576, stack(0x0000008c53f00000,0x0000008c54000000)] + 0x000002253351e800 JavaThread "Daemon periodic checks" [_thread_blocked, id=52448, stack(0x0000008c54000000,0x0000008c54100000)] + 0x0000022531f56000 JavaThread "Daemon" [_thread_blocked, id=54848, stack(0x0000008c54100000,0x0000008c54200000)] + 0x000002253302a800 JavaThread "Handler for socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_in_native, id=53764, stack(0x0000008c54200000,0x0000008c54300000)] + 0x000002253302b800 JavaThread "Cancel handler" [_thread_blocked, id=55084, stack(0x0000008c54300000,0x0000008c54400000)] + 0x000002253253b800 JavaThread "Daemon worker" [_thread_blocked, id=15576, stack(0x0000008c54400000,0x0000008c54500000)] + 0x00000225324ce000 JavaThread "Asynchronous log dispatcher for DefaultDaemonConnection: socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_blocked, id=43788, stack(0x0000008c54500000,0x0000008c54600000)] + 0x0000022531ecd000 JavaThread "Daemon client event forwarder" [_thread_blocked, id=54688, stack(0x0000008c54700000,0x0000008c54800000)] + 0x0000022531ea4800 JavaThread "Cache worker for journal cache (C:\Users\USER\.gradle\caches\journal-1)" [_thread_blocked, id=50804, stack(0x0000008c54800000,0x0000008c54900000)] + 0x0000022531e9f000 JavaThread "File lock request listener" [_thread_in_native, id=48844, stack(0x0000008c54900000,0x0000008c54a00000)] + 0x0000022531ea5800 JavaThread "Cache worker for file hash cache (C:\Users\USER\.gradle\caches\8.0.2\fileHashes)" [_thread_blocked, id=48008, stack(0x0000008c54a00000,0x0000008c54b00000)] + 0x0000022531ea2000 JavaThread "File watcher server" daemon [_thread_blocked, id=47932, stack(0x0000008c54b00000,0x0000008c54c00000)] + 0x0000022531ea0800 JavaThread "File watcher consumer" daemon [_thread_blocked, id=40928, stack(0x0000008c54c00000,0x0000008c54d00000)] + 0x0000022531ea3000 JavaThread "jar transforms" [_thread_blocked, id=20244, stack(0x0000008c54d00000,0x0000008c54e00000)] + 0x0000022531ea4000 JavaThread "jar transforms Thread 2" [_thread_blocked, id=54224, stack(0x0000008c54e00000,0x0000008c54f00000)] + 0x0000022531ea0000 JavaThread "Cache worker for checksums cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\checksums)" [_thread_blocked, id=37804, stack(0x0000008c54f00000,0x0000008c55000000)] + 0x0000022531ea1800 JavaThread "Cache worker for cache directory md-rule (C:\Users\USER\.gradle\caches\8.0.2\md-rule)" [_thread_blocked, id=52184, stack(0x0000008c55000000,0x0000008c55100000)] + 0x0000022533cce800 JavaThread "Cache worker for file content cache (C:\Users\USER\.gradle\caches\8.0.2\fileContent)" [_thread_blocked, id=54940, stack(0x0000008c55100000,0x0000008c55200000)] + 0x0000022533ccb000 JavaThread "Cache worker for file hash cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\fileHashes)" [_thread_blocked, id=50424, stack(0x0000008c55200000,0x0000008c55300000)] + 0x0000022533ccf000 JavaThread "Cache worker for cache directory md-supplier (C:\Users\USER\.gradle\caches\8.0.2\md-supplier)" [_thread_blocked, id=30304, stack(0x0000008c55300000,0x0000008c55400000)] + 0x0000022533cd0000 JavaThread "Cache worker for execution history cache (C:\Users\USER\.gradle\caches\8.0.2\executionHistory)" [_thread_blocked, id=54756, stack(0x0000008c55400000,0x0000008c55500000)] + 0x0000022533cca800 JavaThread "Cache worker for dependencies-accessors (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\dependencies-accessors)" [_thread_blocked, id=54948, stack(0x0000008c55700000,0x0000008c55800000)] + 0x0000022533ccd000 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=54772, stack(0x0000008c55800000,0x0000008c55900000)] + 0x0000022533cd1000 JavaThread "Memory manager" [_thread_blocked, id=64, stack(0x0000008c55900000,0x0000008c55a00000)] + 0x0000022533cd1800 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=51880, stack(0x0000008c55a00000,0x0000008c55b00000)] + 0x0000022533ccc000 JavaThread "Cache worker for kotlin-dsl (C:\Users\USER\.gradle\caches\8.0.2\kotlin-dsl)" [_thread_blocked, id=53304, stack(0x0000008c55b00000,0x0000008c55c00000)] + 0x0000022533cd7800 JavaThread "Unconstrained build operations" [_thread_blocked, id=54808, stack(0x0000008c55c00000,0x0000008c55d00000)] + 0x0000022533cd3800 JavaThread "Unconstrained build operations Thread 2" [_thread_blocked, id=54200, stack(0x0000008c55d00000,0x0000008c55e00000)] + 0x0000022533cd2800 JavaThread "Unconstrained build operations Thread 3" [_thread_blocked, id=49596, stack(0x0000008c55e00000,0x0000008c55f00000)] + 0x0000022533cd4000 JavaThread "Unconstrained build operations Thread 4" [_thread_blocked, id=54500, stack(0x0000008c55f00000,0x0000008c56000000)] + 0x0000022533cd8000 JavaThread "Unconstrained build operations Thread 5" [_thread_blocked, id=52376, stack(0x0000008c56000000,0x0000008c56100000)] + 0x0000022533cd9000 JavaThread "Unconstrained build operations Thread 6" [_thread_blocked, id=54288, stack(0x0000008c56100000,0x0000008c56200000)] + 0x0000022533cd5000 JavaThread "Unconstrained build operations Thread 7" [_thread_blocked, id=55148, stack(0x0000008c56200000,0x0000008c56300000)] + 0x0000022533cd6000 JavaThread "Unconstrained build operations Thread 8" [_thread_blocked, id=54676, stack(0x0000008c56300000,0x0000008c56400000)] + 0x0000022533cd6800 JavaThread "Unconstrained build operations Thread 9" [_thread_blocked, id=52780, stack(0x0000008c56400000,0x0000008c56500000)] + 0x00000225324c2000 JavaThread "Unconstrained build operations Thread 10" [_thread_blocked, id=52528, stack(0x0000008c56500000,0x0000008c56600000)] + 0x00000225324c1800 JavaThread "Unconstrained build operations Thread 11" [_thread_blocked, id=54508, stack(0x0000008c56600000,0x0000008c56700000)] + 0x00000225324be000 JavaThread "Unconstrained build operations Thread 12" [_thread_blocked, id=51544, stack(0x0000008c56700000,0x0000008c56800000)] + 0x00000225324c3000 JavaThread "Unconstrained build operations Thread 13" [_thread_blocked, id=52856, stack(0x0000008c56800000,0x0000008c56900000)] + 0x00000225324c4000 JavaThread "Unconstrained build operations Thread 14" [_thread_blocked, id=30784, stack(0x0000008c56900000,0x0000008c56a00000)] + 0x00000225324c4800 JavaThread "Unconstrained build operations Thread 15" [_thread_blocked, id=41272, stack(0x0000008c56a00000,0x0000008c56b00000)] + 0x00000225324bf000 JavaThread "Unconstrained build operations Thread 16" [_thread_blocked, id=52956, stack(0x0000008c56b00000,0x0000008c56c00000)] + 0x00000225324c5800 JavaThread "Unconstrained build operations Thread 17" [_thread_blocked, id=44264, stack(0x0000008c56c00000,0x0000008c56d00000)] + 0x00000225324bf800 JavaThread "Unconstrained build operations Thread 18" [_thread_blocked, id=54308, stack(0x0000008c56d00000,0x0000008c56e00000)] + 0x00000225324c6800 JavaThread "Unconstrained build operations Thread 19" [_thread_blocked, id=51824, stack(0x0000008c56e00000,0x0000008c56f00000)] + 0x00000225324c0800 JavaThread "Unconstrained build operations Thread 20" [_thread_blocked, id=55232, stack(0x0000008c56f00000,0x0000008c57000000)] + 0x00000225324cb000 JavaThread "included builds" [_thread_blocked, id=54504, stack(0x0000008c52a00000,0x0000008c52b00000)] + 0x00000225324cd000 JavaThread "Execution worker" [_thread_blocked, id=51832, stack(0x0000008c52b00000,0x0000008c52c00000)] + 0x00000225324cc000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=47204, stack(0x0000008c57000000,0x0000008c57100000)] + 0x00000225324c8000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=5536, stack(0x0000008c54600000,0x0000008c54700000)] + +Other Threads: +=>0x00000225319f6800 VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] + 0x0000022531d1a800 WatcherThread [stack: 0x0000008c53c00000,0x0000008c53d00000] [id=53860] + 0x0000022517b73000 GCTaskThread "GC Thread#0" [stack: 0x0000008c52d00000,0x0000008c52e00000] [id=46300] + 0x0000022531c15800 GCTaskThread "GC Thread#1" [stack: 0x0000008c53d00000,0x0000008c53e00000] [id=49096] + 0x0000022517ba3800 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008c52e00000,0x0000008c52f00000] [id=50800] + 0x0000022517ba7800 ConcurrentGCThread "G1 Conc#0" [stack: 0x0000008c52f00000,0x0000008c53000000] [id=39368] + 0x0000022517be4800 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008c53000000,0x0000008c53100000] [id=49560] + 0x0000022517be5800 ConcurrentGCThread "G1 Young RemSet Sampling" [stack: 0x0000008c53100000,0x0000008c53200000] [id=55224] + +Threads with active compile tasks: + +VM state:at safepoint (normal execution) + +VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) +[0x0000022517b5c200] Threads_lock - owner thread: 0x00000225319f6800 +[0x0000022517b5be10] Heap_lock - owner thread: 0x00000225324c0800 + +Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit +Narrow klass base: 0x0000000000000000, Narrow klass shift: 3 +Compressed class space size: 1073741824 Address: 0x0000000100000000 + +Heap: + garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 1 young (1024K), 1 survivors (1024K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1140736K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, A=archive, TAMS=top-at-mark-start (previous, next) +| 0|0x0000000080000000, 0x0000000080100000, 0x0000000080100000|100%| O| |TAMS 0x0000000080100000, 0x0000000080100000| Untracked +| 1|0x0000000080100000, 0x0000000080200000, 0x0000000080200000|100%|HS| |TAMS 0x0000000080200000, 0x0000000080200000| Complete +| 2|0x0000000080200000, 0x0000000080300000, 0x0000000080300000|100%|HC| |TAMS 0x0000000080300000, 0x0000000080300000| Complete +| 3|0x0000000080300000, 0x0000000080400000, 0x0000000080400000|100%|HC| |TAMS 0x0000000080400000, 0x0000000080400000| Complete +| 4|0x0000000080400000, 0x0000000080500000, 0x0000000080500000|100%|HC| |TAMS 0x0000000080500000, 0x0000000080500000| Complete +| 5|0x0000000080500000, 0x0000000080600000, 0x0000000080600000|100%| O| |TAMS 0x0000000080600000, 0x0000000080600000| Untracked +| 6|0x0000000080600000, 0x0000000080700000, 0x0000000080700000|100%| O| |TAMS 0x0000000080700000, 0x0000000080700000| Untracked +| 7|0x0000000080700000, 0x0000000080800000, 0x0000000080800000|100%| O| |TAMS 0x0000000080800000, 0x0000000080800000| Untracked +| 8|0x0000000080800000, 0x0000000080900000, 0x0000000080900000|100%| O| |TAMS 0x0000000080900000, 0x0000000080900000| Untracked +| 9|0x0000000080900000, 0x0000000080a00000, 0x0000000080a00000|100%| O| |TAMS 0x0000000080a00000, 0x0000000080a00000| Untracked +| 10|0x0000000080a00000, 0x0000000080b00000, 0x0000000080b00000|100%| O| |TAMS 0x0000000080b00000, 0x0000000080b00000| Untracked +| 11|0x0000000080b00000, 0x0000000080c00000, 0x0000000080c00000|100%| O| |TAMS 0x0000000080c00000, 0x0000000080c00000| Untracked +| 12|0x0000000080c00000, 0x0000000080d00000, 0x0000000080d00000|100%| O| |TAMS 0x0000000080d00000, 0x0000000080d00000| Untracked +| 13|0x0000000080d00000, 0x0000000080e00000, 0x0000000080e00000|100%| O| |TAMS 0x0000000080e00000, 0x0000000080e00000| Untracked +| 14|0x0000000080e00000, 0x0000000080f00000, 0x0000000080f00000|100%| O| |TAMS 0x0000000080f00000, 0x0000000080f00000| Untracked +| 15|0x0000000080f00000, 0x0000000081000000, 0x0000000081000000|100%| O| |TAMS 0x0000000081000000, 0x0000000081000000| Untracked +| 16|0x0000000081000000, 0x0000000081100000, 0x0000000081100000|100%| O| |TAMS 0x0000000081100000, 0x0000000081100000| Untracked +| 17|0x0000000081100000, 0x0000000081200000, 0x0000000081200000|100%| O| |TAMS 0x0000000081200000, 0x0000000081200000| Untracked +| 18|0x0000000081200000, 0x0000000081300000, 0x0000000081300000|100%|HS| |TAMS 0x0000000081300000, 0x0000000081300000| Complete +| 19|0x0000000081300000, 0x0000000081400000, 0x0000000081400000|100%|HC| |TAMS 0x0000000081400000, 0x0000000081400000| Complete +| 20|0x0000000081400000, 0x0000000081500000, 0x0000000081500000|100%|HS| |TAMS 0x0000000081500000, 0x0000000081500000| Complete +| 21|0x0000000081500000, 0x0000000081600000, 0x0000000081600000|100%|HC| |TAMS 0x0000000081600000, 0x0000000081600000| Complete +| 22|0x0000000081600000, 0x0000000081700000, 0x0000000081700000|100%|HC| |TAMS 0x0000000081700000, 0x0000000081700000| Complete +| 23|0x0000000081700000, 0x0000000081800000, 0x0000000081800000|100%| O| |TAMS 0x0000000081800000, 0x0000000081800000| Untracked +| 24|0x0000000081800000, 0x0000000081900000, 0x0000000081900000|100%|HS| |TAMS 0x0000000081900000, 0x0000000081900000| Complete +| 25|0x0000000081900000, 0x0000000081a00000, 0x0000000081a00000|100%|HC| |TAMS 0x0000000081a00000, 0x0000000081a00000| Complete +| 26|0x0000000081a00000, 0x0000000081b00000, 0x0000000081b00000|100%|HC| |TAMS 0x0000000081b00000, 0x0000000081b00000| Complete +| 27|0x0000000081b00000, 0x0000000081c00000, 0x0000000081c00000|100%| O| |TAMS 0x0000000081c00000, 0x0000000081c00000| Untracked +| 28|0x0000000081c00000, 0x0000000081d00000, 0x0000000081d00000|100%| O| |TAMS 0x0000000081d00000, 0x0000000081d00000| Untracked +| 29|0x0000000081d00000, 0x0000000081e00000, 0x0000000081e00000|100%| O| |TAMS 0x0000000081e00000, 0x0000000081e00000| Untracked +| 30|0x0000000081e00000, 0x0000000081f00000, 0x0000000081f00000|100%| O| |TAMS 0x0000000081f00000, 0x0000000081f00000| Untracked +| 31|0x0000000081f00000, 0x0000000082000000, 0x0000000082000000|100%|HS| |TAMS 0x0000000082000000, 0x0000000082000000| Complete +| 32|0x0000000082000000, 0x0000000082100000, 0x0000000082100000|100%|HC| |TAMS 0x0000000082100000, 0x0000000082100000| Complete +| 33|0x0000000082100000, 0x0000000082200000, 0x0000000082200000|100%|HC| |TAMS 0x0000000082200000, 0x0000000082200000| Complete +| 34|0x0000000082200000, 0x0000000082300000, 0x0000000082300000|100%|HC| |TAMS 0x0000000082300000, 0x0000000082300000| Complete +| 35|0x0000000082300000, 0x0000000082400000, 0x0000000082400000|100%|HS| |TAMS 0x0000000082400000, 0x0000000082400000| Complete +| 36|0x0000000082400000, 0x0000000082500000, 0x0000000082500000|100%|HC| |TAMS 0x0000000082500000, 0x0000000082500000| Complete +| 37|0x0000000082500000, 0x0000000082600000, 0x0000000082600000|100%|HC| |TAMS 0x0000000082600000, 0x0000000082600000| Complete +| 38|0x0000000082600000, 0x0000000082700000, 0x0000000082700000|100%|HC| |TAMS 0x0000000082700000, 0x0000000082700000| Complete +| 39|0x0000000082700000, 0x0000000082800000, 0x0000000082800000|100%|HC| |TAMS 0x0000000082800000, 0x0000000082800000| Complete +| 40|0x0000000082800000, 0x0000000082900000, 0x0000000082900000|100%| O| |TAMS 0x0000000082900000, 0x0000000082900000| Untracked +| 41|0x0000000082900000, 0x0000000082a00000, 0x0000000082a00000|100%| O| |TAMS 0x0000000082a00000, 0x0000000082a00000| Untracked +| 42|0x0000000082a00000, 0x0000000082b00000, 0x0000000082b00000|100%|HS| |TAMS 0x0000000082b00000, 0x0000000082b00000| Complete +| 43|0x0000000082b00000, 0x0000000082c00000, 0x0000000082c00000|100%| O| |TAMS 0x0000000082c00000, 0x0000000082c00000| Untracked +| 44|0x0000000082c00000, 0x0000000082d00000, 0x0000000082d00000|100%| O| |TAMS 0x0000000082d00000, 0x0000000082d00000| Untracked +| 45|0x0000000082d00000, 0x0000000082e00000, 0x0000000082e00000|100%| O| |TAMS 0x0000000082e00000, 0x0000000082e00000| Untracked +| 46|0x0000000082e00000, 0x0000000082f00000, 0x0000000082f00000|100%| O| |TAMS 0x0000000082f00000, 0x0000000082f00000| Untracked +| 47|0x0000000082f00000, 0x0000000083000000, 0x0000000083000000|100%| O| |TAMS 0x0000000083000000, 0x0000000083000000| Untracked +| 48|0x0000000083000000, 0x0000000083100000, 0x0000000083100000|100%| O| |TAMS 0x0000000083100000, 0x0000000083100000| Untracked +| 49|0x0000000083100000, 0x0000000083200000, 0x0000000083200000|100%|HS| |TAMS 0x0000000083200000, 0x0000000083200000| Complete +| 50|0x0000000083200000, 0x0000000083300000, 0x0000000083300000|100%|HC| |TAMS 0x0000000083300000, 0x0000000083300000| Complete +| 51|0x0000000083300000, 0x0000000083400000, 0x0000000083400000|100%|HC| |TAMS 0x0000000083400000, 0x0000000083400000| Complete +| 52|0x0000000083400000, 0x0000000083500000, 0x0000000083500000|100%|HS| |TAMS 0x0000000083500000, 0x0000000083500000| Complete +| 53|0x0000000083500000, 0x0000000083600000, 0x0000000083600000|100%|HC| |TAMS 0x0000000083600000, 0x0000000083600000| Complete +| 54|0x0000000083600000, 0x0000000083700000, 0x0000000083700000|100%| O| |TAMS 0x0000000083700000, 0x0000000083700000| Untracked +| 55|0x0000000083700000, 0x0000000083800000, 0x0000000083800000|100%| O| |TAMS 0x0000000083800000, 0x0000000083800000| Untracked +| 56|0x0000000083800000, 0x0000000083900000, 0x0000000083900000|100%|HS| |TAMS 0x0000000083900000, 0x0000000083900000| Complete +| 57|0x0000000083900000, 0x0000000083a00000, 0x0000000083a00000|100%|HC| |TAMS 0x0000000083a00000, 0x0000000083a00000| Complete +| 58|0x0000000083a00000, 0x0000000083b00000, 0x0000000083b00000|100%|HC| |TAMS 0x0000000083b00000, 0x0000000083b00000| Complete +| 59|0x0000000083b00000, 0x0000000083c00000, 0x0000000083c00000|100%|HS| |TAMS 0x0000000083c00000, 0x0000000083c00000| Complete +| 60|0x0000000083c00000, 0x0000000083d00000, 0x0000000083d00000|100%|HC| |TAMS 0x0000000083d00000, 0x0000000083d00000| Complete +| 61|0x0000000083d00000, 0x0000000083e00000, 0x0000000083e00000|100%|HC| |TAMS 0x0000000083e00000, 0x0000000083e00000| Complete +| 62|0x0000000083e00000, 0x0000000083f00000, 0x0000000083f00000|100%|HC| |TAMS 0x0000000083f00000, 0x0000000083f00000| Complete +| 63|0x0000000083f00000, 0x0000000084000000, 0x0000000084000000|100%| O| |TAMS 0x0000000084000000, 0x0000000084000000| Untracked +| 64|0x0000000084000000, 0x0000000084100000, 0x0000000084100000|100%| O| |TAMS 0x0000000084100000, 0x0000000084100000| Untracked +| 65|0x0000000084100000, 0x0000000084200000, 0x0000000084200000|100%| O| |TAMS 0x0000000084200000, 0x0000000084200000| Untracked +| 66|0x0000000084200000, 0x0000000084300000, 0x0000000084300000|100%| O| |TAMS 0x0000000084300000, 0x0000000084300000| Untracked +| 67|0x0000000084300000, 0x0000000084400000, 0x0000000084400000|100%| O| |TAMS 0x0000000084400000, 0x0000000084400000| Untracked +| 68|0x0000000084400000, 0x0000000084500000, 0x0000000084500000|100%| O| |TAMS 0x0000000084500000, 0x0000000084500000| Untracked +| 69|0x0000000084500000, 0x0000000084600000, 0x0000000084600000|100%| O| |TAMS 0x0000000084600000, 0x0000000084600000| Untracked +| 70|0x0000000084600000, 0x0000000084700000, 0x0000000084700000|100%| O| |TAMS 0x0000000084700000, 0x0000000084700000| Untracked +| 71|0x0000000084700000, 0x0000000084800000, 0x0000000084800000|100%| O| |TAMS 0x0000000084800000, 0x0000000084800000| Untracked +| 72|0x0000000084800000, 0x0000000084900000, 0x0000000084900000|100%|HS| |TAMS 0x0000000084900000, 0x0000000084900000| Complete +| 73|0x0000000084900000, 0x0000000084a00000, 0x0000000084a00000|100%|HC| |TAMS 0x0000000084a00000, 0x0000000084a00000| Complete +| 74|0x0000000084a00000, 0x0000000084b00000, 0x0000000084b00000|100%|HC| |TAMS 0x0000000084b00000, 0x0000000084b00000| Complete +| 75|0x0000000084b00000, 0x0000000084c00000, 0x0000000084c00000|100%|HC| |TAMS 0x0000000084c00000, 0x0000000084c00000| Complete +| 76|0x0000000084c00000, 0x0000000084d00000, 0x0000000084d00000|100%|HC| |TAMS 0x0000000084d00000, 0x0000000084d00000| Complete +| 77|0x0000000084d00000, 0x0000000084e00000, 0x0000000084e00000|100%| O| |TAMS 0x0000000084e00000, 0x0000000084e00000| Untracked +| 78|0x0000000084e00000, 0x0000000084f00000, 0x0000000084f00000|100%| O| |TAMS 0x0000000084f00000, 0x0000000084f00000| Untracked +| 79|0x0000000084f00000, 0x0000000085000000, 0x0000000085000000|100%| O| |TAMS 0x0000000085000000, 0x0000000085000000| Untracked +| 80|0x0000000085000000, 0x0000000085100000, 0x0000000085100000|100%| O| |TAMS 0x0000000085100000, 0x0000000085100000| Untracked +| 81|0x0000000085100000, 0x0000000085200000, 0x0000000085200000|100%| O| |TAMS 0x0000000085200000, 0x0000000085200000| Untracked +| 82|0x0000000085200000, 0x0000000085300000, 0x0000000085300000|100%| O| |TAMS 0x0000000085300000, 0x0000000085300000| Untracked +| 83|0x0000000085300000, 0x0000000085400000, 0x0000000085400000|100%|HS| |TAMS 0x0000000085400000, 0x0000000085400000| Complete +| 84|0x0000000085400000, 0x0000000085500000, 0x0000000085500000|100%|HC| |TAMS 0x0000000085500000, 0x0000000085500000| Complete +| 85|0x0000000085500000, 0x0000000085600000, 0x0000000085600000|100%|HS| |TAMS 0x0000000085600000, 0x0000000085600000| Complete +| 86|0x0000000085600000, 0x0000000085700000, 0x0000000085700000|100%|HC| |TAMS 0x0000000085700000, 0x0000000085700000| Complete +| 87|0x0000000085700000, 0x0000000085800000, 0x0000000085800000|100%|HC| |TAMS 0x0000000085800000, 0x0000000085800000| Complete +| 88|0x0000000085800000, 0x0000000085900000, 0x0000000085900000|100%|HC| |TAMS 0x0000000085900000, 0x0000000085900000| Complete +| 89|0x0000000085900000, 0x0000000085a00000, 0x0000000085a00000|100%| O| |TAMS 0x0000000085a00000, 0x0000000085a00000| Untracked +| 90|0x0000000085a00000, 0x0000000085b00000, 0x0000000085b00000|100%| O| |TAMS 0x0000000085b00000, 0x0000000085b00000| Untracked +| 91|0x0000000085b00000, 0x0000000085c00000, 0x0000000085c00000|100%| O| |TAMS 0x0000000085c00000, 0x0000000085c00000| Untracked +| 92|0x0000000085c00000, 0x0000000085d00000, 0x0000000085d00000|100%| O| |TAMS 0x0000000085d00000, 0x0000000085d00000| Untracked +| 93|0x0000000085d00000, 0x0000000085e00000, 0x0000000085e00000|100%| O| |TAMS 0x0000000085e00000, 0x0000000085e00000| Untracked +| 94|0x0000000085e00000, 0x0000000085f00000, 0x0000000085f00000|100%| O| |TAMS 0x0000000085f00000, 0x0000000085f00000| Untracked +| 95|0x0000000085f00000, 0x0000000086000000, 0x0000000086000000|100%| O| |TAMS 0x0000000086000000, 0x0000000086000000| Untracked +| 96|0x0000000086000000, 0x0000000086100000, 0x0000000086100000|100%| O| |TAMS 0x0000000086100000, 0x0000000086100000| Untracked +| 97|0x0000000086100000, 0x0000000086200000, 0x0000000086200000|100%| O| |TAMS 0x0000000086200000, 0x0000000086200000| Untracked +| 98|0x0000000086200000, 0x0000000086300000, 0x0000000086300000|100%| O| |TAMS 0x0000000086300000, 0x0000000086300000| Untracked +| 99|0x0000000086300000, 0x0000000086400000, 0x0000000086400000|100%| O| |TAMS 0x0000000086400000, 0x0000000086400000| Untracked +| 100|0x0000000086400000, 0x0000000086500000, 0x0000000086500000|100%| O| |TAMS 0x0000000086500000, 0x0000000086500000| Untracked +| 101|0x0000000086500000, 0x0000000086600000, 0x0000000086600000|100%| O| |TAMS 0x0000000086600000, 0x0000000086600000| Untracked +| 102|0x0000000086600000, 0x0000000086700000, 0x0000000086700000|100%| O| |TAMS 0x0000000086700000, 0x0000000086700000| Untracked +| 103|0x0000000086700000, 0x0000000086800000, 0x0000000086800000|100%| O| |TAMS 0x0000000086800000, 0x0000000086800000| Untracked +| 104|0x0000000086800000, 0x0000000086900000, 0x0000000086900000|100%|HS| |TAMS 0x0000000086800000, 0x0000000086900000| Complete +| 105|0x0000000086900000, 0x0000000086a00000, 0x0000000086a00000|100%|HC| |TAMS 0x0000000086900000, 0x0000000086a00000| Complete +| 106|0x0000000086a00000, 0x0000000086b00000, 0x0000000086b00000|100%|HS| |TAMS 0x0000000086a00000, 0x0000000086b00000| Complete +| 107|0x0000000086b00000, 0x0000000086c00000, 0x0000000086c00000|100%|HC| |TAMS 0x0000000086b00000, 0x0000000086c00000| Complete +| 108|0x0000000086c00000, 0x0000000086d00000, 0x0000000086d00000|100%|HC| |TAMS 0x0000000086c00000, 0x0000000086d00000| Complete +| 109|0x0000000086d00000, 0x0000000086e00000, 0x0000000086e00000|100%|HS| |TAMS 0x0000000086d00000, 0x0000000086e00000| Complete +| 110|0x0000000086e00000, 0x0000000086f00000, 0x0000000086f00000|100%|HC| |TAMS 0x0000000086e00000, 0x0000000086f00000| Complete +| 111|0x0000000086f00000, 0x0000000087000000, 0x0000000087000000|100%|HC| |TAMS 0x0000000086f00000, 0x0000000087000000| Complete +| 112|0x0000000087000000, 0x0000000087100000, 0x0000000087100000|100%|HS| |TAMS 0x0000000087000000, 0x0000000087100000| Complete +| 113|0x0000000087100000, 0x0000000087200000, 0x0000000087200000|100%|HC| |TAMS 0x0000000087100000, 0x0000000087200000| Complete +| 114|0x0000000087200000, 0x0000000087300000, 0x0000000087300000|100%|HC| |TAMS 0x0000000087200000, 0x0000000087300000| Complete +| 115|0x0000000087300000, 0x0000000087400000, 0x0000000087400000|100%|HC| |TAMS 0x0000000087300000, 0x0000000087400000| Complete +| 116|0x0000000087400000, 0x0000000087500000, 0x0000000087500000|100%|HS| |TAMS 0x0000000087400000, 0x0000000087500000| Complete +| 117|0x0000000087500000, 0x0000000087600000, 0x0000000087600000|100%|HC| |TAMS 0x0000000087500000, 0x0000000087600000| Complete +| 118|0x0000000087600000, 0x0000000087700000, 0x0000000087700000|100%|HC| |TAMS 0x0000000087600000, 0x0000000087700000| Complete +| 119|0x0000000087700000, 0x0000000087800000, 0x0000000087800000|100%|HC| |TAMS 0x0000000087700000, 0x0000000087800000| Complete +| 120|0x0000000087800000, 0x0000000087900000, 0x0000000087900000|100%|HC| |TAMS 0x0000000087800000, 0x0000000087900000| Complete +| 121|0x0000000087900000, 0x0000000087a00000, 0x0000000087a00000|100%|HS| |TAMS 0x0000000087900000, 0x0000000087a00000| Complete +| 122|0x0000000087a00000, 0x0000000087b00000, 0x0000000087b00000|100%| O| |TAMS 0x0000000087a00000, 0x0000000087b00000| Untracked +| 123|0x0000000087b00000, 0x0000000087c00000, 0x0000000087c00000|100%| O| |TAMS 0x0000000087b00000, 0x0000000087c00000| Untracked +| 124|0x0000000087c00000, 0x0000000087d00000, 0x0000000087d00000|100%| O| |TAMS 0x0000000087c00000, 0x0000000087d00000| Untracked +| 125|0x0000000087d00000, 0x0000000087e00000, 0x0000000087e00000|100%| O| |TAMS 0x0000000087d00000, 0x0000000087e00000| Untracked +| 126|0x0000000087e00000, 0x0000000087f00000, 0x0000000087f00000|100%| O| |TAMS 0x0000000087e00000, 0x0000000087f00000| Untracked +| 127|0x0000000087f00000, 0x0000000088000000, 0x0000000088000000|100%| O| |TAMS 0x0000000087f00000, 0x0000000088000000| Untracked +| 128|0x0000000088000000, 0x0000000088100000, 0x0000000088100000|100%| O| |TAMS 0x0000000088000000, 0x0000000088100000| Untracked +| 129|0x0000000088100000, 0x0000000088200000, 0x0000000088200000|100%| O| |TAMS 0x0000000088100000, 0x0000000088200000| Untracked +| 130|0x0000000088200000, 0x0000000088300000, 0x0000000088300000|100%| O| |TAMS 0x0000000088200000, 0x0000000088300000| Untracked +| 131|0x0000000088300000, 0x0000000088400000, 0x0000000088400000|100%| O| |TAMS 0x0000000088300000, 0x0000000088400000| Untracked +| 132|0x0000000088400000, 0x0000000088500000, 0x0000000088500000|100%| O| |TAMS 0x0000000088400000, 0x0000000088500000| Untracked +| 133|0x0000000088500000, 0x0000000088600000, 0x0000000088600000|100%| O| |TAMS 0x0000000088500000, 0x0000000088600000| Untracked +| 134|0x0000000088600000, 0x0000000088600000, 0x0000000088700000| 0%| F| |TAMS 0x0000000088600000, 0x0000000088600000| Untracked +| 135|0x0000000088700000, 0x0000000088700000, 0x0000000088800000| 0%| F| |TAMS 0x0000000088700000, 0x0000000088700000| Untracked +| 136|0x0000000088800000, 0x0000000088800000, 0x0000000088900000| 0%| F| |TAMS 0x0000000088800000, 0x0000000088800000| Untracked +| 137|0x0000000088900000, 0x0000000088900000, 0x0000000088a00000| 0%| F| |TAMS 0x0000000088900000, 0x0000000088900000| Untracked +| 138|0x0000000088a00000, 0x0000000088a00000, 0x0000000088b00000| 0%| F| |TAMS 0x0000000088a00000, 0x0000000088a00000| Untracked +| 139|0x0000000088b00000, 0x0000000088b00000, 0x0000000088c00000| 0%| F| |TAMS 0x0000000088b00000, 0x0000000088b00000| Untracked +| 140|0x0000000088c00000, 0x0000000088c00000, 0x0000000088d00000| 0%| F| |TAMS 0x0000000088c00000, 0x0000000088c00000| Untracked +| 141|0x0000000088d00000, 0x0000000088d00000, 0x0000000088e00000| 0%| F| |TAMS 0x0000000088d00000, 0x0000000088d00000| Untracked +| 142|0x0000000088e00000, 0x0000000088e00000, 0x0000000088f00000| 0%| F| |TAMS 0x0000000088e00000, 0x0000000088e00000| Untracked +| 143|0x0000000088f00000, 0x0000000088f00000, 0x0000000089000000| 0%| F| |TAMS 0x0000000088f00000, 0x0000000088f00000| Untracked +| 144|0x0000000089000000, 0x0000000089000000, 0x0000000089100000| 0%| F| |TAMS 0x0000000089000000, 0x0000000089000000| Untracked +| 145|0x0000000089100000, 0x0000000089100000, 0x0000000089200000| 0%| F| |TAMS 0x0000000089100000, 0x0000000089100000| Untracked +| 146|0x0000000089200000, 0x0000000089200000, 0x0000000089300000| 0%| F| |TAMS 0x0000000089200000, 0x0000000089200000| Untracked +| 147|0x0000000089300000, 0x0000000089300000, 0x0000000089400000| 0%| F| |TAMS 0x0000000089300000, 0x0000000089300000| Untracked +| 148|0x0000000089400000, 0x0000000089400000, 0x0000000089500000| 0%| F| |TAMS 0x0000000089400000, 0x0000000089400000| Untracked +| 149|0x0000000089500000, 0x0000000089500000, 0x0000000089600000| 0%| F| |TAMS 0x0000000089500000, 0x0000000089500000| Untracked +| 150|0x0000000089600000, 0x0000000089600000, 0x0000000089700000| 0%| F| |TAMS 0x0000000089600000, 0x0000000089600000| Untracked +| 151|0x0000000089700000, 0x0000000089700000, 0x0000000089800000| 0%| F| |TAMS 0x0000000089700000, 0x0000000089700000| Untracked +| 152|0x0000000089800000, 0x0000000089800000, 0x0000000089900000| 0%| F| |TAMS 0x0000000089800000, 0x0000000089800000| Untracked +| 153|0x0000000089900000, 0x0000000089900000, 0x0000000089a00000| 0%| F| |TAMS 0x0000000089900000, 0x0000000089900000| Untracked +| 154|0x0000000089a00000, 0x0000000089a00000, 0x0000000089b00000| 0%| F| |TAMS 0x0000000089a00000, 0x0000000089a00000| Untracked +| 155|0x0000000089b00000, 0x0000000089b00000, 0x0000000089c00000| 0%| F| |TAMS 0x0000000089b00000, 0x0000000089b00000| Untracked +| 156|0x0000000089c00000, 0x0000000089c00000, 0x0000000089d00000| 0%| F| |TAMS 0x0000000089c00000, 0x0000000089c00000| Untracked +| 157|0x0000000089d00000, 0x0000000089d00000, 0x0000000089e00000| 0%| F| |TAMS 0x0000000089d00000, 0x0000000089d00000| Untracked +| 158|0x0000000089e00000, 0x0000000089e00000, 0x0000000089f00000| 0%| F| |TAMS 0x0000000089e00000, 0x0000000089e00000| Untracked +| 159|0x0000000089f00000, 0x0000000089f00000, 0x000000008a000000| 0%| F| |TAMS 0x0000000089f00000, 0x0000000089f00000| Untracked +| 160|0x000000008a000000, 0x000000008a000000, 0x000000008a100000| 0%| F| |TAMS 0x000000008a000000, 0x000000008a000000| Untracked +| 161|0x000000008a100000, 0x000000008a100000, 0x000000008a200000| 0%| F| |TAMS 0x000000008a100000, 0x000000008a100000| Untracked +| 162|0x000000008a200000, 0x000000008a200000, 0x000000008a300000| 0%| F| |TAMS 0x000000008a200000, 0x000000008a200000| Untracked +| 163|0x000000008a300000, 0x000000008a300000, 0x000000008a400000| 0%| F| |TAMS 0x000000008a300000, 0x000000008a300000| Untracked +| 164|0x000000008a400000, 0x000000008a400000, 0x000000008a500000| 0%| F| |TAMS 0x000000008a400000, 0x000000008a400000| Untracked +| 165|0x000000008a500000, 0x000000008a500000, 0x000000008a600000| 0%| F| |TAMS 0x000000008a500000, 0x000000008a500000| Untracked +| 166|0x000000008a600000, 0x000000008a600000, 0x000000008a700000| 0%| F| |TAMS 0x000000008a600000, 0x000000008a600000| Untracked +| 167|0x000000008a700000, 0x000000008a700000, 0x000000008a800000| 0%| F| |TAMS 0x000000008a700000, 0x000000008a700000| Untracked +| 168|0x000000008a800000, 0x000000008a800000, 0x000000008a900000| 0%| F| |TAMS 0x000000008a800000, 0x000000008a800000| Untracked +| 169|0x000000008a900000, 0x000000008a900000, 0x000000008aa00000| 0%| F| |TAMS 0x000000008a900000, 0x000000008a900000| Untracked +| 170|0x000000008aa00000, 0x000000008aa00000, 0x000000008ab00000| 0%| F| |TAMS 0x000000008aa00000, 0x000000008aa00000| Untracked +| 171|0x000000008ab00000, 0x000000008ab00000, 0x000000008ac00000| 0%| F| |TAMS 0x000000008ab00000, 0x000000008ab00000| Untracked +| 172|0x000000008ac00000, 0x000000008ac00000, 0x000000008ad00000| 0%| F| |TAMS 0x000000008ac00000, 0x000000008ac00000| Untracked +| 173|0x000000008ad00000, 0x000000008ad00000, 0x000000008ae00000| 0%| F| |TAMS 0x000000008ad00000, 0x000000008ad00000| Untracked +| 174|0x000000008ae00000, 0x000000008ae00000, 0x000000008af00000| 0%| F| |TAMS 0x000000008ae00000, 0x000000008ae00000| Untracked +| 175|0x000000008af00000, 0x000000008af00000, 0x000000008b000000| 0%| F| |TAMS 0x000000008af00000, 0x000000008af00000| Untracked +| 176|0x000000008b000000, 0x000000008b000000, 0x000000008b100000| 0%| F| |TAMS 0x000000008b000000, 0x000000008b000000| Untracked +| 177|0x000000008b100000, 0x000000008b100000, 0x000000008b200000| 0%| F| |TAMS 0x000000008b100000, 0x000000008b100000| Untracked +| 178|0x000000008b200000, 0x000000008b200000, 0x000000008b300000| 0%| F| |TAMS 0x000000008b200000, 0x000000008b200000| Untracked +| 179|0x000000008b300000, 0x000000008b300000, 0x000000008b400000| 0%| F| |TAMS 0x000000008b300000, 0x000000008b300000| Untracked +| 180|0x000000008b400000, 0x000000008b400000, 0x000000008b500000| 0%| F| |TAMS 0x000000008b400000, 0x000000008b400000| Untracked +| 181|0x000000008b500000, 0x000000008b500000, 0x000000008b600000| 0%| F| |TAMS 0x000000008b500000, 0x000000008b500000| Untracked +| 182|0x000000008b600000, 0x000000008b600000, 0x000000008b700000| 0%| F| |TAMS 0x000000008b600000, 0x000000008b600000| Untracked +| 183|0x000000008b700000, 0x000000008b700000, 0x000000008b800000| 0%| F| |TAMS 0x000000008b700000, 0x000000008b700000| Untracked +| 184|0x000000008b800000, 0x000000008b800000, 0x000000008b900000| 0%| F| |TAMS 0x000000008b800000, 0x000000008b800000| Untracked +| 185|0x000000008b900000, 0x000000008b900000, 0x000000008ba00000| 0%| F| |TAMS 0x000000008b900000, 0x000000008b900000| Untracked +| 186|0x000000008ba00000, 0x000000008ba00000, 0x000000008bb00000| 0%| F| |TAMS 0x000000008ba00000, 0x000000008ba00000| Untracked +| 187|0x000000008bb00000, 0x000000008bb00000, 0x000000008bc00000| 0%| F| |TAMS 0x000000008bb00000, 0x000000008bb00000| Untracked +| 188|0x000000008bc00000, 0x000000008bc00000, 0x000000008bd00000| 0%| F| |TAMS 0x000000008bc00000, 0x000000008bc00000| Untracked +| 189|0x000000008bd00000, 0x000000008bd00000, 0x000000008be00000| 0%| F| |TAMS 0x000000008bd00000, 0x000000008bd00000| Untracked +| 190|0x000000008be00000, 0x000000008be00000, 0x000000008bf00000| 0%| F| |TAMS 0x000000008be00000, 0x000000008be00000| Untracked +| 191|0x000000008bf00000, 0x000000008bf00000, 0x000000008c000000| 0%| F| |TAMS 0x000000008bf00000, 0x000000008bf00000| Untracked +| 192|0x000000008c000000, 0x000000008c000000, 0x000000008c100000| 0%| F| |TAMS 0x000000008c000000, 0x000000008c000000| Untracked +| 193|0x000000008c100000, 0x000000008c100000, 0x000000008c200000| 0%| F| |TAMS 0x000000008c100000, 0x000000008c100000| Untracked +| 194|0x000000008c200000, 0x000000008c200000, 0x000000008c300000| 0%| F| |TAMS 0x000000008c200000, 0x000000008c200000| Untracked +| 195|0x000000008c300000, 0x000000008c300000, 0x000000008c400000| 0%| F| |TAMS 0x000000008c300000, 0x000000008c300000| Untracked +| 196|0x000000008c400000, 0x000000008c400000, 0x000000008c500000| 0%| F| |TAMS 0x000000008c400000, 0x000000008c400000| Untracked +| 197|0x000000008c500000, 0x000000008c500000, 0x000000008c600000| 0%| F| |TAMS 0x000000008c500000, 0x000000008c500000| Untracked +| 198|0x000000008c600000, 0x000000008c600000, 0x000000008c700000| 0%| F| |TAMS 0x000000008c600000, 0x000000008c600000| Untracked +| 199|0x000000008c700000, 0x000000008c700000, 0x000000008c800000| 0%| F| |TAMS 0x000000008c700000, 0x000000008c700000| Untracked +| 200|0x000000008c800000, 0x000000008c800000, 0x000000008c900000| 0%| F| |TAMS 0x000000008c800000, 0x000000008c800000| Untracked +| 201|0x000000008c900000, 0x000000008c900000, 0x000000008ca00000| 0%| F| |TAMS 0x000000008c900000, 0x000000008c900000| Untracked +| 202|0x000000008ca00000, 0x000000008ca00000, 0x000000008cb00000| 0%| F| |TAMS 0x000000008ca00000, 0x000000008ca00000| Untracked +| 203|0x000000008cb00000, 0x000000008cb00000, 0x000000008cc00000| 0%| F| |TAMS 0x000000008cb00000, 0x000000008cb00000| Untracked +| 204|0x000000008cc00000, 0x000000008cc00000, 0x000000008cd00000| 0%| F| |TAMS 0x000000008cc00000, 0x000000008cc00000| Untracked +| 205|0x000000008cd00000, 0x000000008cd00000, 0x000000008ce00000| 0%| F| |TAMS 0x000000008cd00000, 0x000000008cd00000| Untracked +| 206|0x000000008ce00000, 0x000000008ce00000, 0x000000008cf00000| 0%| F| |TAMS 0x000000008ce00000, 0x000000008ce00000| Untracked +| 207|0x000000008cf00000, 0x000000008cf00000, 0x000000008d000000| 0%| F| |TAMS 0x000000008cf00000, 0x000000008cf00000| Untracked +| 208|0x000000008d000000, 0x000000008d000000, 0x000000008d100000| 0%| F| |TAMS 0x000000008d000000, 0x000000008d000000| Untracked +| 209|0x000000008d100000, 0x000000008d100000, 0x000000008d200000| 0%| F| |TAMS 0x000000008d100000, 0x000000008d100000| Untracked +| 210|0x000000008d200000, 0x000000008d200000, 0x000000008d300000| 0%| F| |TAMS 0x000000008d200000, 0x000000008d200000| Untracked +| 211|0x000000008d300000, 0x000000008d300000, 0x000000008d400000| 0%| F| |TAMS 0x000000008d300000, 0x000000008d300000| Untracked +| 212|0x000000008d400000, 0x000000008d400000, 0x000000008d500000| 0%| F| |TAMS 0x000000008d400000, 0x000000008d400000| Untracked +| 213|0x000000008d500000, 0x000000008d500000, 0x000000008d600000| 0%| F| |TAMS 0x000000008d500000, 0x000000008d500000| Untracked +| 214|0x000000008d600000, 0x000000008d600000, 0x000000008d700000| 0%| F| |TAMS 0x000000008d600000, 0x000000008d600000| Untracked +| 215|0x000000008d700000, 0x000000008d700000, 0x000000008d800000| 0%| F| |TAMS 0x000000008d700000, 0x000000008d700000| Untracked +| 216|0x000000008d800000, 0x000000008d800000, 0x000000008d900000| 0%| F| |TAMS 0x000000008d800000, 0x000000008d800000| Untracked +| 217|0x000000008d900000, 0x000000008d900000, 0x000000008da00000| 0%| F| |TAMS 0x000000008d900000, 0x000000008d900000| Untracked +| 218|0x000000008da00000, 0x000000008da00000, 0x000000008db00000| 0%| F| |TAMS 0x000000008da00000, 0x000000008da00000| Untracked +| 219|0x000000008db00000, 0x000000008db00000, 0x000000008dc00000| 0%| F| |TAMS 0x000000008db00000, 0x000000008db00000| Untracked +| 220|0x000000008dc00000, 0x000000008dc00000, 0x000000008dd00000| 0%| F| |TAMS 0x000000008dc00000, 0x000000008dc00000| Untracked +| 221|0x000000008dd00000, 0x000000008dd00000, 0x000000008de00000| 0%| F| |TAMS 0x000000008dd00000, 0x000000008dd00000| Untracked +| 222|0x000000008de00000, 0x000000008de00000, 0x000000008df00000| 0%| F| |TAMS 0x000000008de00000, 0x000000008de00000| Untracked +| 223|0x000000008df00000, 0x000000008df00000, 0x000000008e000000| 0%| F| |TAMS 0x000000008df00000, 0x000000008df00000| Untracked +| 224|0x000000008e000000, 0x000000008e000000, 0x000000008e100000| 0%| F| |TAMS 0x000000008e000000, 0x000000008e000000| Untracked +| 225|0x000000008e100000, 0x000000008e100000, 0x000000008e200000| 0%| F| |TAMS 0x000000008e100000, 0x000000008e100000| Untracked +| 226|0x000000008e200000, 0x000000008e200000, 0x000000008e300000| 0%| F| |TAMS 0x000000008e200000, 0x000000008e200000| Untracked +| 227|0x000000008e300000, 0x000000008e300000, 0x000000008e400000| 0%| F| |TAMS 0x000000008e300000, 0x000000008e300000| Untracked +| 228|0x000000008e400000, 0x000000008e400000, 0x000000008e500000| 0%| F| |TAMS 0x000000008e400000, 0x000000008e400000| Untracked +| 229|0x000000008e500000, 0x000000008e500000, 0x000000008e600000| 0%| F| |TAMS 0x000000008e500000, 0x000000008e500000| Untracked +| 230|0x000000008e600000, 0x000000008e600000, 0x000000008e700000| 0%| F| |TAMS 0x000000008e600000, 0x000000008e600000| Untracked +| 231|0x000000008e700000, 0x000000008e700000, 0x000000008e800000| 0%| F| |TAMS 0x000000008e700000, 0x000000008e700000| Untracked +| 232|0x000000008e800000, 0x000000008e800000, 0x000000008e900000| 0%| F| |TAMS 0x000000008e800000, 0x000000008e800000| Untracked +| 233|0x000000008e900000, 0x000000008e900000, 0x000000008ea00000| 0%| F| |TAMS 0x000000008e900000, 0x000000008e900000| Untracked +| 234|0x000000008ea00000, 0x000000008ea00000, 0x000000008eb00000| 0%| F| |TAMS 0x000000008ea00000, 0x000000008ea00000| Untracked +| 235|0x000000008eb00000, 0x000000008eb00000, 0x000000008ec00000| 0%| F| |TAMS 0x000000008eb00000, 0x000000008eb00000| Untracked +| 236|0x000000008ec00000, 0x000000008ec00000, 0x000000008ed00000| 0%| F| |TAMS 0x000000008ec00000, 0x000000008ec00000| Untracked +| 237|0x000000008ed00000, 0x000000008ed00000, 0x000000008ee00000| 0%| F| |TAMS 0x000000008ed00000, 0x000000008ed00000| Untracked +| 238|0x000000008ee00000, 0x000000008ee00000, 0x000000008ef00000| 0%| F| |TAMS 0x000000008ee00000, 0x000000008ee00000| Untracked +| 239|0x000000008ef00000, 0x000000008ef00000, 0x000000008f000000| 0%| F| |TAMS 0x000000008ef00000, 0x000000008ef00000| Untracked +| 240|0x000000008f000000, 0x000000008f000000, 0x000000008f100000| 0%| F| |TAMS 0x000000008f000000, 0x000000008f000000| Untracked +| 241|0x000000008f100000, 0x000000008f100000, 0x000000008f200000| 0%| F| |TAMS 0x000000008f100000, 0x000000008f100000| Untracked +| 242|0x000000008f200000, 0x000000008f200000, 0x000000008f300000| 0%| F| |TAMS 0x000000008f200000, 0x000000008f200000| Untracked +| 243|0x000000008f300000, 0x000000008f300000, 0x000000008f400000| 0%| F| |TAMS 0x000000008f300000, 0x000000008f300000| Untracked +| 244|0x000000008f400000, 0x000000008f400000, 0x000000008f500000| 0%| F| |TAMS 0x000000008f400000, 0x000000008f400000| Untracked +| 245|0x000000008f500000, 0x000000008f500000, 0x000000008f600000| 0%| F| |TAMS 0x000000008f500000, 0x000000008f500000| Untracked +| 246|0x000000008f600000, 0x000000008f600000, 0x000000008f700000| 0%| F| |TAMS 0x000000008f600000, 0x000000008f600000| Untracked +| 247|0x000000008f700000, 0x000000008f700000, 0x000000008f800000| 0%| F| |TAMS 0x000000008f700000, 0x000000008f700000| Untracked +| 248|0x000000008f800000, 0x000000008f800000, 0x000000008f900000| 0%| F| |TAMS 0x000000008f800000, 0x000000008f800000| Untracked +| 249|0x000000008f900000, 0x000000008f900000, 0x000000008fa00000| 0%| F| |TAMS 0x000000008f900000, 0x000000008f900000| Untracked +| 250|0x000000008fa00000, 0x000000008fa00000, 0x000000008fb00000| 0%| F| |TAMS 0x000000008fa00000, 0x000000008fa00000| Untracked +| 251|0x000000008fb00000, 0x000000008fb00000, 0x000000008fc00000| 0%| F| |TAMS 0x000000008fb00000, 0x000000008fb00000| Untracked +| 252|0x000000008fc00000, 0x000000008fc00000, 0x000000008fd00000| 0%| F| |TAMS 0x000000008fc00000, 0x000000008fc00000| Untracked +| 253|0x000000008fd00000, 0x000000008fd00000, 0x000000008fe00000| 0%| F| |TAMS 0x000000008fd00000, 0x000000008fd00000| Untracked +| 254|0x000000008fe00000, 0x000000008fe00000, 0x000000008ff00000| 0%| F| |TAMS 0x000000008fe00000, 0x000000008fe00000| Untracked +| 255|0x000000008ff00000, 0x000000008ff00000, 0x0000000090000000| 0%| F| |TAMS 0x000000008ff00000, 0x000000008ff00000| Untracked +| 256|0x0000000090000000, 0x0000000090000000, 0x0000000090100000| 0%| F| |TAMS 0x0000000090000000, 0x0000000090000000| Untracked +| 257|0x0000000090100000, 0x0000000090100000, 0x0000000090200000| 0%| F| |TAMS 0x0000000090100000, 0x0000000090100000| Untracked +| 258|0x0000000090200000, 0x0000000090200000, 0x0000000090300000| 0%| F| |TAMS 0x0000000090200000, 0x0000000090200000| Untracked +| 259|0x0000000090300000, 0x0000000090300000, 0x0000000090400000| 0%| F| |TAMS 0x0000000090300000, 0x0000000090300000| Untracked +| 260|0x0000000090400000, 0x0000000090400000, 0x0000000090500000| 0%| F| |TAMS 0x0000000090400000, 0x0000000090400000| Untracked +| 261|0x0000000090500000, 0x0000000090500000, 0x0000000090600000| 0%| F| |TAMS 0x0000000090500000, 0x0000000090500000| Untracked +| 262|0x0000000090600000, 0x0000000090600000, 0x0000000090700000| 0%| F| |TAMS 0x0000000090600000, 0x0000000090600000| Untracked +| 263|0x0000000090700000, 0x0000000090700000, 0x0000000090800000| 0%| F| |TAMS 0x0000000090700000, 0x0000000090700000| Untracked +| 264|0x0000000090800000, 0x0000000090800000, 0x0000000090900000| 0%| F| |TAMS 0x0000000090800000, 0x0000000090800000| Untracked +| 265|0x0000000090900000, 0x0000000090900000, 0x0000000090a00000| 0%| F| |TAMS 0x0000000090900000, 0x0000000090900000| Untracked +| 266|0x0000000090a00000, 0x0000000090a00000, 0x0000000090b00000| 0%| F| |TAMS 0x0000000090a00000, 0x0000000090a00000| Untracked +| 267|0x0000000090b00000, 0x0000000090b00000, 0x0000000090c00000| 0%| F| |TAMS 0x0000000090b00000, 0x0000000090b00000| Untracked +| 268|0x0000000090c00000, 0x0000000090c00000, 0x0000000090d00000| 0%| F| |TAMS 0x0000000090c00000, 0x0000000090c00000| Untracked +| 269|0x0000000090d00000, 0x0000000090d00000, 0x0000000090e00000| 0%| F| |TAMS 0x0000000090d00000, 0x0000000090d00000| Untracked +| 270|0x0000000090e00000, 0x0000000090e00000, 0x0000000090f00000| 0%| F| |TAMS 0x0000000090e00000, 0x0000000090e00000| Untracked +| 271|0x0000000090f00000, 0x0000000090fb8a30, 0x0000000091000000| 72%| S|CS|TAMS 0x0000000090f00000, 0x0000000090f00000| Complete +| 272|0x0000000091000000, 0x0000000091000000, 0x0000000091100000| 0%| F| |TAMS 0x0000000091000000, 0x0000000091000000| Untracked +| 273|0x0000000091100000, 0x0000000091100000, 0x0000000091200000| 0%| F| |TAMS 0x0000000091100000, 0x0000000091100000| Untracked +| 274|0x0000000091200000, 0x0000000091200000, 0x0000000091300000| 0%| F| |TAMS 0x0000000091200000, 0x0000000091200000| Untracked +| 275|0x0000000091300000, 0x0000000091300000, 0x0000000091400000| 0%| F| |TAMS 0x0000000091300000, 0x0000000091300000| Untracked +| 276|0x0000000091400000, 0x0000000091400000, 0x0000000091500000| 0%| F| |TAMS 0x0000000091400000, 0x0000000091400000| Untracked +| 277|0x0000000091500000, 0x0000000091500000, 0x0000000091600000| 0%| F| |TAMS 0x0000000091500000, 0x0000000091500000| Untracked + +Card table byte_map: [0x000002252a680000,0x000002252aa80000] _byte_map_base: 0x000002252a280000 + +Marking Bits (Prev, Next): (CMBitMap*) 0x0000022517b9ab60, (CMBitMap*) 0x0000022517b9ab28 + Prev Bits: [0x000002252ce80000, 0x000002252ee80000) + Next Bits: [0x000002252ae80000, 0x000002252ce80000) + +Polling page: 0x0000022515b10000 + +Metaspace: + +Usage: + Non-class: 80.88 MB capacity, 79.13 MB ( 98%) used, 1.46 MB ( 2%) free+waste, 302.69 KB ( <1%) overhead. + Class: 13.36 MB capacity, 12.30 MB ( 92%) used, 941.90 KB ( 7%) free+waste, 145.25 KB ( 1%) overhead. + Both: 94.24 MB capacity, 91.42 MB ( 97%) used, 2.38 MB ( 3%) free+waste, 447.94 KB ( <1%) overhead. + +Virtual space: + Non-class space: 90.00 MB reserved, 80.92 MB ( 90%) committed + Class space: 1.00 GB reserved, 13.38 MB ( 1%) committed + Both: 1.09 GB reserved, 94.30 MB ( 8%) committed + +Chunk freelists: + Non-Class: 42.00 KB + Class: 18.00 KB + Both: 60.00 KB + +MaxMetaspaceSize: 17179869184.00 GB +CompressedClassSpaceSize: 1.00 GB +Initial GC threshold: 20.80 MB +Current GC threshold: 146.24 MB +CDS: off + +CodeHeap 'non-profiled nmethods': size=120064Kb used=5951Kb max_used=5951Kb free=114112Kb + bounds [0x0000022523140000, 0x0000022523710000, 0x000002252a680000] +CodeHeap 'profiled nmethods': size=120000Kb used=21698Kb max_used=21698Kb free=98301Kb + bounds [0x000002251bc10000, 0x000002251d150000, 0x0000022523140000] +CodeHeap 'non-nmethods': size=5696Kb used=2390Kb max_used=2412Kb free=3305Kb + bounds [0x000002251b680000, 0x000002251b8f0000, 0x000002251bc10000] + total_blobs=10637 nmethods=9720 adapters=829 + compilation: enabled + stopped_count=0, restarted_count=0 + full_count=0 + +Compilation events (20 events): +Event: 79.992 Thread 0x0000022531a68800 nmethod 9783 0x000002251d13ca10 code [0x000002251d13cda0, 0x000002251d13ee58] +Event: 80.099 Thread 0x0000022531a66800 nmethod 9770 0x0000022523707d10 code [0x0000022523707f60, 0x000002252370a340] +Event: 80.100 Thread 0x0000022531a66800 9771 4 java.lang.StringUTF16::compress (50 bytes) +Event: 80.106 Thread 0x0000022531a66800 nmethod 9771 0x000002252370b210 code [0x000002252370b3a0, 0x000002252370b698] +Event: 80.107 Thread 0x0000022531a66800 9776 % 4 sun.nio.cs.UTF_8$Decoder::decodeArrayLoop @ 106 (691 bytes) +Event: 80.149 Thread 0x0000022531a68800 9784 2 sun.net.util.URLUtil::urlNoFragString (114 bytes) +Event: 80.150 Thread 0x0000022531a66800 nmethod 9776% 0x000002252370b790 code [0x000002252370b9e0, 0x000002252370c7b8] +Event: 80.151 Thread 0x0000022531a66800 9774 4 java.lang.String::startsWith (138 bytes) +Event: 80.151 Thread 0x0000022531a68800 nmethod 9784 0x000002251d13f890 code [0x000002251d13fb00, 0x000002251d140058] +Event: 80.151 Thread 0x0000022531a68800 9785 2 java.net.URL::getDefaultPort (8 bytes) +Event: 80.152 Thread 0x0000022531a68800 nmethod 9785 0x000002251d140390 code [0x000002251d140540, 0x000002251d140668] +Event: 80.157 Thread 0x0000022531a66800 nmethod 9774 0x000002252370d590 code [0x000002252370d720, 0x000002252370d918] +Event: 80.158 Thread 0x0000022531a66800 9773 4 java.lang.String::startsWith (7 bytes) +Event: 80.164 Thread 0x0000022531a66800 nmethod 9773 0x000002252370da90 code [0x000002252370dc20, 0x000002252370ddf8] +Event: 80.191 Thread 0x0000022531a66800 9786 4 java.lang.ClassLoader::preDefineClass (116 bytes) +Event: 80.241 Thread 0x0000022531a66800 nmethod 9786 0x000002252370df90 code [0x000002252370e1a0, 0x000002252370efc8] +Event: 80.242 Thread 0x0000022531a66800 9787 4 java.lang.String::hashCode (49 bytes) +Event: 80.250 Thread 0x0000022531a66800 nmethod 9787 0x000002252370f890 code [0x000002252370fa20, 0x000002252370fc78] +Event: 80.281 Thread 0x0000022531a68800 9788 3 org.slf4j.impl.StaticLoggerBinder::getSingleton (4 bytes) +Event: 80.281 Thread 0x0000022531a68800 nmethod 9788 0x000002251d140710 code [0x000002251d1408c0, 0x000002251d1409b8] + +GC Heap History (20 events): +Event: 40.469 GC heap before +{Heap before GC invocations=56 (full 0): + garbage-first heap total 176128K, used 133402K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 55 young (56320K), 4 survivors (4096K) + Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K + class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K +} +Event: 40.493 GC heap after +{Heap after GC invocations=57 (full 0): + garbage-first heap total 176128K, used 85256K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K + class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K +} +Event: 43.393 GC heap before +{Heap before GC invocations=57 (full 0): + garbage-first heap total 176128K, used 142600K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 63 young (64512K), 7 survivors (7168K) + Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K + class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K +} +Event: 43.441 GC heap after +{Heap after GC invocations=58 (full 0): + garbage-first heap total 176128K, used 87003K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 6 young (6144K), 6 survivors (6144K) + Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K + class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K +} +Event: 45.839 GC heap before +{Heap before GC invocations=58 (full 0): + garbage-first heap total 176128K, used 144347K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 63 young (64512K), 6 survivors (6144K) + Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K + class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K +} +Event: 45.877 GC heap after +{Heap after GC invocations=59 (full 0): + garbage-first heap total 176128K, used 89690K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 5 young (5120K), 5 survivors (5120K) + Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K + class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K +} +Event: 48.274 GC heap before +{Heap before GC invocations=60 (full 0): + garbage-first heap total 176128K, used 153178K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 61 young (62464K), 5 survivors (5120K) + Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K + class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K +} +Event: 48.337 GC heap after +{Heap after GC invocations=61 (full 0): + garbage-first heap total 211968K, used 99725K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K + class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K +} +Event: 52.007 GC heap before +{Heap before GC invocations=61 (full 0): + garbage-first heap total 211968K, used 167309K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 73 young (74752K), 7 survivors (7168K) + Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K + class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K +} +Event: 52.081 GC heap after +{Heap after GC invocations=62 (full 0): + garbage-first heap total 211968K, used 102211K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 6 young (6144K), 6 survivors (6144K) + Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K + class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K +} +Event: 63.878 GC heap before +{Heap before GC invocations=62 (full 0): + garbage-first heap total 211968K, used 175939K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 79 young (80896K), 6 survivors (6144K) + Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K + class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K +} +Event: 64.071 GC heap after +{Heap after GC invocations=63 (full 0): + garbage-first heap total 211968K, used 106847K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K + class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K +} +Event: 72.632 GC heap before +{Heap before GC invocations=64 (full 0): + garbage-first heap total 211968K, used 177503K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 76 young (77824K), 7 survivors (7168K) + Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K + class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K +} +Event: 72.787 GC heap after +{Heap after GC invocations=65 (full 0): + garbage-first heap total 211968K, used 109366K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K + class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K +} +Event: 73.860 GC heap before +{Heap before GC invocations=65 (full 0): + garbage-first heap total 211968K, used 119606K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 18 young (18432K), 7 survivors (7168K) + Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K + class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K +} +Event: 73.917 GC heap after +{Heap after GC invocations=66 (full 0): + garbage-first heap total 284672K, used 110080K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 4 young (4096K), 4 survivors (4096K) + Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K + class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K +} +Event: 80.027 GC heap before +{Heap before GC invocations=67 (full 0): + garbage-first heap total 284672K, used 179712K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 55 young (56320K), 4 survivors (4096K) + Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K + class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K +} +Event: 80.095 GC heap after +{Heap after GC invocations=68 (full 0): + garbage-first heap total 284672K, used 136936K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 7 young (7168K), 7 survivors (7168K) + Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K + class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K +} +Event: 80.287 GC heap before +{Heap before GC invocations=68 (full 0): + garbage-first heap total 284672K, used 142056K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 13 young (13312K), 7 survivors (7168K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +} +Event: 80.394 GC heap after +{Heap after GC invocations=69 (full 0): + garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) + region size 1024K, 1 young (1024K), 1 survivors (1024K) + Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K + class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K +} + +Deoptimization events (20 events): +Event: 79.976 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.976 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.977 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.977 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 +Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 +Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x0000022523146710 relative=0x0000000000000170 +Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000022523146710 method=java.lang.String.isLatin1()Z @ 10 c2 +Event: 79.981 Thread 0x00000225324c0800 DEOPT PACKING pc=0x0000022523146710 sp=0x0000008c56ffca00 +Event: 79.981 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc928 mode 2 +Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225236c90cc relative=0x00000000000013cc +Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225236c90cc method=java.util.concurrent.ConcurrentHashMap.putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object; @ 401 c2 +Event: 79.984 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225236c90cc sp=0x0000008c56ffca30 +Event: 79.984 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc9c0 mode 2 +Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225232060cc relative=0x000000000000124c +Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225232060cc method=java.util.concurrent.ConcurrentHashMap.transfer([Ljava/util/concurrent/ConcurrentHashMap$Node;[Ljava/util/concurrent/ConcurrentHashMap$Node;)V @ 352 c2 +Event: 79.993 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225232060cc sp=0x0000008c56ffc810 +Event: 79.993 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc788 mode 2 + +Classes redefined (0 events): +No events + +Internal exceptions (20 events): +Event: 77.831 Thread 0x000002253253b800 Exception (0x000000008ff476c8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.835 Thread 0x000002253253b800 Exception (0x000000008ff6ac98) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.836 Thread 0x000002253253b800 Exception (0x000000008ff83d68) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.837 Thread 0x000002253253b800 Exception (0x000000008ff9bd00) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.839 Thread 0x000002253253b800 Exception (0x000000008ffb3428) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.841 Thread 0x000002253253b800 Exception (0x000000008ffcb900) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.842 Thread 0x000002253253b800 Exception (0x000000008ffe3350) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.844 Thread 0x000002253253b800 Exception (0x000000008ffedb28) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.845 Thread 0x000002253253b800 Exception (0x000000008fff83a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.848 Thread 0x000002253253b800 Exception (0x000000008fe19198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.851 Thread 0x000002253253b800 Exception (0x000000008fe4e380) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.856 Thread 0x000002253253b800 Exception (0x000000008fe8b638) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.860 Thread 0x000002253253b800 Exception (0x000000008feb77a0) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.863 Thread 0x000002253253b800 Exception (0x000000008fee37a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.866 Thread 0x000002253253b800 Exception (0x000000008fd12198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.871 Thread 0x000002253253b800 Exception (0x000000008fd44978) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.901 Thread 0x000002253253b800 Exception (0x000000008fdf3650) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 77.903 Thread 0x000002253253b800 Exception (0x000000008fc06b90) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] +Event: 78.412 Thread 0x00000225324c0800 Implicit null exception at 0x00000225234c7165 to 0x00000225234c79dc +Event: 78.846 Thread 0x00000225324c0800 Exception (0x000000008f2f9b78) thrown at [./src/hotspot/share/prims/jni.cpp, line 616] + +Events (20 events): +Event: 80.272 loading class org/apache/http/impl/execchain/RedirectExec done +Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore +Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore done +Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator +Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator done +Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 +Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 done +Event: 80.277 loading class org/apache/http/client/ClientProtocolException +Event: 80.277 loading class org/apache/http/client/ClientProtocolException done +Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager +Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager done +Event: 80.281 loading class org/apache/http/client/utils/URIUtils +Event: 80.281 loading class org/apache/http/client/utils/URIUtils done +Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag +Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag done +Event: 80.285 loading class org/apache/http/HttpHost +Event: 80.285 loading class org/apache/http/HttpHost done +Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper +Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper done +Event: 80.287 Executing VM operation: CollectForMetadataAllocation + + +Dynamic libraries: +0x00007ff668680000 - 0x00007ff66868a000 C:\Program Files\Android\Android Studio1\jre\bin\java.exe +0x00007ffb8e7d0000 - 0x00007ffb8e9c8000 C:\WINDOWS\SYSTEM32\ntdll.dll +0x00007ffb8e630000 - 0x00007ffb8e6ef000 C:\WINDOWS\System32\KERNEL32.DLL +0x00007ffb8bfb0000 - 0x00007ffb8c2a6000 C:\WINDOWS\System32\KERNELBASE.dll +0x00007ffb8c2b0000 - 0x00007ffb8c3b0000 C:\WINDOWS\System32\ucrtbase.dll +0x00007ffb5be60000 - 0x00007ffb5be79000 C:\Program Files\Android\Android Studio1\jre\bin\jli.dll +0x00007ffb5be40000 - 0x00007ffb5be57000 C:\Program Files\Android\Android Studio1\jre\bin\VCRUNTIME140.dll +0x00007ffb8d450000 - 0x00007ffb8d5ed000 C:\WINDOWS\System32\USER32.dll +0x00007ffb8c540000 - 0x00007ffb8c562000 C:\WINDOWS\System32\win32u.dll +0x00007ffb8db60000 - 0x00007ffb8db8c000 C:\WINDOWS\System32\GDI32.dll +0x00007ffb8c710000 - 0x00007ffb8c825000 C:\WINDOWS\System32\gdi32full.dll +0x00007ffb8c670000 - 0x00007ffb8c70d000 C:\WINDOWS\System32\msvcp_win.dll +0x00007ffb7c7e0000 - 0x00007ffb7ca7a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll +0x00007ffb8dac0000 - 0x00007ffb8db5e000 C:\WINDOWS\System32\msvcrt.dll +0x00007ffb8ccd0000 - 0x00007ffb8cd00000 C:\WINDOWS\System32\IMM32.DLL +0x00007ffb3f2a0000 - 0x00007ffb3f33d000 C:\Program Files\Android\Android Studio1\jre\bin\msvcp140.dll +0x00007ffb23b50000 - 0x00007ffb24652000 C:\Program Files\Android\Android Studio1\jre\bin\server\jvm.dll +0x00007ffb8ca80000 - 0x00007ffb8cb2f000 C:\WINDOWS\System32\ADVAPI32.dll +0x00007ffb8e6f0000 - 0x00007ffb8e78c000 C:\WINDOWS\System32\sechost.dll +0x00007ffb8c830000 - 0x00007ffb8c956000 C:\WINDOWS\System32\RPCRT4.dll +0x00007ffb8ca70000 - 0x00007ffb8ca78000 C:\WINDOWS\System32\PSAPI.DLL +0x00007ffb85130000 - 0x00007ffb85139000 C:\WINDOWS\SYSTEM32\WSOCK32.dll +0x00007ffb8df00000 - 0x00007ffb8df6b000 C:\WINDOWS\System32\WS2_32.dll +0x00007ffb816a0000 - 0x00007ffb816aa000 C:\WINDOWS\SYSTEM32\VERSION.dll +0x00007ffb816b0000 - 0x00007ffb816d7000 C:\WINDOWS\SYSTEM32\WINMM.dll +0x00007ffb8a6f0000 - 0x00007ffb8a702000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll +0x00007ffb84710000 - 0x00007ffb84721000 C:\Program Files\Android\Android Studio1\jre\bin\verify.dll +0x00007ffb8a4e0000 - 0x00007ffb8a6c4000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL +0x00007ffb76690000 - 0x00007ffb766c4000 C:\WINDOWS\SYSTEM32\dbgcore.DLL +0x00007ffb8c5e0000 - 0x00007ffb8c662000 C:\WINDOWS\System32\bcryptPrimitives.dll +0x00007ffb7c210000 - 0x00007ffb7c239000 C:\Program Files\Android\Android Studio1\jre\bin\java.dll +0x00007ffb84330000 - 0x00007ffb8433b000 C:\Program Files\Android\Android Studio1\jre\bin\jimage.dll +0x00007ffb72a00000 - 0x00007ffb72a18000 C:\Program Files\Android\Android Studio1\jre\bin\zip.dll +0x00007ffb8cd00000 - 0x00007ffb8d444000 C:\WINDOWS\System32\SHELL32.dll +0x00007ffb89c00000 - 0x00007ffb8a393000 C:\WINDOWS\SYSTEM32\windows.storage.dll +0x00007ffb8e120000 - 0x00007ffb8e474000 C:\WINDOWS\System32\combase.dll +0x00007ffb8b890000 - 0x00007ffb8b8be000 C:\WINDOWS\SYSTEM32\Wldp.dll +0x00007ffb8c960000 - 0x00007ffb8ca0d000 C:\WINDOWS\System32\SHCORE.dll +0x00007ffb8cb30000 - 0x00007ffb8cb85000 C:\WINDOWS\System32\shlwapi.dll +0x00007ffb8bdf0000 - 0x00007ffb8be0f000 C:\WINDOWS\SYSTEM32\profapi.dll +0x00007ffb729e0000 - 0x00007ffb729fa000 C:\Program Files\Android\Android Studio1\jre\bin\net.dll +0x00007ffb7d4d0000 - 0x00007ffb7d5da000 C:\WINDOWS\SYSTEM32\WINHTTP.dll +0x00007ffb8b580000 - 0x00007ffb8b5ea000 C:\WINDOWS\system32\mswsock.dll +0x00007ffb729c0000 - 0x00007ffb729d4000 C:\Program Files\Android\Android Studio1\jre\bin\nio.dll +0x00007ffb64870000 - 0x00007ffb64897000 C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64\native-platform.dll +0x00007ffb3f150000 - 0x00007ffb3f294000 C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64\native-platform-file-events.dll +0x00007ffb7f180000 - 0x00007ffb7f18a000 C:\Program Files\Android\Android Studio1\jre\bin\management.dll +0x00007ffb7c200000 - 0x00007ffb7c20d000 C:\Program Files\Android\Android Studio1\jre\bin\management_ext.dll +0x00007ffb8b780000 - 0x00007ffb8b798000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll +0x00007ffb8aea0000 - 0x00007ffb8aed4000 C:\WINDOWS\system32\rsaenh.dll +0x00007ffb8c510000 - 0x00007ffb8c537000 C:\WINDOWS\System32\bcrypt.dll +0x00007ffb8bd70000 - 0x00007ffb8bd9e000 C:\WINDOWS\SYSTEM32\USERENV.dll +0x00007ffb8b770000 - 0x00007ffb8b77c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll +0x00007ffb8b270000 - 0x00007ffb8b2ac000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL +0x00007ffb8e5a0000 - 0x00007ffb8e5a8000 C:\WINDOWS\System32\NSI.dll +0x00007ffb7dfb0000 - 0x00007ffb7dfc7000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL +0x00007ffb7e4f0000 - 0x00007ffb7e50d000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL +0x00007ffb8b2b0000 - 0x00007ffb8b37a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll +0x00007ffb72570000 - 0x00007ffb72587000 C:\WINDOWS\system32\napinsp.dll +0x00007ffb72550000 - 0x00007ffb7256b000 C:\WINDOWS\system32\pnrpnsp.dll +0x00007ffb863a0000 - 0x00007ffb863b5000 C:\WINDOWS\system32\wshbth.dll +0x00007ffb874f0000 - 0x00007ffb8750d000 C:\WINDOWS\system32\NLAapi.dll +0x00007ffb72530000 - 0x00007ffb72542000 C:\WINDOWS\System32\winrnr.dll +0x00007ffb828b0000 - 0x00007ffb828ba000 C:\Windows\System32\rasadhlp.dll +0x00007ffb7b200000 - 0x00007ffb7b282000 C:\WINDOWS\System32\fwpuclnt.dll +0x00007ffb7f1a0000 - 0x00007ffb7f1c7000 C:\Program Files\Android\Android Studio1\jre\bin\sunec.dll + +dbghelp: loaded successfully - version: 4.0.5 - missing functions: none +symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio1\jre\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Android\Android Studio1\jre\bin\server;C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64;C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64 + +VM Arguments: +jvm_args: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant +java_command: org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 +java_class_path (initial): C:\Users\USER\.gradle\wrapper\dists\gradle-8.0.2-bin\25jlreiuz6u3xu2phlpa2vv4m\gradle-8.0.2\lib\gradle-launcher-8.0.2.jar +Launcher Type: SUN_STANDARD + +[Global flags] + intx CICompilerCount = 2 {product} {ergonomic} + uint ConcGCThreads = 1 {product} {ergonomic} + uint G1ConcRefinementThreads = 2 {product} {ergonomic} + size_t G1HeapRegionSize = 1048576 {product} {ergonomic} + uintx GCDrainStackTargetSize = 64 {product} {ergonomic} + size_t InitialHeapSize = 58720256 {product} {ergonomic} + size_t MarkStackSize = 4194304 {product} {ergonomic} + size_t MaxHeapSize = 2147483648 {product} {command line} + size_t MaxNewSize = 1287651328 {product} {ergonomic} + size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} + uintx NonNMethodCodeHeapSize = 5825164 {pd product} {ergonomic} + uintx NonProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} + uintx ProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} + uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} + bool SegmentedCodeCache = true {product} {ergonomic} + bool UseCompressedClassPointers = true {lp64_product} {ergonomic} + bool UseCompressedOops = true {lp64_product} {ergonomic} + bool UseG1GC = true {product} {ergonomic} + bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} + +Logging: +Log output configuration: + #0: stdout all=warning uptime,level,tags + #1: stderr all=off uptime,level,tags + +Environment Variables: +PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\USER\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3\bin;;C:\Users\USER\Programming\Maven\apache-maven-3.6.3\bin;C:\Users\USER\.dotnet\tools;C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USER\Programming\effective_android\flutter\bin; +USERNAME=USER +OS=Windows_NT +PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD + + + +--------------- S Y S T E M --------------- + +OS: Windows 10 , 64 bit Build 19041 (10.0.19041.3031) +OS uptime: 6 days 20:35 hours + +CPU:total 2 (initial active 2) (2 cores per cpu, 1 threads per core) family 21 model 112 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1, bmi2, fma + +Memory: 4k page, system-wide physical 3471M (45M free) +TotalPageFile size 14223M (AvailPageFile size 4M) +current process WorkingSet (physical memory assigned to process): 250M, peak: 323M +current process commit charge ("private bytes"): 537M, peak: 538M + +vm_info: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866) for windows-amd64 JRE (11.0.13+0-b1751.21-8125866), built on Feb 2 2022 03:00:22 by "builder" with MS VC++ 14.0 (VS2015) + +END. diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index f3da50b5..1815ff28 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -18,6 +18,7 @@ kotlin { } } + sourceSets { val commonMain by getting { dependencies { @@ -28,7 +29,18 @@ kotlin { // Decompose implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + + //Koin + api(Dependencies.Koin.core) + } + } + + val androidMain by getting { + dependencies { + //Koin + api(Dependencies.Koin.android) } } } + } diff --git a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt b/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt new file mode 100644 index 00000000..f0fca77e --- /dev/null +++ b/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt @@ -0,0 +1,7 @@ +package tablet.di + +import org.koin.core.context.startKoin + +fun initSelectRoomKoin() = startKoin { + modules(selectRoomModule) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt new file mode 100644 index 00000000..32efc178 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt @@ -0,0 +1,9 @@ +package tablet.di + +import org.koin.dsl.module +import tablet.domain.ISelectRoomInteractor +import tablet.domain.SelectRoomInteractorImpl + +val selectRoomModule = module{ + single { SelectRoomInteractorImpl(get()) } +} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt new file mode 100644 index 00000000..22d5433d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt @@ -0,0 +1,8 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo + +interface ISelectRoomInteractor { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt new file mode 100644 index 00000000..e7b69120 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt @@ -0,0 +1,9 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import tablet.network.ISelectRoomRepository + +class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): ISelectRoomInteractor { + override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt new file mode 100644 index 00000000..3a81e0df --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt @@ -0,0 +1,6 @@ +package tablet.domain.model + +data class Booking( + val nameRoom: String, + val eventInfo: EventInfo +) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..c1c4627d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt @@ -0,0 +1,9 @@ +package tablet.domain.model + +import java.util.Calendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt new file mode 100644 index 00000000..eb2dea3a --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt @@ -0,0 +1,8 @@ +package tablet.network + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo + +interface ISelectRoomRepository { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt new file mode 100644 index 00000000..1de4be7e --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen + +import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject +import tablet.domain.ISelectRoomInteractor +import tablet.domain.model.Booking + +class RealSelectRoomComponent(componentContext: ComponentContext, + booking: Booking) + : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ + private val interactor: ISelectRoomInteractor by inject() + val booking = booking + + private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) + override val state = _state.asStateFlow() + + + override fun bookRoom() { + TODO("Not yet implemented") + } + + override fun close() { + TODO("Not yet implemented") + } + +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index 1e221134..cdfdf472 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,7 +1,11 @@ package tablet.ui.selectRoomScreen -import com.arkivanov.decompose.ComponentContext +import kotlinx.coroutines.flow.StateFlow +import tablet.domain.model.Booking -class SelectRoomComponent(componentContext: ComponentContext) : ComponentContext by componentContext { +interface SelectRoomComponent { + val state: StateFlow + fun bookRoom() + fun close() } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index b485b41a..2daab3df 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -2,13 +2,34 @@ package tablet.ui.selectRoomScreen import androidx.compose.material.Text import androidx.compose.runtime.Composable +import androidx.compose.runtime.collectAsState +import androidx.compose.runtime.getValue @Composable -fun SelectRoomScreen(component: SelectRoomComponent){ - SelectRoomView() +fun SelectRoomScreen(component: RealSelectRoomComponent){ + val state by component.state.collectAsState() + + when{ + state.isData -> { + SelectRoomView(component) + } + + state.isLoad -> { + /* (Margarita Djinjolia) + not in design */ + } + + state.isError -> { + /* (Margarita Djinjolia) + not in design */ + } + } + } @Composable -fun SelectRoomView(){ - Text(text = "SelectRoomView") +fun SelectRoomView( + component: RealSelectRoomComponent +){ + Text(text = component.booking.nameRoom) } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt new file mode 100644 index 00000000..a0dc436d --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt @@ -0,0 +1,18 @@ +package tablet.ui.selectRoomScreen + +data class SelectRoomScreenState( + val isLoad: Boolean, + val isData: Boolean, + val isError: Boolean, + val error: String +){ + companion object { + val defaultState = + SelectRoomScreenState( + isLoad = false, + isData = true, + isError = false, + error = "" + ) + } +} diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index c730b128..db3f3f99 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -5,12 +5,14 @@ import androidx.appcompat.app.AppCompatActivity import androidx.activity.compose.setContent import band.effective.office.tablet.di.initRoomInfoKoin import com.arkivanov.decompose.defaultComponentContext +import tablet.di.initSelectRoomKoin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) initRoomInfoKoin() setContent { + initSelectRoomKoin() App(defaultComponentContext()) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index b628bde0..0be3fc5d 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,13 +1,16 @@ package band.effective.office.tablet.ui.root -import band.effective.office.tablet.ui.mainScreen.RealMainComponent +import band.effective.office.tablet.ui.mainScreen.MainComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.ui.selectRoomScreen.SelectRoomComponent +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import tablet.ui.selectRoomScreen.RealSelectRoomComponent +import java.util.Calendar class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -26,22 +29,35 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co ): Child = when (config) { is Config.Main -> { - Child.MainChild(RealMainComponent( + Child.MainChild(MainComponent( componentContext = componentContext, - OnSelectOtherRoomRequest = { + onClick = { navigation.push(Config.SelectRoom) } )) } is Config.SelectRoom -> { - Child.SelectRoomChild(SelectRoomComponent(componentContext)) + Child.SelectRoomChild( + RealSelectRoomComponent( + componentContext, + Booking + ("Sirius", + EventInfo + ( + Calendar.getInstance(), + Calendar.getInstance(), + "Ольга Белозёрова" + ) + ) + ) + ) } } sealed class Child { - data class SelectRoomChild(val component: SelectRoomComponent) : Child() - data class MainChild(val component: RealMainComponent) : Child() + data class SelectRoomChild(val component: RealSelectRoomComponent) : Child() + data class MainChild(val component: MainComponent) : Child() } sealed class Config : Parcelable { -- GitLab From 941877d4e2b2655a9053d85ea5f03ae44836f74f Mon Sep 17 00:00:00 2001 From: Margarita Date: Thu, 6 Jul 2023 10:51:30 +0600 Subject: [PATCH 41/63] [-] delete log file --- buildSrc/hs_err_pid49948.log | 851 ----------------------------------- 1 file changed, 851 deletions(-) delete mode 100644 buildSrc/hs_err_pid49948.log diff --git a/buildSrc/hs_err_pid49948.log b/buildSrc/hs_err_pid49948.log deleted file mode 100644 index c6cc489d..00000000 --- a/buildSrc/hs_err_pid49948.log +++ /dev/null @@ -1,851 +0,0 @@ -# -# There is insufficient memory for the Java Runtime Environment to continue. -# Native memory allocation (malloc) failed to allocate 1048576 bytes for AllocateHeap -# Possible reasons: -# The system is out of physical RAM or swap space -# The process is running with CompressedOops enabled, and the Java Heap may be blocking the growth of the native heap -# Possible solutions: -# Reduce memory load on the system -# Increase physical memory or swap space -# Check if swap backing store is full -# Decrease Java heap size (-Xmx/-Xms) -# Decrease number of Java threads -# Decrease Java thread stack sizes (-Xss) -# Set larger code cache with -XX:ReservedCodeCacheSize= -# JVM is running with Unscaled Compressed Oops mode in which the Java heap is -# placed in the first 4GB address space. The Java Heap base address is the -# maximum limit for the native heap growth. Please use -XX:HeapBaseMinAddress -# to set the Java Heap base and to place the Java Heap above 4GB virtual address. -# This output file may be truncated or incomplete. -# -# Out of Memory Error (./src/hotspot/share/memory/allocation.cpp:46), pid=49948, tid=54616 -# -# JRE version: OpenJDK Runtime Environment (11.0.13) (build 11.0.13+0-b1751.21-8125866) -# Java VM: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866, mixed mode, tiered, compressed oops, g1 gc, windows-amd64) -# No core dump will be written. Minidumps are not enabled by default on client versions of Windows -# - ---------------- S U M M A R Y ------------ - -Command Line: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 - -Host: AMD A6-9225 RADEON R4, 5 COMPUTE CORES 2C+3G , 2 cores, 3G, Windows 10 , 64 bit Build 19041 (10.0.19041.3031) -Time: Mon Jul 3 17:11:04 2023 elapsed time: 80.431619 seconds (0d 0h 1m 20s) - ---------------- T H R E A D --------------- - -Current thread (0x00000225319f6800): VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] - -Stack: [0x0000008c53200000,0x0000008c53300000] -[error occurred during error reporting (printing stack bounds), id 0xc0000005, EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000002251b68112d] - -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x6100fa] -V [jvm.dll+0x747090] -V [jvm.dll+0x7486ad] -V [jvm.dll+0x748ce5] -V [jvm.dll+0x748c9b] -V [jvm.dll+0x60f224] -V [jvm.dll+0x60f9b8] -C [ntdll.dll+0xa247f] -C [ntdll.dll+0x514f4] -C [ntdll.dll+0xa0f8e] -C 0x000002251b68112d - -VM_Operation (0x0000008c56ff9770): CollectForMetadataAllocation, mode: safepoint, requested by thread 0x00000225324c0800 - - ---------------- P R O C E S S --------------- - -Threads class SMR info: -_java_thread_list=0x0000022536238790, length=61, elements={ -0x0000022517b60800, 0x00000225319fa000, 0x0000022531a03800, 0x0000022531a19000, -0x0000022531a1c000, 0x0000022531a1d800, 0x0000022531a66800, 0x0000022531a68800, -0x0000022531a7c800, 0x0000022531cee800, 0x0000022532734000, 0x0000022532576800, -0x000002253351e800, 0x0000022531f56000, 0x000002253302a800, 0x000002253302b800, -0x000002253253b800, 0x00000225324ce000, 0x0000022531ecd000, 0x0000022531ea4800, -0x0000022531e9f000, 0x0000022531ea5800, 0x0000022531ea2000, 0x0000022531ea0800, -0x0000022531ea3000, 0x0000022531ea4000, 0x0000022531ea0000, 0x0000022531ea1800, -0x0000022533cce800, 0x0000022533ccb000, 0x0000022533ccf000, 0x0000022533cd0000, -0x0000022533cca800, 0x0000022533ccd000, 0x0000022533cd1000, 0x0000022533cd1800, -0x0000022533ccc000, 0x0000022533cd7800, 0x0000022533cd3800, 0x0000022533cd2800, -0x0000022533cd4000, 0x0000022533cd8000, 0x0000022533cd9000, 0x0000022533cd5000, -0x0000022533cd6000, 0x0000022533cd6800, 0x00000225324c2000, 0x00000225324c1800, -0x00000225324be000, 0x00000225324c3000, 0x00000225324c4000, 0x00000225324c4800, -0x00000225324bf000, 0x00000225324c5800, 0x00000225324bf800, 0x00000225324c6800, -0x00000225324c0800, 0x00000225324cb000, 0x00000225324cd000, 0x00000225324cc000, -0x00000225324c8000 -} - -Java Threads: ( => current thread ) - 0x0000022517b60800 JavaThread "main" [_thread_blocked, id=52892, stack(0x0000008c52c00000,0x0000008c52d00000)] - 0x00000225319fa000 JavaThread "Reference Handler" daemon [_thread_blocked, id=52232, stack(0x0000008c53300000,0x0000008c53400000)] - 0x0000022531a03800 JavaThread "Finalizer" daemon [_thread_blocked, id=44012, stack(0x0000008c53400000,0x0000008c53500000)] - 0x0000022531a19000 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=53300, stack(0x0000008c53500000,0x0000008c53600000)] - 0x0000022531a1c000 JavaThread "Attach Listener" daemon [_thread_blocked, id=49748, stack(0x0000008c53600000,0x0000008c53700000)] - 0x0000022531a1d800 JavaThread "Service Thread" daemon [_thread_blocked, id=46864, stack(0x0000008c53700000,0x0000008c53800000)] - 0x0000022531a66800 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=53760, stack(0x0000008c53800000,0x0000008c53900000)] - 0x0000022531a68800 JavaThread "C1 CompilerThread0" daemon [_thread_blocked, id=54680, stack(0x0000008c53900000,0x0000008c53a00000)] - 0x0000022531a7c800 JavaThread "Sweeper thread" daemon [_thread_blocked, id=46020, stack(0x0000008c53a00000,0x0000008c53b00000)] - 0x0000022531cee800 JavaThread "Common-Cleaner" daemon [_thread_blocked, id=55048, stack(0x0000008c53b00000,0x0000008c53c00000)] - 0x0000022532734000 JavaThread "Daemon health stats" [_thread_blocked, id=54880, stack(0x0000008c53e00000,0x0000008c53f00000)] - 0x0000022532576800 JavaThread "Incoming local TCP Connector on port 58623" [_thread_in_native, id=50576, stack(0x0000008c53f00000,0x0000008c54000000)] - 0x000002253351e800 JavaThread "Daemon periodic checks" [_thread_blocked, id=52448, stack(0x0000008c54000000,0x0000008c54100000)] - 0x0000022531f56000 JavaThread "Daemon" [_thread_blocked, id=54848, stack(0x0000008c54100000,0x0000008c54200000)] - 0x000002253302a800 JavaThread "Handler for socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_in_native, id=53764, stack(0x0000008c54200000,0x0000008c54300000)] - 0x000002253302b800 JavaThread "Cancel handler" [_thread_blocked, id=55084, stack(0x0000008c54300000,0x0000008c54400000)] - 0x000002253253b800 JavaThread "Daemon worker" [_thread_blocked, id=15576, stack(0x0000008c54400000,0x0000008c54500000)] - 0x00000225324ce000 JavaThread "Asynchronous log dispatcher for DefaultDaemonConnection: socket connection from /127.0.0.1:58623 to /127.0.0.1:58624" [_thread_blocked, id=43788, stack(0x0000008c54500000,0x0000008c54600000)] - 0x0000022531ecd000 JavaThread "Daemon client event forwarder" [_thread_blocked, id=54688, stack(0x0000008c54700000,0x0000008c54800000)] - 0x0000022531ea4800 JavaThread "Cache worker for journal cache (C:\Users\USER\.gradle\caches\journal-1)" [_thread_blocked, id=50804, stack(0x0000008c54800000,0x0000008c54900000)] - 0x0000022531e9f000 JavaThread "File lock request listener" [_thread_in_native, id=48844, stack(0x0000008c54900000,0x0000008c54a00000)] - 0x0000022531ea5800 JavaThread "Cache worker for file hash cache (C:\Users\USER\.gradle\caches\8.0.2\fileHashes)" [_thread_blocked, id=48008, stack(0x0000008c54a00000,0x0000008c54b00000)] - 0x0000022531ea2000 JavaThread "File watcher server" daemon [_thread_blocked, id=47932, stack(0x0000008c54b00000,0x0000008c54c00000)] - 0x0000022531ea0800 JavaThread "File watcher consumer" daemon [_thread_blocked, id=40928, stack(0x0000008c54c00000,0x0000008c54d00000)] - 0x0000022531ea3000 JavaThread "jar transforms" [_thread_blocked, id=20244, stack(0x0000008c54d00000,0x0000008c54e00000)] - 0x0000022531ea4000 JavaThread "jar transforms Thread 2" [_thread_blocked, id=54224, stack(0x0000008c54e00000,0x0000008c54f00000)] - 0x0000022531ea0000 JavaThread "Cache worker for checksums cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\checksums)" [_thread_blocked, id=37804, stack(0x0000008c54f00000,0x0000008c55000000)] - 0x0000022531ea1800 JavaThread "Cache worker for cache directory md-rule (C:\Users\USER\.gradle\caches\8.0.2\md-rule)" [_thread_blocked, id=52184, stack(0x0000008c55000000,0x0000008c55100000)] - 0x0000022533cce800 JavaThread "Cache worker for file content cache (C:\Users\USER\.gradle\caches\8.0.2\fileContent)" [_thread_blocked, id=54940, stack(0x0000008c55100000,0x0000008c55200000)] - 0x0000022533ccb000 JavaThread "Cache worker for file hash cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\fileHashes)" [_thread_blocked, id=50424, stack(0x0000008c55200000,0x0000008c55300000)] - 0x0000022533ccf000 JavaThread "Cache worker for cache directory md-supplier (C:\Users\USER\.gradle\caches\8.0.2\md-supplier)" [_thread_blocked, id=30304, stack(0x0000008c55300000,0x0000008c55400000)] - 0x0000022533cd0000 JavaThread "Cache worker for execution history cache (C:\Users\USER\.gradle\caches\8.0.2\executionHistory)" [_thread_blocked, id=54756, stack(0x0000008c55400000,0x0000008c55500000)] - 0x0000022533cca800 JavaThread "Cache worker for dependencies-accessors (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\dependencies-accessors)" [_thread_blocked, id=54948, stack(0x0000008c55700000,0x0000008c55800000)] - 0x0000022533ccd000 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=54772, stack(0x0000008c55800000,0x0000008c55900000)] - 0x0000022533cd1000 JavaThread "Memory manager" [_thread_blocked, id=64, stack(0x0000008c55900000,0x0000008c55a00000)] - 0x0000022533cd1800 JavaThread "Cache worker for Build Output Cleanup Cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\buildOutputCleanup)" [_thread_blocked, id=51880, stack(0x0000008c55a00000,0x0000008c55b00000)] - 0x0000022533ccc000 JavaThread "Cache worker for kotlin-dsl (C:\Users\USER\.gradle\caches\8.0.2\kotlin-dsl)" [_thread_blocked, id=53304, stack(0x0000008c55b00000,0x0000008c55c00000)] - 0x0000022533cd7800 JavaThread "Unconstrained build operations" [_thread_blocked, id=54808, stack(0x0000008c55c00000,0x0000008c55d00000)] - 0x0000022533cd3800 JavaThread "Unconstrained build operations Thread 2" [_thread_blocked, id=54200, stack(0x0000008c55d00000,0x0000008c55e00000)] - 0x0000022533cd2800 JavaThread "Unconstrained build operations Thread 3" [_thread_blocked, id=49596, stack(0x0000008c55e00000,0x0000008c55f00000)] - 0x0000022533cd4000 JavaThread "Unconstrained build operations Thread 4" [_thread_blocked, id=54500, stack(0x0000008c55f00000,0x0000008c56000000)] - 0x0000022533cd8000 JavaThread "Unconstrained build operations Thread 5" [_thread_blocked, id=52376, stack(0x0000008c56000000,0x0000008c56100000)] - 0x0000022533cd9000 JavaThread "Unconstrained build operations Thread 6" [_thread_blocked, id=54288, stack(0x0000008c56100000,0x0000008c56200000)] - 0x0000022533cd5000 JavaThread "Unconstrained build operations Thread 7" [_thread_blocked, id=55148, stack(0x0000008c56200000,0x0000008c56300000)] - 0x0000022533cd6000 JavaThread "Unconstrained build operations Thread 8" [_thread_blocked, id=54676, stack(0x0000008c56300000,0x0000008c56400000)] - 0x0000022533cd6800 JavaThread "Unconstrained build operations Thread 9" [_thread_blocked, id=52780, stack(0x0000008c56400000,0x0000008c56500000)] - 0x00000225324c2000 JavaThread "Unconstrained build operations Thread 10" [_thread_blocked, id=52528, stack(0x0000008c56500000,0x0000008c56600000)] - 0x00000225324c1800 JavaThread "Unconstrained build operations Thread 11" [_thread_blocked, id=54508, stack(0x0000008c56600000,0x0000008c56700000)] - 0x00000225324be000 JavaThread "Unconstrained build operations Thread 12" [_thread_blocked, id=51544, stack(0x0000008c56700000,0x0000008c56800000)] - 0x00000225324c3000 JavaThread "Unconstrained build operations Thread 13" [_thread_blocked, id=52856, stack(0x0000008c56800000,0x0000008c56900000)] - 0x00000225324c4000 JavaThread "Unconstrained build operations Thread 14" [_thread_blocked, id=30784, stack(0x0000008c56900000,0x0000008c56a00000)] - 0x00000225324c4800 JavaThread "Unconstrained build operations Thread 15" [_thread_blocked, id=41272, stack(0x0000008c56a00000,0x0000008c56b00000)] - 0x00000225324bf000 JavaThread "Unconstrained build operations Thread 16" [_thread_blocked, id=52956, stack(0x0000008c56b00000,0x0000008c56c00000)] - 0x00000225324c5800 JavaThread "Unconstrained build operations Thread 17" [_thread_blocked, id=44264, stack(0x0000008c56c00000,0x0000008c56d00000)] - 0x00000225324bf800 JavaThread "Unconstrained build operations Thread 18" [_thread_blocked, id=54308, stack(0x0000008c56d00000,0x0000008c56e00000)] - 0x00000225324c6800 JavaThread "Unconstrained build operations Thread 19" [_thread_blocked, id=51824, stack(0x0000008c56e00000,0x0000008c56f00000)] - 0x00000225324c0800 JavaThread "Unconstrained build operations Thread 20" [_thread_blocked, id=55232, stack(0x0000008c56f00000,0x0000008c57000000)] - 0x00000225324cb000 JavaThread "included builds" [_thread_blocked, id=54504, stack(0x0000008c52a00000,0x0000008c52b00000)] - 0x00000225324cd000 JavaThread "Execution worker" [_thread_blocked, id=51832, stack(0x0000008c52b00000,0x0000008c52c00000)] - 0x00000225324cc000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=47204, stack(0x0000008c57000000,0x0000008c57100000)] - 0x00000225324c8000 JavaThread "Cache worker for execution history cache (C:\Users\USER\Programming\student_labs\labs-office-elevator\buildSrc\.gradle\8.0.2\executionHistory)" [_thread_blocked, id=5536, stack(0x0000008c54600000,0x0000008c54700000)] - -Other Threads: -=>0x00000225319f6800 VMThread "VM Thread" [stack: 0x0000008c53200000,0x0000008c53300000] [id=54616] - 0x0000022531d1a800 WatcherThread [stack: 0x0000008c53c00000,0x0000008c53d00000] [id=53860] - 0x0000022517b73000 GCTaskThread "GC Thread#0" [stack: 0x0000008c52d00000,0x0000008c52e00000] [id=46300] - 0x0000022531c15800 GCTaskThread "GC Thread#1" [stack: 0x0000008c53d00000,0x0000008c53e00000] [id=49096] - 0x0000022517ba3800 ConcurrentGCThread "G1 Main Marker" [stack: 0x0000008c52e00000,0x0000008c52f00000] [id=50800] - 0x0000022517ba7800 ConcurrentGCThread "G1 Conc#0" [stack: 0x0000008c52f00000,0x0000008c53000000] [id=39368] - 0x0000022517be4800 ConcurrentGCThread "G1 Refine#0" [stack: 0x0000008c53000000,0x0000008c53100000] [id=49560] - 0x0000022517be5800 ConcurrentGCThread "G1 Young RemSet Sampling" [stack: 0x0000008c53100000,0x0000008c53200000] [id=55224] - -Threads with active compile tasks: - -VM state:at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: ([mutex/lock_event]) -[0x0000022517b5c200] Threads_lock - owner thread: 0x00000225319f6800 -[0x0000022517b5be10] Heap_lock - owner thread: 0x00000225324c0800 - -Heap address: 0x0000000080000000, size: 2048 MB, Compressed Oops mode: 32-bit -Narrow klass base: 0x0000000000000000, Narrow klass shift: 3 -Compressed class space size: 1073741824 Address: 0x0000000100000000 - -Heap: - garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 1 young (1024K), 1 survivors (1024K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1140736K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -Heap Regions: E=young(eden), S=young(survivor), O=old, HS=humongous(starts), HC=humongous(continues), CS=collection set, F=free, A=archive, TAMS=top-at-mark-start (previous, next) -| 0|0x0000000080000000, 0x0000000080100000, 0x0000000080100000|100%| O| |TAMS 0x0000000080100000, 0x0000000080100000| Untracked -| 1|0x0000000080100000, 0x0000000080200000, 0x0000000080200000|100%|HS| |TAMS 0x0000000080200000, 0x0000000080200000| Complete -| 2|0x0000000080200000, 0x0000000080300000, 0x0000000080300000|100%|HC| |TAMS 0x0000000080300000, 0x0000000080300000| Complete -| 3|0x0000000080300000, 0x0000000080400000, 0x0000000080400000|100%|HC| |TAMS 0x0000000080400000, 0x0000000080400000| Complete -| 4|0x0000000080400000, 0x0000000080500000, 0x0000000080500000|100%|HC| |TAMS 0x0000000080500000, 0x0000000080500000| Complete -| 5|0x0000000080500000, 0x0000000080600000, 0x0000000080600000|100%| O| |TAMS 0x0000000080600000, 0x0000000080600000| Untracked -| 6|0x0000000080600000, 0x0000000080700000, 0x0000000080700000|100%| O| |TAMS 0x0000000080700000, 0x0000000080700000| Untracked -| 7|0x0000000080700000, 0x0000000080800000, 0x0000000080800000|100%| O| |TAMS 0x0000000080800000, 0x0000000080800000| Untracked -| 8|0x0000000080800000, 0x0000000080900000, 0x0000000080900000|100%| O| |TAMS 0x0000000080900000, 0x0000000080900000| Untracked -| 9|0x0000000080900000, 0x0000000080a00000, 0x0000000080a00000|100%| O| |TAMS 0x0000000080a00000, 0x0000000080a00000| Untracked -| 10|0x0000000080a00000, 0x0000000080b00000, 0x0000000080b00000|100%| O| |TAMS 0x0000000080b00000, 0x0000000080b00000| Untracked -| 11|0x0000000080b00000, 0x0000000080c00000, 0x0000000080c00000|100%| O| |TAMS 0x0000000080c00000, 0x0000000080c00000| Untracked -| 12|0x0000000080c00000, 0x0000000080d00000, 0x0000000080d00000|100%| O| |TAMS 0x0000000080d00000, 0x0000000080d00000| Untracked -| 13|0x0000000080d00000, 0x0000000080e00000, 0x0000000080e00000|100%| O| |TAMS 0x0000000080e00000, 0x0000000080e00000| Untracked -| 14|0x0000000080e00000, 0x0000000080f00000, 0x0000000080f00000|100%| O| |TAMS 0x0000000080f00000, 0x0000000080f00000| Untracked -| 15|0x0000000080f00000, 0x0000000081000000, 0x0000000081000000|100%| O| |TAMS 0x0000000081000000, 0x0000000081000000| Untracked -| 16|0x0000000081000000, 0x0000000081100000, 0x0000000081100000|100%| O| |TAMS 0x0000000081100000, 0x0000000081100000| Untracked -| 17|0x0000000081100000, 0x0000000081200000, 0x0000000081200000|100%| O| |TAMS 0x0000000081200000, 0x0000000081200000| Untracked -| 18|0x0000000081200000, 0x0000000081300000, 0x0000000081300000|100%|HS| |TAMS 0x0000000081300000, 0x0000000081300000| Complete -| 19|0x0000000081300000, 0x0000000081400000, 0x0000000081400000|100%|HC| |TAMS 0x0000000081400000, 0x0000000081400000| Complete -| 20|0x0000000081400000, 0x0000000081500000, 0x0000000081500000|100%|HS| |TAMS 0x0000000081500000, 0x0000000081500000| Complete -| 21|0x0000000081500000, 0x0000000081600000, 0x0000000081600000|100%|HC| |TAMS 0x0000000081600000, 0x0000000081600000| Complete -| 22|0x0000000081600000, 0x0000000081700000, 0x0000000081700000|100%|HC| |TAMS 0x0000000081700000, 0x0000000081700000| Complete -| 23|0x0000000081700000, 0x0000000081800000, 0x0000000081800000|100%| O| |TAMS 0x0000000081800000, 0x0000000081800000| Untracked -| 24|0x0000000081800000, 0x0000000081900000, 0x0000000081900000|100%|HS| |TAMS 0x0000000081900000, 0x0000000081900000| Complete -| 25|0x0000000081900000, 0x0000000081a00000, 0x0000000081a00000|100%|HC| |TAMS 0x0000000081a00000, 0x0000000081a00000| Complete -| 26|0x0000000081a00000, 0x0000000081b00000, 0x0000000081b00000|100%|HC| |TAMS 0x0000000081b00000, 0x0000000081b00000| Complete -| 27|0x0000000081b00000, 0x0000000081c00000, 0x0000000081c00000|100%| O| |TAMS 0x0000000081c00000, 0x0000000081c00000| Untracked -| 28|0x0000000081c00000, 0x0000000081d00000, 0x0000000081d00000|100%| O| |TAMS 0x0000000081d00000, 0x0000000081d00000| Untracked -| 29|0x0000000081d00000, 0x0000000081e00000, 0x0000000081e00000|100%| O| |TAMS 0x0000000081e00000, 0x0000000081e00000| Untracked -| 30|0x0000000081e00000, 0x0000000081f00000, 0x0000000081f00000|100%| O| |TAMS 0x0000000081f00000, 0x0000000081f00000| Untracked -| 31|0x0000000081f00000, 0x0000000082000000, 0x0000000082000000|100%|HS| |TAMS 0x0000000082000000, 0x0000000082000000| Complete -| 32|0x0000000082000000, 0x0000000082100000, 0x0000000082100000|100%|HC| |TAMS 0x0000000082100000, 0x0000000082100000| Complete -| 33|0x0000000082100000, 0x0000000082200000, 0x0000000082200000|100%|HC| |TAMS 0x0000000082200000, 0x0000000082200000| Complete -| 34|0x0000000082200000, 0x0000000082300000, 0x0000000082300000|100%|HC| |TAMS 0x0000000082300000, 0x0000000082300000| Complete -| 35|0x0000000082300000, 0x0000000082400000, 0x0000000082400000|100%|HS| |TAMS 0x0000000082400000, 0x0000000082400000| Complete -| 36|0x0000000082400000, 0x0000000082500000, 0x0000000082500000|100%|HC| |TAMS 0x0000000082500000, 0x0000000082500000| Complete -| 37|0x0000000082500000, 0x0000000082600000, 0x0000000082600000|100%|HC| |TAMS 0x0000000082600000, 0x0000000082600000| Complete -| 38|0x0000000082600000, 0x0000000082700000, 0x0000000082700000|100%|HC| |TAMS 0x0000000082700000, 0x0000000082700000| Complete -| 39|0x0000000082700000, 0x0000000082800000, 0x0000000082800000|100%|HC| |TAMS 0x0000000082800000, 0x0000000082800000| Complete -| 40|0x0000000082800000, 0x0000000082900000, 0x0000000082900000|100%| O| |TAMS 0x0000000082900000, 0x0000000082900000| Untracked -| 41|0x0000000082900000, 0x0000000082a00000, 0x0000000082a00000|100%| O| |TAMS 0x0000000082a00000, 0x0000000082a00000| Untracked -| 42|0x0000000082a00000, 0x0000000082b00000, 0x0000000082b00000|100%|HS| |TAMS 0x0000000082b00000, 0x0000000082b00000| Complete -| 43|0x0000000082b00000, 0x0000000082c00000, 0x0000000082c00000|100%| O| |TAMS 0x0000000082c00000, 0x0000000082c00000| Untracked -| 44|0x0000000082c00000, 0x0000000082d00000, 0x0000000082d00000|100%| O| |TAMS 0x0000000082d00000, 0x0000000082d00000| Untracked -| 45|0x0000000082d00000, 0x0000000082e00000, 0x0000000082e00000|100%| O| |TAMS 0x0000000082e00000, 0x0000000082e00000| Untracked -| 46|0x0000000082e00000, 0x0000000082f00000, 0x0000000082f00000|100%| O| |TAMS 0x0000000082f00000, 0x0000000082f00000| Untracked -| 47|0x0000000082f00000, 0x0000000083000000, 0x0000000083000000|100%| O| |TAMS 0x0000000083000000, 0x0000000083000000| Untracked -| 48|0x0000000083000000, 0x0000000083100000, 0x0000000083100000|100%| O| |TAMS 0x0000000083100000, 0x0000000083100000| Untracked -| 49|0x0000000083100000, 0x0000000083200000, 0x0000000083200000|100%|HS| |TAMS 0x0000000083200000, 0x0000000083200000| Complete -| 50|0x0000000083200000, 0x0000000083300000, 0x0000000083300000|100%|HC| |TAMS 0x0000000083300000, 0x0000000083300000| Complete -| 51|0x0000000083300000, 0x0000000083400000, 0x0000000083400000|100%|HC| |TAMS 0x0000000083400000, 0x0000000083400000| Complete -| 52|0x0000000083400000, 0x0000000083500000, 0x0000000083500000|100%|HS| |TAMS 0x0000000083500000, 0x0000000083500000| Complete -| 53|0x0000000083500000, 0x0000000083600000, 0x0000000083600000|100%|HC| |TAMS 0x0000000083600000, 0x0000000083600000| Complete -| 54|0x0000000083600000, 0x0000000083700000, 0x0000000083700000|100%| O| |TAMS 0x0000000083700000, 0x0000000083700000| Untracked -| 55|0x0000000083700000, 0x0000000083800000, 0x0000000083800000|100%| O| |TAMS 0x0000000083800000, 0x0000000083800000| Untracked -| 56|0x0000000083800000, 0x0000000083900000, 0x0000000083900000|100%|HS| |TAMS 0x0000000083900000, 0x0000000083900000| Complete -| 57|0x0000000083900000, 0x0000000083a00000, 0x0000000083a00000|100%|HC| |TAMS 0x0000000083a00000, 0x0000000083a00000| Complete -| 58|0x0000000083a00000, 0x0000000083b00000, 0x0000000083b00000|100%|HC| |TAMS 0x0000000083b00000, 0x0000000083b00000| Complete -| 59|0x0000000083b00000, 0x0000000083c00000, 0x0000000083c00000|100%|HS| |TAMS 0x0000000083c00000, 0x0000000083c00000| Complete -| 60|0x0000000083c00000, 0x0000000083d00000, 0x0000000083d00000|100%|HC| |TAMS 0x0000000083d00000, 0x0000000083d00000| Complete -| 61|0x0000000083d00000, 0x0000000083e00000, 0x0000000083e00000|100%|HC| |TAMS 0x0000000083e00000, 0x0000000083e00000| Complete -| 62|0x0000000083e00000, 0x0000000083f00000, 0x0000000083f00000|100%|HC| |TAMS 0x0000000083f00000, 0x0000000083f00000| Complete -| 63|0x0000000083f00000, 0x0000000084000000, 0x0000000084000000|100%| O| |TAMS 0x0000000084000000, 0x0000000084000000| Untracked -| 64|0x0000000084000000, 0x0000000084100000, 0x0000000084100000|100%| O| |TAMS 0x0000000084100000, 0x0000000084100000| Untracked -| 65|0x0000000084100000, 0x0000000084200000, 0x0000000084200000|100%| O| |TAMS 0x0000000084200000, 0x0000000084200000| Untracked -| 66|0x0000000084200000, 0x0000000084300000, 0x0000000084300000|100%| O| |TAMS 0x0000000084300000, 0x0000000084300000| Untracked -| 67|0x0000000084300000, 0x0000000084400000, 0x0000000084400000|100%| O| |TAMS 0x0000000084400000, 0x0000000084400000| Untracked -| 68|0x0000000084400000, 0x0000000084500000, 0x0000000084500000|100%| O| |TAMS 0x0000000084500000, 0x0000000084500000| Untracked -| 69|0x0000000084500000, 0x0000000084600000, 0x0000000084600000|100%| O| |TAMS 0x0000000084600000, 0x0000000084600000| Untracked -| 70|0x0000000084600000, 0x0000000084700000, 0x0000000084700000|100%| O| |TAMS 0x0000000084700000, 0x0000000084700000| Untracked -| 71|0x0000000084700000, 0x0000000084800000, 0x0000000084800000|100%| O| |TAMS 0x0000000084800000, 0x0000000084800000| Untracked -| 72|0x0000000084800000, 0x0000000084900000, 0x0000000084900000|100%|HS| |TAMS 0x0000000084900000, 0x0000000084900000| Complete -| 73|0x0000000084900000, 0x0000000084a00000, 0x0000000084a00000|100%|HC| |TAMS 0x0000000084a00000, 0x0000000084a00000| Complete -| 74|0x0000000084a00000, 0x0000000084b00000, 0x0000000084b00000|100%|HC| |TAMS 0x0000000084b00000, 0x0000000084b00000| Complete -| 75|0x0000000084b00000, 0x0000000084c00000, 0x0000000084c00000|100%|HC| |TAMS 0x0000000084c00000, 0x0000000084c00000| Complete -| 76|0x0000000084c00000, 0x0000000084d00000, 0x0000000084d00000|100%|HC| |TAMS 0x0000000084d00000, 0x0000000084d00000| Complete -| 77|0x0000000084d00000, 0x0000000084e00000, 0x0000000084e00000|100%| O| |TAMS 0x0000000084e00000, 0x0000000084e00000| Untracked -| 78|0x0000000084e00000, 0x0000000084f00000, 0x0000000084f00000|100%| O| |TAMS 0x0000000084f00000, 0x0000000084f00000| Untracked -| 79|0x0000000084f00000, 0x0000000085000000, 0x0000000085000000|100%| O| |TAMS 0x0000000085000000, 0x0000000085000000| Untracked -| 80|0x0000000085000000, 0x0000000085100000, 0x0000000085100000|100%| O| |TAMS 0x0000000085100000, 0x0000000085100000| Untracked -| 81|0x0000000085100000, 0x0000000085200000, 0x0000000085200000|100%| O| |TAMS 0x0000000085200000, 0x0000000085200000| Untracked -| 82|0x0000000085200000, 0x0000000085300000, 0x0000000085300000|100%| O| |TAMS 0x0000000085300000, 0x0000000085300000| Untracked -| 83|0x0000000085300000, 0x0000000085400000, 0x0000000085400000|100%|HS| |TAMS 0x0000000085400000, 0x0000000085400000| Complete -| 84|0x0000000085400000, 0x0000000085500000, 0x0000000085500000|100%|HC| |TAMS 0x0000000085500000, 0x0000000085500000| Complete -| 85|0x0000000085500000, 0x0000000085600000, 0x0000000085600000|100%|HS| |TAMS 0x0000000085600000, 0x0000000085600000| Complete -| 86|0x0000000085600000, 0x0000000085700000, 0x0000000085700000|100%|HC| |TAMS 0x0000000085700000, 0x0000000085700000| Complete -| 87|0x0000000085700000, 0x0000000085800000, 0x0000000085800000|100%|HC| |TAMS 0x0000000085800000, 0x0000000085800000| Complete -| 88|0x0000000085800000, 0x0000000085900000, 0x0000000085900000|100%|HC| |TAMS 0x0000000085900000, 0x0000000085900000| Complete -| 89|0x0000000085900000, 0x0000000085a00000, 0x0000000085a00000|100%| O| |TAMS 0x0000000085a00000, 0x0000000085a00000| Untracked -| 90|0x0000000085a00000, 0x0000000085b00000, 0x0000000085b00000|100%| O| |TAMS 0x0000000085b00000, 0x0000000085b00000| Untracked -| 91|0x0000000085b00000, 0x0000000085c00000, 0x0000000085c00000|100%| O| |TAMS 0x0000000085c00000, 0x0000000085c00000| Untracked -| 92|0x0000000085c00000, 0x0000000085d00000, 0x0000000085d00000|100%| O| |TAMS 0x0000000085d00000, 0x0000000085d00000| Untracked -| 93|0x0000000085d00000, 0x0000000085e00000, 0x0000000085e00000|100%| O| |TAMS 0x0000000085e00000, 0x0000000085e00000| Untracked -| 94|0x0000000085e00000, 0x0000000085f00000, 0x0000000085f00000|100%| O| |TAMS 0x0000000085f00000, 0x0000000085f00000| Untracked -| 95|0x0000000085f00000, 0x0000000086000000, 0x0000000086000000|100%| O| |TAMS 0x0000000086000000, 0x0000000086000000| Untracked -| 96|0x0000000086000000, 0x0000000086100000, 0x0000000086100000|100%| O| |TAMS 0x0000000086100000, 0x0000000086100000| Untracked -| 97|0x0000000086100000, 0x0000000086200000, 0x0000000086200000|100%| O| |TAMS 0x0000000086200000, 0x0000000086200000| Untracked -| 98|0x0000000086200000, 0x0000000086300000, 0x0000000086300000|100%| O| |TAMS 0x0000000086300000, 0x0000000086300000| Untracked -| 99|0x0000000086300000, 0x0000000086400000, 0x0000000086400000|100%| O| |TAMS 0x0000000086400000, 0x0000000086400000| Untracked -| 100|0x0000000086400000, 0x0000000086500000, 0x0000000086500000|100%| O| |TAMS 0x0000000086500000, 0x0000000086500000| Untracked -| 101|0x0000000086500000, 0x0000000086600000, 0x0000000086600000|100%| O| |TAMS 0x0000000086600000, 0x0000000086600000| Untracked -| 102|0x0000000086600000, 0x0000000086700000, 0x0000000086700000|100%| O| |TAMS 0x0000000086700000, 0x0000000086700000| Untracked -| 103|0x0000000086700000, 0x0000000086800000, 0x0000000086800000|100%| O| |TAMS 0x0000000086800000, 0x0000000086800000| Untracked -| 104|0x0000000086800000, 0x0000000086900000, 0x0000000086900000|100%|HS| |TAMS 0x0000000086800000, 0x0000000086900000| Complete -| 105|0x0000000086900000, 0x0000000086a00000, 0x0000000086a00000|100%|HC| |TAMS 0x0000000086900000, 0x0000000086a00000| Complete -| 106|0x0000000086a00000, 0x0000000086b00000, 0x0000000086b00000|100%|HS| |TAMS 0x0000000086a00000, 0x0000000086b00000| Complete -| 107|0x0000000086b00000, 0x0000000086c00000, 0x0000000086c00000|100%|HC| |TAMS 0x0000000086b00000, 0x0000000086c00000| Complete -| 108|0x0000000086c00000, 0x0000000086d00000, 0x0000000086d00000|100%|HC| |TAMS 0x0000000086c00000, 0x0000000086d00000| Complete -| 109|0x0000000086d00000, 0x0000000086e00000, 0x0000000086e00000|100%|HS| |TAMS 0x0000000086d00000, 0x0000000086e00000| Complete -| 110|0x0000000086e00000, 0x0000000086f00000, 0x0000000086f00000|100%|HC| |TAMS 0x0000000086e00000, 0x0000000086f00000| Complete -| 111|0x0000000086f00000, 0x0000000087000000, 0x0000000087000000|100%|HC| |TAMS 0x0000000086f00000, 0x0000000087000000| Complete -| 112|0x0000000087000000, 0x0000000087100000, 0x0000000087100000|100%|HS| |TAMS 0x0000000087000000, 0x0000000087100000| Complete -| 113|0x0000000087100000, 0x0000000087200000, 0x0000000087200000|100%|HC| |TAMS 0x0000000087100000, 0x0000000087200000| Complete -| 114|0x0000000087200000, 0x0000000087300000, 0x0000000087300000|100%|HC| |TAMS 0x0000000087200000, 0x0000000087300000| Complete -| 115|0x0000000087300000, 0x0000000087400000, 0x0000000087400000|100%|HC| |TAMS 0x0000000087300000, 0x0000000087400000| Complete -| 116|0x0000000087400000, 0x0000000087500000, 0x0000000087500000|100%|HS| |TAMS 0x0000000087400000, 0x0000000087500000| Complete -| 117|0x0000000087500000, 0x0000000087600000, 0x0000000087600000|100%|HC| |TAMS 0x0000000087500000, 0x0000000087600000| Complete -| 118|0x0000000087600000, 0x0000000087700000, 0x0000000087700000|100%|HC| |TAMS 0x0000000087600000, 0x0000000087700000| Complete -| 119|0x0000000087700000, 0x0000000087800000, 0x0000000087800000|100%|HC| |TAMS 0x0000000087700000, 0x0000000087800000| Complete -| 120|0x0000000087800000, 0x0000000087900000, 0x0000000087900000|100%|HC| |TAMS 0x0000000087800000, 0x0000000087900000| Complete -| 121|0x0000000087900000, 0x0000000087a00000, 0x0000000087a00000|100%|HS| |TAMS 0x0000000087900000, 0x0000000087a00000| Complete -| 122|0x0000000087a00000, 0x0000000087b00000, 0x0000000087b00000|100%| O| |TAMS 0x0000000087a00000, 0x0000000087b00000| Untracked -| 123|0x0000000087b00000, 0x0000000087c00000, 0x0000000087c00000|100%| O| |TAMS 0x0000000087b00000, 0x0000000087c00000| Untracked -| 124|0x0000000087c00000, 0x0000000087d00000, 0x0000000087d00000|100%| O| |TAMS 0x0000000087c00000, 0x0000000087d00000| Untracked -| 125|0x0000000087d00000, 0x0000000087e00000, 0x0000000087e00000|100%| O| |TAMS 0x0000000087d00000, 0x0000000087e00000| Untracked -| 126|0x0000000087e00000, 0x0000000087f00000, 0x0000000087f00000|100%| O| |TAMS 0x0000000087e00000, 0x0000000087f00000| Untracked -| 127|0x0000000087f00000, 0x0000000088000000, 0x0000000088000000|100%| O| |TAMS 0x0000000087f00000, 0x0000000088000000| Untracked -| 128|0x0000000088000000, 0x0000000088100000, 0x0000000088100000|100%| O| |TAMS 0x0000000088000000, 0x0000000088100000| Untracked -| 129|0x0000000088100000, 0x0000000088200000, 0x0000000088200000|100%| O| |TAMS 0x0000000088100000, 0x0000000088200000| Untracked -| 130|0x0000000088200000, 0x0000000088300000, 0x0000000088300000|100%| O| |TAMS 0x0000000088200000, 0x0000000088300000| Untracked -| 131|0x0000000088300000, 0x0000000088400000, 0x0000000088400000|100%| O| |TAMS 0x0000000088300000, 0x0000000088400000| Untracked -| 132|0x0000000088400000, 0x0000000088500000, 0x0000000088500000|100%| O| |TAMS 0x0000000088400000, 0x0000000088500000| Untracked -| 133|0x0000000088500000, 0x0000000088600000, 0x0000000088600000|100%| O| |TAMS 0x0000000088500000, 0x0000000088600000| Untracked -| 134|0x0000000088600000, 0x0000000088600000, 0x0000000088700000| 0%| F| |TAMS 0x0000000088600000, 0x0000000088600000| Untracked -| 135|0x0000000088700000, 0x0000000088700000, 0x0000000088800000| 0%| F| |TAMS 0x0000000088700000, 0x0000000088700000| Untracked -| 136|0x0000000088800000, 0x0000000088800000, 0x0000000088900000| 0%| F| |TAMS 0x0000000088800000, 0x0000000088800000| Untracked -| 137|0x0000000088900000, 0x0000000088900000, 0x0000000088a00000| 0%| F| |TAMS 0x0000000088900000, 0x0000000088900000| Untracked -| 138|0x0000000088a00000, 0x0000000088a00000, 0x0000000088b00000| 0%| F| |TAMS 0x0000000088a00000, 0x0000000088a00000| Untracked -| 139|0x0000000088b00000, 0x0000000088b00000, 0x0000000088c00000| 0%| F| |TAMS 0x0000000088b00000, 0x0000000088b00000| Untracked -| 140|0x0000000088c00000, 0x0000000088c00000, 0x0000000088d00000| 0%| F| |TAMS 0x0000000088c00000, 0x0000000088c00000| Untracked -| 141|0x0000000088d00000, 0x0000000088d00000, 0x0000000088e00000| 0%| F| |TAMS 0x0000000088d00000, 0x0000000088d00000| Untracked -| 142|0x0000000088e00000, 0x0000000088e00000, 0x0000000088f00000| 0%| F| |TAMS 0x0000000088e00000, 0x0000000088e00000| Untracked -| 143|0x0000000088f00000, 0x0000000088f00000, 0x0000000089000000| 0%| F| |TAMS 0x0000000088f00000, 0x0000000088f00000| Untracked -| 144|0x0000000089000000, 0x0000000089000000, 0x0000000089100000| 0%| F| |TAMS 0x0000000089000000, 0x0000000089000000| Untracked -| 145|0x0000000089100000, 0x0000000089100000, 0x0000000089200000| 0%| F| |TAMS 0x0000000089100000, 0x0000000089100000| Untracked -| 146|0x0000000089200000, 0x0000000089200000, 0x0000000089300000| 0%| F| |TAMS 0x0000000089200000, 0x0000000089200000| Untracked -| 147|0x0000000089300000, 0x0000000089300000, 0x0000000089400000| 0%| F| |TAMS 0x0000000089300000, 0x0000000089300000| Untracked -| 148|0x0000000089400000, 0x0000000089400000, 0x0000000089500000| 0%| F| |TAMS 0x0000000089400000, 0x0000000089400000| Untracked -| 149|0x0000000089500000, 0x0000000089500000, 0x0000000089600000| 0%| F| |TAMS 0x0000000089500000, 0x0000000089500000| Untracked -| 150|0x0000000089600000, 0x0000000089600000, 0x0000000089700000| 0%| F| |TAMS 0x0000000089600000, 0x0000000089600000| Untracked -| 151|0x0000000089700000, 0x0000000089700000, 0x0000000089800000| 0%| F| |TAMS 0x0000000089700000, 0x0000000089700000| Untracked -| 152|0x0000000089800000, 0x0000000089800000, 0x0000000089900000| 0%| F| |TAMS 0x0000000089800000, 0x0000000089800000| Untracked -| 153|0x0000000089900000, 0x0000000089900000, 0x0000000089a00000| 0%| F| |TAMS 0x0000000089900000, 0x0000000089900000| Untracked -| 154|0x0000000089a00000, 0x0000000089a00000, 0x0000000089b00000| 0%| F| |TAMS 0x0000000089a00000, 0x0000000089a00000| Untracked -| 155|0x0000000089b00000, 0x0000000089b00000, 0x0000000089c00000| 0%| F| |TAMS 0x0000000089b00000, 0x0000000089b00000| Untracked -| 156|0x0000000089c00000, 0x0000000089c00000, 0x0000000089d00000| 0%| F| |TAMS 0x0000000089c00000, 0x0000000089c00000| Untracked -| 157|0x0000000089d00000, 0x0000000089d00000, 0x0000000089e00000| 0%| F| |TAMS 0x0000000089d00000, 0x0000000089d00000| Untracked -| 158|0x0000000089e00000, 0x0000000089e00000, 0x0000000089f00000| 0%| F| |TAMS 0x0000000089e00000, 0x0000000089e00000| Untracked -| 159|0x0000000089f00000, 0x0000000089f00000, 0x000000008a000000| 0%| F| |TAMS 0x0000000089f00000, 0x0000000089f00000| Untracked -| 160|0x000000008a000000, 0x000000008a000000, 0x000000008a100000| 0%| F| |TAMS 0x000000008a000000, 0x000000008a000000| Untracked -| 161|0x000000008a100000, 0x000000008a100000, 0x000000008a200000| 0%| F| |TAMS 0x000000008a100000, 0x000000008a100000| Untracked -| 162|0x000000008a200000, 0x000000008a200000, 0x000000008a300000| 0%| F| |TAMS 0x000000008a200000, 0x000000008a200000| Untracked -| 163|0x000000008a300000, 0x000000008a300000, 0x000000008a400000| 0%| F| |TAMS 0x000000008a300000, 0x000000008a300000| Untracked -| 164|0x000000008a400000, 0x000000008a400000, 0x000000008a500000| 0%| F| |TAMS 0x000000008a400000, 0x000000008a400000| Untracked -| 165|0x000000008a500000, 0x000000008a500000, 0x000000008a600000| 0%| F| |TAMS 0x000000008a500000, 0x000000008a500000| Untracked -| 166|0x000000008a600000, 0x000000008a600000, 0x000000008a700000| 0%| F| |TAMS 0x000000008a600000, 0x000000008a600000| Untracked -| 167|0x000000008a700000, 0x000000008a700000, 0x000000008a800000| 0%| F| |TAMS 0x000000008a700000, 0x000000008a700000| Untracked -| 168|0x000000008a800000, 0x000000008a800000, 0x000000008a900000| 0%| F| |TAMS 0x000000008a800000, 0x000000008a800000| Untracked -| 169|0x000000008a900000, 0x000000008a900000, 0x000000008aa00000| 0%| F| |TAMS 0x000000008a900000, 0x000000008a900000| Untracked -| 170|0x000000008aa00000, 0x000000008aa00000, 0x000000008ab00000| 0%| F| |TAMS 0x000000008aa00000, 0x000000008aa00000| Untracked -| 171|0x000000008ab00000, 0x000000008ab00000, 0x000000008ac00000| 0%| F| |TAMS 0x000000008ab00000, 0x000000008ab00000| Untracked -| 172|0x000000008ac00000, 0x000000008ac00000, 0x000000008ad00000| 0%| F| |TAMS 0x000000008ac00000, 0x000000008ac00000| Untracked -| 173|0x000000008ad00000, 0x000000008ad00000, 0x000000008ae00000| 0%| F| |TAMS 0x000000008ad00000, 0x000000008ad00000| Untracked -| 174|0x000000008ae00000, 0x000000008ae00000, 0x000000008af00000| 0%| F| |TAMS 0x000000008ae00000, 0x000000008ae00000| Untracked -| 175|0x000000008af00000, 0x000000008af00000, 0x000000008b000000| 0%| F| |TAMS 0x000000008af00000, 0x000000008af00000| Untracked -| 176|0x000000008b000000, 0x000000008b000000, 0x000000008b100000| 0%| F| |TAMS 0x000000008b000000, 0x000000008b000000| Untracked -| 177|0x000000008b100000, 0x000000008b100000, 0x000000008b200000| 0%| F| |TAMS 0x000000008b100000, 0x000000008b100000| Untracked -| 178|0x000000008b200000, 0x000000008b200000, 0x000000008b300000| 0%| F| |TAMS 0x000000008b200000, 0x000000008b200000| Untracked -| 179|0x000000008b300000, 0x000000008b300000, 0x000000008b400000| 0%| F| |TAMS 0x000000008b300000, 0x000000008b300000| Untracked -| 180|0x000000008b400000, 0x000000008b400000, 0x000000008b500000| 0%| F| |TAMS 0x000000008b400000, 0x000000008b400000| Untracked -| 181|0x000000008b500000, 0x000000008b500000, 0x000000008b600000| 0%| F| |TAMS 0x000000008b500000, 0x000000008b500000| Untracked -| 182|0x000000008b600000, 0x000000008b600000, 0x000000008b700000| 0%| F| |TAMS 0x000000008b600000, 0x000000008b600000| Untracked -| 183|0x000000008b700000, 0x000000008b700000, 0x000000008b800000| 0%| F| |TAMS 0x000000008b700000, 0x000000008b700000| Untracked -| 184|0x000000008b800000, 0x000000008b800000, 0x000000008b900000| 0%| F| |TAMS 0x000000008b800000, 0x000000008b800000| Untracked -| 185|0x000000008b900000, 0x000000008b900000, 0x000000008ba00000| 0%| F| |TAMS 0x000000008b900000, 0x000000008b900000| Untracked -| 186|0x000000008ba00000, 0x000000008ba00000, 0x000000008bb00000| 0%| F| |TAMS 0x000000008ba00000, 0x000000008ba00000| Untracked -| 187|0x000000008bb00000, 0x000000008bb00000, 0x000000008bc00000| 0%| F| |TAMS 0x000000008bb00000, 0x000000008bb00000| Untracked -| 188|0x000000008bc00000, 0x000000008bc00000, 0x000000008bd00000| 0%| F| |TAMS 0x000000008bc00000, 0x000000008bc00000| Untracked -| 189|0x000000008bd00000, 0x000000008bd00000, 0x000000008be00000| 0%| F| |TAMS 0x000000008bd00000, 0x000000008bd00000| Untracked -| 190|0x000000008be00000, 0x000000008be00000, 0x000000008bf00000| 0%| F| |TAMS 0x000000008be00000, 0x000000008be00000| Untracked -| 191|0x000000008bf00000, 0x000000008bf00000, 0x000000008c000000| 0%| F| |TAMS 0x000000008bf00000, 0x000000008bf00000| Untracked -| 192|0x000000008c000000, 0x000000008c000000, 0x000000008c100000| 0%| F| |TAMS 0x000000008c000000, 0x000000008c000000| Untracked -| 193|0x000000008c100000, 0x000000008c100000, 0x000000008c200000| 0%| F| |TAMS 0x000000008c100000, 0x000000008c100000| Untracked -| 194|0x000000008c200000, 0x000000008c200000, 0x000000008c300000| 0%| F| |TAMS 0x000000008c200000, 0x000000008c200000| Untracked -| 195|0x000000008c300000, 0x000000008c300000, 0x000000008c400000| 0%| F| |TAMS 0x000000008c300000, 0x000000008c300000| Untracked -| 196|0x000000008c400000, 0x000000008c400000, 0x000000008c500000| 0%| F| |TAMS 0x000000008c400000, 0x000000008c400000| Untracked -| 197|0x000000008c500000, 0x000000008c500000, 0x000000008c600000| 0%| F| |TAMS 0x000000008c500000, 0x000000008c500000| Untracked -| 198|0x000000008c600000, 0x000000008c600000, 0x000000008c700000| 0%| F| |TAMS 0x000000008c600000, 0x000000008c600000| Untracked -| 199|0x000000008c700000, 0x000000008c700000, 0x000000008c800000| 0%| F| |TAMS 0x000000008c700000, 0x000000008c700000| Untracked -| 200|0x000000008c800000, 0x000000008c800000, 0x000000008c900000| 0%| F| |TAMS 0x000000008c800000, 0x000000008c800000| Untracked -| 201|0x000000008c900000, 0x000000008c900000, 0x000000008ca00000| 0%| F| |TAMS 0x000000008c900000, 0x000000008c900000| Untracked -| 202|0x000000008ca00000, 0x000000008ca00000, 0x000000008cb00000| 0%| F| |TAMS 0x000000008ca00000, 0x000000008ca00000| Untracked -| 203|0x000000008cb00000, 0x000000008cb00000, 0x000000008cc00000| 0%| F| |TAMS 0x000000008cb00000, 0x000000008cb00000| Untracked -| 204|0x000000008cc00000, 0x000000008cc00000, 0x000000008cd00000| 0%| F| |TAMS 0x000000008cc00000, 0x000000008cc00000| Untracked -| 205|0x000000008cd00000, 0x000000008cd00000, 0x000000008ce00000| 0%| F| |TAMS 0x000000008cd00000, 0x000000008cd00000| Untracked -| 206|0x000000008ce00000, 0x000000008ce00000, 0x000000008cf00000| 0%| F| |TAMS 0x000000008ce00000, 0x000000008ce00000| Untracked -| 207|0x000000008cf00000, 0x000000008cf00000, 0x000000008d000000| 0%| F| |TAMS 0x000000008cf00000, 0x000000008cf00000| Untracked -| 208|0x000000008d000000, 0x000000008d000000, 0x000000008d100000| 0%| F| |TAMS 0x000000008d000000, 0x000000008d000000| Untracked -| 209|0x000000008d100000, 0x000000008d100000, 0x000000008d200000| 0%| F| |TAMS 0x000000008d100000, 0x000000008d100000| Untracked -| 210|0x000000008d200000, 0x000000008d200000, 0x000000008d300000| 0%| F| |TAMS 0x000000008d200000, 0x000000008d200000| Untracked -| 211|0x000000008d300000, 0x000000008d300000, 0x000000008d400000| 0%| F| |TAMS 0x000000008d300000, 0x000000008d300000| Untracked -| 212|0x000000008d400000, 0x000000008d400000, 0x000000008d500000| 0%| F| |TAMS 0x000000008d400000, 0x000000008d400000| Untracked -| 213|0x000000008d500000, 0x000000008d500000, 0x000000008d600000| 0%| F| |TAMS 0x000000008d500000, 0x000000008d500000| Untracked -| 214|0x000000008d600000, 0x000000008d600000, 0x000000008d700000| 0%| F| |TAMS 0x000000008d600000, 0x000000008d600000| Untracked -| 215|0x000000008d700000, 0x000000008d700000, 0x000000008d800000| 0%| F| |TAMS 0x000000008d700000, 0x000000008d700000| Untracked -| 216|0x000000008d800000, 0x000000008d800000, 0x000000008d900000| 0%| F| |TAMS 0x000000008d800000, 0x000000008d800000| Untracked -| 217|0x000000008d900000, 0x000000008d900000, 0x000000008da00000| 0%| F| |TAMS 0x000000008d900000, 0x000000008d900000| Untracked -| 218|0x000000008da00000, 0x000000008da00000, 0x000000008db00000| 0%| F| |TAMS 0x000000008da00000, 0x000000008da00000| Untracked -| 219|0x000000008db00000, 0x000000008db00000, 0x000000008dc00000| 0%| F| |TAMS 0x000000008db00000, 0x000000008db00000| Untracked -| 220|0x000000008dc00000, 0x000000008dc00000, 0x000000008dd00000| 0%| F| |TAMS 0x000000008dc00000, 0x000000008dc00000| Untracked -| 221|0x000000008dd00000, 0x000000008dd00000, 0x000000008de00000| 0%| F| |TAMS 0x000000008dd00000, 0x000000008dd00000| Untracked -| 222|0x000000008de00000, 0x000000008de00000, 0x000000008df00000| 0%| F| |TAMS 0x000000008de00000, 0x000000008de00000| Untracked -| 223|0x000000008df00000, 0x000000008df00000, 0x000000008e000000| 0%| F| |TAMS 0x000000008df00000, 0x000000008df00000| Untracked -| 224|0x000000008e000000, 0x000000008e000000, 0x000000008e100000| 0%| F| |TAMS 0x000000008e000000, 0x000000008e000000| Untracked -| 225|0x000000008e100000, 0x000000008e100000, 0x000000008e200000| 0%| F| |TAMS 0x000000008e100000, 0x000000008e100000| Untracked -| 226|0x000000008e200000, 0x000000008e200000, 0x000000008e300000| 0%| F| |TAMS 0x000000008e200000, 0x000000008e200000| Untracked -| 227|0x000000008e300000, 0x000000008e300000, 0x000000008e400000| 0%| F| |TAMS 0x000000008e300000, 0x000000008e300000| Untracked -| 228|0x000000008e400000, 0x000000008e400000, 0x000000008e500000| 0%| F| |TAMS 0x000000008e400000, 0x000000008e400000| Untracked -| 229|0x000000008e500000, 0x000000008e500000, 0x000000008e600000| 0%| F| |TAMS 0x000000008e500000, 0x000000008e500000| Untracked -| 230|0x000000008e600000, 0x000000008e600000, 0x000000008e700000| 0%| F| |TAMS 0x000000008e600000, 0x000000008e600000| Untracked -| 231|0x000000008e700000, 0x000000008e700000, 0x000000008e800000| 0%| F| |TAMS 0x000000008e700000, 0x000000008e700000| Untracked -| 232|0x000000008e800000, 0x000000008e800000, 0x000000008e900000| 0%| F| |TAMS 0x000000008e800000, 0x000000008e800000| Untracked -| 233|0x000000008e900000, 0x000000008e900000, 0x000000008ea00000| 0%| F| |TAMS 0x000000008e900000, 0x000000008e900000| Untracked -| 234|0x000000008ea00000, 0x000000008ea00000, 0x000000008eb00000| 0%| F| |TAMS 0x000000008ea00000, 0x000000008ea00000| Untracked -| 235|0x000000008eb00000, 0x000000008eb00000, 0x000000008ec00000| 0%| F| |TAMS 0x000000008eb00000, 0x000000008eb00000| Untracked -| 236|0x000000008ec00000, 0x000000008ec00000, 0x000000008ed00000| 0%| F| |TAMS 0x000000008ec00000, 0x000000008ec00000| Untracked -| 237|0x000000008ed00000, 0x000000008ed00000, 0x000000008ee00000| 0%| F| |TAMS 0x000000008ed00000, 0x000000008ed00000| Untracked -| 238|0x000000008ee00000, 0x000000008ee00000, 0x000000008ef00000| 0%| F| |TAMS 0x000000008ee00000, 0x000000008ee00000| Untracked -| 239|0x000000008ef00000, 0x000000008ef00000, 0x000000008f000000| 0%| F| |TAMS 0x000000008ef00000, 0x000000008ef00000| Untracked -| 240|0x000000008f000000, 0x000000008f000000, 0x000000008f100000| 0%| F| |TAMS 0x000000008f000000, 0x000000008f000000| Untracked -| 241|0x000000008f100000, 0x000000008f100000, 0x000000008f200000| 0%| F| |TAMS 0x000000008f100000, 0x000000008f100000| Untracked -| 242|0x000000008f200000, 0x000000008f200000, 0x000000008f300000| 0%| F| |TAMS 0x000000008f200000, 0x000000008f200000| Untracked -| 243|0x000000008f300000, 0x000000008f300000, 0x000000008f400000| 0%| F| |TAMS 0x000000008f300000, 0x000000008f300000| Untracked -| 244|0x000000008f400000, 0x000000008f400000, 0x000000008f500000| 0%| F| |TAMS 0x000000008f400000, 0x000000008f400000| Untracked -| 245|0x000000008f500000, 0x000000008f500000, 0x000000008f600000| 0%| F| |TAMS 0x000000008f500000, 0x000000008f500000| Untracked -| 246|0x000000008f600000, 0x000000008f600000, 0x000000008f700000| 0%| F| |TAMS 0x000000008f600000, 0x000000008f600000| Untracked -| 247|0x000000008f700000, 0x000000008f700000, 0x000000008f800000| 0%| F| |TAMS 0x000000008f700000, 0x000000008f700000| Untracked -| 248|0x000000008f800000, 0x000000008f800000, 0x000000008f900000| 0%| F| |TAMS 0x000000008f800000, 0x000000008f800000| Untracked -| 249|0x000000008f900000, 0x000000008f900000, 0x000000008fa00000| 0%| F| |TAMS 0x000000008f900000, 0x000000008f900000| Untracked -| 250|0x000000008fa00000, 0x000000008fa00000, 0x000000008fb00000| 0%| F| |TAMS 0x000000008fa00000, 0x000000008fa00000| Untracked -| 251|0x000000008fb00000, 0x000000008fb00000, 0x000000008fc00000| 0%| F| |TAMS 0x000000008fb00000, 0x000000008fb00000| Untracked -| 252|0x000000008fc00000, 0x000000008fc00000, 0x000000008fd00000| 0%| F| |TAMS 0x000000008fc00000, 0x000000008fc00000| Untracked -| 253|0x000000008fd00000, 0x000000008fd00000, 0x000000008fe00000| 0%| F| |TAMS 0x000000008fd00000, 0x000000008fd00000| Untracked -| 254|0x000000008fe00000, 0x000000008fe00000, 0x000000008ff00000| 0%| F| |TAMS 0x000000008fe00000, 0x000000008fe00000| Untracked -| 255|0x000000008ff00000, 0x000000008ff00000, 0x0000000090000000| 0%| F| |TAMS 0x000000008ff00000, 0x000000008ff00000| Untracked -| 256|0x0000000090000000, 0x0000000090000000, 0x0000000090100000| 0%| F| |TAMS 0x0000000090000000, 0x0000000090000000| Untracked -| 257|0x0000000090100000, 0x0000000090100000, 0x0000000090200000| 0%| F| |TAMS 0x0000000090100000, 0x0000000090100000| Untracked -| 258|0x0000000090200000, 0x0000000090200000, 0x0000000090300000| 0%| F| |TAMS 0x0000000090200000, 0x0000000090200000| Untracked -| 259|0x0000000090300000, 0x0000000090300000, 0x0000000090400000| 0%| F| |TAMS 0x0000000090300000, 0x0000000090300000| Untracked -| 260|0x0000000090400000, 0x0000000090400000, 0x0000000090500000| 0%| F| |TAMS 0x0000000090400000, 0x0000000090400000| Untracked -| 261|0x0000000090500000, 0x0000000090500000, 0x0000000090600000| 0%| F| |TAMS 0x0000000090500000, 0x0000000090500000| Untracked -| 262|0x0000000090600000, 0x0000000090600000, 0x0000000090700000| 0%| F| |TAMS 0x0000000090600000, 0x0000000090600000| Untracked -| 263|0x0000000090700000, 0x0000000090700000, 0x0000000090800000| 0%| F| |TAMS 0x0000000090700000, 0x0000000090700000| Untracked -| 264|0x0000000090800000, 0x0000000090800000, 0x0000000090900000| 0%| F| |TAMS 0x0000000090800000, 0x0000000090800000| Untracked -| 265|0x0000000090900000, 0x0000000090900000, 0x0000000090a00000| 0%| F| |TAMS 0x0000000090900000, 0x0000000090900000| Untracked -| 266|0x0000000090a00000, 0x0000000090a00000, 0x0000000090b00000| 0%| F| |TAMS 0x0000000090a00000, 0x0000000090a00000| Untracked -| 267|0x0000000090b00000, 0x0000000090b00000, 0x0000000090c00000| 0%| F| |TAMS 0x0000000090b00000, 0x0000000090b00000| Untracked -| 268|0x0000000090c00000, 0x0000000090c00000, 0x0000000090d00000| 0%| F| |TAMS 0x0000000090c00000, 0x0000000090c00000| Untracked -| 269|0x0000000090d00000, 0x0000000090d00000, 0x0000000090e00000| 0%| F| |TAMS 0x0000000090d00000, 0x0000000090d00000| Untracked -| 270|0x0000000090e00000, 0x0000000090e00000, 0x0000000090f00000| 0%| F| |TAMS 0x0000000090e00000, 0x0000000090e00000| Untracked -| 271|0x0000000090f00000, 0x0000000090fb8a30, 0x0000000091000000| 72%| S|CS|TAMS 0x0000000090f00000, 0x0000000090f00000| Complete -| 272|0x0000000091000000, 0x0000000091000000, 0x0000000091100000| 0%| F| |TAMS 0x0000000091000000, 0x0000000091000000| Untracked -| 273|0x0000000091100000, 0x0000000091100000, 0x0000000091200000| 0%| F| |TAMS 0x0000000091100000, 0x0000000091100000| Untracked -| 274|0x0000000091200000, 0x0000000091200000, 0x0000000091300000| 0%| F| |TAMS 0x0000000091200000, 0x0000000091200000| Untracked -| 275|0x0000000091300000, 0x0000000091300000, 0x0000000091400000| 0%| F| |TAMS 0x0000000091300000, 0x0000000091300000| Untracked -| 276|0x0000000091400000, 0x0000000091400000, 0x0000000091500000| 0%| F| |TAMS 0x0000000091400000, 0x0000000091400000| Untracked -| 277|0x0000000091500000, 0x0000000091500000, 0x0000000091600000| 0%| F| |TAMS 0x0000000091500000, 0x0000000091500000| Untracked - -Card table byte_map: [0x000002252a680000,0x000002252aa80000] _byte_map_base: 0x000002252a280000 - -Marking Bits (Prev, Next): (CMBitMap*) 0x0000022517b9ab60, (CMBitMap*) 0x0000022517b9ab28 - Prev Bits: [0x000002252ce80000, 0x000002252ee80000) - Next Bits: [0x000002252ae80000, 0x000002252ce80000) - -Polling page: 0x0000022515b10000 - -Metaspace: - -Usage: - Non-class: 80.88 MB capacity, 79.13 MB ( 98%) used, 1.46 MB ( 2%) free+waste, 302.69 KB ( <1%) overhead. - Class: 13.36 MB capacity, 12.30 MB ( 92%) used, 941.90 KB ( 7%) free+waste, 145.25 KB ( 1%) overhead. - Both: 94.24 MB capacity, 91.42 MB ( 97%) used, 2.38 MB ( 3%) free+waste, 447.94 KB ( <1%) overhead. - -Virtual space: - Non-class space: 90.00 MB reserved, 80.92 MB ( 90%) committed - Class space: 1.00 GB reserved, 13.38 MB ( 1%) committed - Both: 1.09 GB reserved, 94.30 MB ( 8%) committed - -Chunk freelists: - Non-Class: 42.00 KB - Class: 18.00 KB - Both: 60.00 KB - -MaxMetaspaceSize: 17179869184.00 GB -CompressedClassSpaceSize: 1.00 GB -Initial GC threshold: 20.80 MB -Current GC threshold: 146.24 MB -CDS: off - -CodeHeap 'non-profiled nmethods': size=120064Kb used=5951Kb max_used=5951Kb free=114112Kb - bounds [0x0000022523140000, 0x0000022523710000, 0x000002252a680000] -CodeHeap 'profiled nmethods': size=120000Kb used=21698Kb max_used=21698Kb free=98301Kb - bounds [0x000002251bc10000, 0x000002251d150000, 0x0000022523140000] -CodeHeap 'non-nmethods': size=5696Kb used=2390Kb max_used=2412Kb free=3305Kb - bounds [0x000002251b680000, 0x000002251b8f0000, 0x000002251bc10000] - total_blobs=10637 nmethods=9720 adapters=829 - compilation: enabled - stopped_count=0, restarted_count=0 - full_count=0 - -Compilation events (20 events): -Event: 79.992 Thread 0x0000022531a68800 nmethod 9783 0x000002251d13ca10 code [0x000002251d13cda0, 0x000002251d13ee58] -Event: 80.099 Thread 0x0000022531a66800 nmethod 9770 0x0000022523707d10 code [0x0000022523707f60, 0x000002252370a340] -Event: 80.100 Thread 0x0000022531a66800 9771 4 java.lang.StringUTF16::compress (50 bytes) -Event: 80.106 Thread 0x0000022531a66800 nmethod 9771 0x000002252370b210 code [0x000002252370b3a0, 0x000002252370b698] -Event: 80.107 Thread 0x0000022531a66800 9776 % 4 sun.nio.cs.UTF_8$Decoder::decodeArrayLoop @ 106 (691 bytes) -Event: 80.149 Thread 0x0000022531a68800 9784 2 sun.net.util.URLUtil::urlNoFragString (114 bytes) -Event: 80.150 Thread 0x0000022531a66800 nmethod 9776% 0x000002252370b790 code [0x000002252370b9e0, 0x000002252370c7b8] -Event: 80.151 Thread 0x0000022531a66800 9774 4 java.lang.String::startsWith (138 bytes) -Event: 80.151 Thread 0x0000022531a68800 nmethod 9784 0x000002251d13f890 code [0x000002251d13fb00, 0x000002251d140058] -Event: 80.151 Thread 0x0000022531a68800 9785 2 java.net.URL::getDefaultPort (8 bytes) -Event: 80.152 Thread 0x0000022531a68800 nmethod 9785 0x000002251d140390 code [0x000002251d140540, 0x000002251d140668] -Event: 80.157 Thread 0x0000022531a66800 nmethod 9774 0x000002252370d590 code [0x000002252370d720, 0x000002252370d918] -Event: 80.158 Thread 0x0000022531a66800 9773 4 java.lang.String::startsWith (7 bytes) -Event: 80.164 Thread 0x0000022531a66800 nmethod 9773 0x000002252370da90 code [0x000002252370dc20, 0x000002252370ddf8] -Event: 80.191 Thread 0x0000022531a66800 9786 4 java.lang.ClassLoader::preDefineClass (116 bytes) -Event: 80.241 Thread 0x0000022531a66800 nmethod 9786 0x000002252370df90 code [0x000002252370e1a0, 0x000002252370efc8] -Event: 80.242 Thread 0x0000022531a66800 9787 4 java.lang.String::hashCode (49 bytes) -Event: 80.250 Thread 0x0000022531a66800 nmethod 9787 0x000002252370f890 code [0x000002252370fa20, 0x000002252370fc78] -Event: 80.281 Thread 0x0000022531a68800 9788 3 org.slf4j.impl.StaticLoggerBinder::getSingleton (4 bytes) -Event: 80.281 Thread 0x0000022531a68800 nmethod 9788 0x000002251d140710 code [0x000002251d1408c0, 0x000002251d1409b8] - -GC Heap History (20 events): -Event: 40.469 GC heap before -{Heap before GC invocations=56 (full 0): - garbage-first heap total 176128K, used 133402K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 55 young (56320K), 4 survivors (4096K) - Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K - class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K -} -Event: 40.493 GC heap after -{Heap after GC invocations=57 (full 0): - garbage-first heap total 176128K, used 85256K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 56357K, capacity 58190K, committed 58416K, reserved 1099776K - class space used 7136K, capacity 7764K, committed 7808K, reserved 1048576K -} -Event: 43.393 GC heap before -{Heap before GC invocations=57 (full 0): - garbage-first heap total 176128K, used 142600K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 63 young (64512K), 7 survivors (7168K) - Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K - class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K -} -Event: 43.441 GC heap after -{Heap after GC invocations=58 (full 0): - garbage-first heap total 176128K, used 87003K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 6 young (6144K), 6 survivors (6144K) - Metaspace used 61762K, capacity 63845K, committed 64048K, reserved 1103872K - class space used 7975K, capacity 8751K, committed 8832K, reserved 1048576K -} -Event: 45.839 GC heap before -{Heap before GC invocations=58 (full 0): - garbage-first heap total 176128K, used 144347K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 63 young (64512K), 6 survivors (6144K) - Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K - class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K -} -Event: 45.877 GC heap after -{Heap after GC invocations=59 (full 0): - garbage-first heap total 176128K, used 89690K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 5 young (5120K), 5 survivors (5120K) - Metaspace used 64728K, capacity 67011K, committed 67120K, reserved 1107968K - class space used 8426K, capacity 9269K, committed 9344K, reserved 1048576K -} -Event: 48.274 GC heap before -{Heap before GC invocations=60 (full 0): - garbage-first heap total 176128K, used 153178K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 61 young (62464K), 5 survivors (5120K) - Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K - class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K -} -Event: 48.337 GC heap after -{Heap after GC invocations=61 (full 0): - garbage-first heap total 211968K, used 99725K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 69343K, capacity 71735K, committed 71856K, reserved 1112064K - class space used 9018K, capacity 9923K, committed 9984K, reserved 1048576K -} -Event: 52.007 GC heap before -{Heap before GC invocations=61 (full 0): - garbage-first heap total 211968K, used 167309K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 73 young (74752K), 7 survivors (7168K) - Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K - class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K -} -Event: 52.081 GC heap after -{Heap after GC invocations=62 (full 0): - garbage-first heap total 211968K, used 102211K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 6 young (6144K), 6 survivors (6144K) - Metaspace used 74110K, capacity 76496K, committed 76848K, reserved 1116160K - class space used 9633K, capacity 10505K, committed 10624K, reserved 1048576K -} -Event: 63.878 GC heap before -{Heap before GC invocations=62 (full 0): - garbage-first heap total 211968K, used 175939K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 79 young (80896K), 6 survivors (6144K) - Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K - class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K -} -Event: 64.071 GC heap after -{Heap after GC invocations=63 (full 0): - garbage-first heap total 211968K, used 106847K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 79404K, capacity 82155K, committed 82352K, reserved 1120256K - class space used 10413K, capacity 11444K, committed 11520K, reserved 1048576K -} -Event: 72.632 GC heap before -{Heap before GC invocations=64 (full 0): - garbage-first heap total 211968K, used 177503K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 76 young (77824K), 7 survivors (7168K) - Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K - class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K -} -Event: 72.787 GC heap after -{Heap after GC invocations=65 (full 0): - garbage-first heap total 211968K, used 109366K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 85617K, capacity 88394K, committed 88752K, reserved 1126400K - class space used 11662K, capacity 12675K, committed 12800K, reserved 1048576K -} -Event: 73.860 GC heap before -{Heap before GC invocations=65 (full 0): - garbage-first heap total 211968K, used 119606K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 18 young (18432K), 7 survivors (7168K) - Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K - class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K -} -Event: 73.917 GC heap after -{Heap after GC invocations=66 (full 0): - garbage-first heap total 284672K, used 110080K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 4 young (4096K), 4 survivors (4096K) - Metaspace used 86595K, capacity 89345K, committed 89648K, reserved 1126400K - class space used 11789K, capacity 12818K, committed 12928K, reserved 1048576K -} -Event: 80.027 GC heap before -{Heap before GC invocations=67 (full 0): - garbage-first heap total 284672K, used 179712K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 55 young (56320K), 4 survivors (4096K) - Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K - class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K -} -Event: 80.095 GC heap after -{Heap after GC invocations=68 (full 0): - garbage-first heap total 284672K, used 136936K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 7 young (7168K), 7 survivors (7168K) - Metaspace used 93156K, capacity 96052K, committed 96304K, reserved 1132544K - class space used 12520K, capacity 13614K, committed 13696K, reserved 1048576K -} -Event: 80.287 GC heap before -{Heap before GC invocations=68 (full 0): - garbage-first heap total 284672K, used 142056K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 13 young (13312K), 7 survivors (7168K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -} -Event: 80.394 GC heap after -{Heap after GC invocations=69 (full 0): - garbage-first heap total 284672K, used 137954K [0x0000000080000000, 0x0000000100000000) - region size 1024K, 1 young (1024K), 1 survivors (1024K) - Metaspace used 93615K, capacity 96500K, committed 96560K, reserved 1138688K - class space used 12590K, capacity 13678K, committed 13696K, reserved 1048576K -} - -Deoptimization events (20 events): -Event: 79.976 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.976 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.977 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.977 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT PACKING pc=0x000002251d12319b sp=0x0000008c56ffc8d0 -Event: 79.978 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca95e sp=0x0000008c56ffbd40 mode 0 -Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x0000022523146710 relative=0x0000000000000170 -Event: 79.981 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x0000022523146710 method=java.lang.String.isLatin1()Z @ 10 c2 -Event: 79.981 Thread 0x00000225324c0800 DEOPT PACKING pc=0x0000022523146710 sp=0x0000008c56ffca00 -Event: 79.981 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc928 mode 2 -Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225236c90cc relative=0x00000000000013cc -Event: 79.984 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225236c90cc method=java.util.concurrent.ConcurrentHashMap.putVal(Ljava/lang/Object;Ljava/lang/Object;Z)Ljava/lang/Object; @ 401 c2 -Event: 79.984 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225236c90cc sp=0x0000008c56ffca30 -Event: 79.984 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc9c0 mode 2 -Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: trap_request=0xffffff4d fr.pc=0x00000225232060cc relative=0x000000000000124c -Event: 79.993 Thread 0x00000225324c0800 Uncommon trap: reason=unstable_if action=reinterpret pc=0x00000225232060cc method=java.util.concurrent.ConcurrentHashMap.transfer([Ljava/util/concurrent/ConcurrentHashMap$Node;[Ljava/util/concurrent/ConcurrentHashMap$Node;)V @ 352 c2 -Event: 79.993 Thread 0x00000225324c0800 DEOPT PACKING pc=0x00000225232060cc sp=0x0000008c56ffc810 -Event: 79.993 Thread 0x00000225324c0800 DEOPT UNPACKING pc=0x000002251b6ca1af sp=0x0000008c56ffc788 mode 2 - -Classes redefined (0 events): -No events - -Internal exceptions (20 events): -Event: 77.831 Thread 0x000002253253b800 Exception (0x000000008ff476c8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.835 Thread 0x000002253253b800 Exception (0x000000008ff6ac98) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.836 Thread 0x000002253253b800 Exception (0x000000008ff83d68) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.837 Thread 0x000002253253b800 Exception (0x000000008ff9bd00) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.839 Thread 0x000002253253b800 Exception (0x000000008ffb3428) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.841 Thread 0x000002253253b800 Exception (0x000000008ffcb900) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.842 Thread 0x000002253253b800 Exception (0x000000008ffe3350) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.844 Thread 0x000002253253b800 Exception (0x000000008ffedb28) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.845 Thread 0x000002253253b800 Exception (0x000000008fff83a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.848 Thread 0x000002253253b800 Exception (0x000000008fe19198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.851 Thread 0x000002253253b800 Exception (0x000000008fe4e380) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.856 Thread 0x000002253253b800 Exception (0x000000008fe8b638) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.860 Thread 0x000002253253b800 Exception (0x000000008feb77a0) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.863 Thread 0x000002253253b800 Exception (0x000000008fee37a8) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.866 Thread 0x000002253253b800 Exception (0x000000008fd12198) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.871 Thread 0x000002253253b800 Exception (0x000000008fd44978) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.901 Thread 0x000002253253b800 Exception (0x000000008fdf3650) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 77.903 Thread 0x000002253253b800 Exception (0x000000008fc06b90) thrown at [./src/hotspot/share/classfile/systemDictionary.cpp, line 231] -Event: 78.412 Thread 0x00000225324c0800 Implicit null exception at 0x00000225234c7165 to 0x00000225234c79dc -Event: 78.846 Thread 0x00000225324c0800 Exception (0x000000008f2f9b78) thrown at [./src/hotspot/share/prims/jni.cpp, line 616] - -Events (20 events): -Event: 80.272 loading class org/apache/http/impl/execchain/RedirectExec done -Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore -Event: 80.274 loading class org/apache/http/impl/client/BasicCookieStore done -Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator -Event: 80.275 loading class org/apache/http/cookie/CookieIdentityComparator done -Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 -Event: 80.276 loading class org/apache/http/impl/client/HttpClientBuilder$2 done -Event: 80.277 loading class org/apache/http/client/ClientProtocolException -Event: 80.277 loading class org/apache/http/client/ClientProtocolException done -Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager -Event: 80.280 loading class org/apache/http/conn/ClientConnectionManager done -Event: 80.281 loading class org/apache/http/client/utils/URIUtils -Event: 80.281 loading class org/apache/http/client/utils/URIUtils done -Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag -Event: 80.283 loading class org/apache/http/client/utils/URIUtils$UriFlag done -Event: 80.285 loading class org/apache/http/HttpHost -Event: 80.285 loading class org/apache/http/HttpHost done -Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper -Event: 80.287 loading class org/apache/http/client/methods/HttpRequestWrapper done -Event: 80.287 Executing VM operation: CollectForMetadataAllocation - - -Dynamic libraries: -0x00007ff668680000 - 0x00007ff66868a000 C:\Program Files\Android\Android Studio1\jre\bin\java.exe -0x00007ffb8e7d0000 - 0x00007ffb8e9c8000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffb8e630000 - 0x00007ffb8e6ef000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffb8bfb0000 - 0x00007ffb8c2a6000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffb8c2b0000 - 0x00007ffb8c3b0000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffb5be60000 - 0x00007ffb5be79000 C:\Program Files\Android\Android Studio1\jre\bin\jli.dll -0x00007ffb5be40000 - 0x00007ffb5be57000 C:\Program Files\Android\Android Studio1\jre\bin\VCRUNTIME140.dll -0x00007ffb8d450000 - 0x00007ffb8d5ed000 C:\WINDOWS\System32\USER32.dll -0x00007ffb8c540000 - 0x00007ffb8c562000 C:\WINDOWS\System32\win32u.dll -0x00007ffb8db60000 - 0x00007ffb8db8c000 C:\WINDOWS\System32\GDI32.dll -0x00007ffb8c710000 - 0x00007ffb8c825000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffb8c670000 - 0x00007ffb8c70d000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffb7c7e0000 - 0x00007ffb7ca7a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll -0x00007ffb8dac0000 - 0x00007ffb8db5e000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffb8ccd0000 - 0x00007ffb8cd00000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffb3f2a0000 - 0x00007ffb3f33d000 C:\Program Files\Android\Android Studio1\jre\bin\msvcp140.dll -0x00007ffb23b50000 - 0x00007ffb24652000 C:\Program Files\Android\Android Studio1\jre\bin\server\jvm.dll -0x00007ffb8ca80000 - 0x00007ffb8cb2f000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffb8e6f0000 - 0x00007ffb8e78c000 C:\WINDOWS\System32\sechost.dll -0x00007ffb8c830000 - 0x00007ffb8c956000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffb8ca70000 - 0x00007ffb8ca78000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ffb85130000 - 0x00007ffb85139000 C:\WINDOWS\SYSTEM32\WSOCK32.dll -0x00007ffb8df00000 - 0x00007ffb8df6b000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffb816a0000 - 0x00007ffb816aa000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffb816b0000 - 0x00007ffb816d7000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffb8a6f0000 - 0x00007ffb8a702000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffb84710000 - 0x00007ffb84721000 C:\Program Files\Android\Android Studio1\jre\bin\verify.dll -0x00007ffb8a4e0000 - 0x00007ffb8a6c4000 C:\WINDOWS\SYSTEM32\DBGHELP.DLL -0x00007ffb76690000 - 0x00007ffb766c4000 C:\WINDOWS\SYSTEM32\dbgcore.DLL -0x00007ffb8c5e0000 - 0x00007ffb8c662000 C:\WINDOWS\System32\bcryptPrimitives.dll -0x00007ffb7c210000 - 0x00007ffb7c239000 C:\Program Files\Android\Android Studio1\jre\bin\java.dll -0x00007ffb84330000 - 0x00007ffb8433b000 C:\Program Files\Android\Android Studio1\jre\bin\jimage.dll -0x00007ffb72a00000 - 0x00007ffb72a18000 C:\Program Files\Android\Android Studio1\jre\bin\zip.dll -0x00007ffb8cd00000 - 0x00007ffb8d444000 C:\WINDOWS\System32\SHELL32.dll -0x00007ffb89c00000 - 0x00007ffb8a393000 C:\WINDOWS\SYSTEM32\windows.storage.dll -0x00007ffb8e120000 - 0x00007ffb8e474000 C:\WINDOWS\System32\combase.dll -0x00007ffb8b890000 - 0x00007ffb8b8be000 C:\WINDOWS\SYSTEM32\Wldp.dll -0x00007ffb8c960000 - 0x00007ffb8ca0d000 C:\WINDOWS\System32\SHCORE.dll -0x00007ffb8cb30000 - 0x00007ffb8cb85000 C:\WINDOWS\System32\shlwapi.dll -0x00007ffb8bdf0000 - 0x00007ffb8be0f000 C:\WINDOWS\SYSTEM32\profapi.dll -0x00007ffb729e0000 - 0x00007ffb729fa000 C:\Program Files\Android\Android Studio1\jre\bin\net.dll -0x00007ffb7d4d0000 - 0x00007ffb7d5da000 C:\WINDOWS\SYSTEM32\WINHTTP.dll -0x00007ffb8b580000 - 0x00007ffb8b5ea000 C:\WINDOWS\system32\mswsock.dll -0x00007ffb729c0000 - 0x00007ffb729d4000 C:\Program Files\Android\Android Studio1\jre\bin\nio.dll -0x00007ffb64870000 - 0x00007ffb64897000 C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64\native-platform.dll -0x00007ffb3f150000 - 0x00007ffb3f294000 C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64\native-platform-file-events.dll -0x00007ffb7f180000 - 0x00007ffb7f18a000 C:\Program Files\Android\Android Studio1\jre\bin\management.dll -0x00007ffb7c200000 - 0x00007ffb7c20d000 C:\Program Files\Android\Android Studio1\jre\bin\management_ext.dll -0x00007ffb8b780000 - 0x00007ffb8b798000 C:\WINDOWS\SYSTEM32\CRYPTSP.dll -0x00007ffb8aea0000 - 0x00007ffb8aed4000 C:\WINDOWS\system32\rsaenh.dll -0x00007ffb8c510000 - 0x00007ffb8c537000 C:\WINDOWS\System32\bcrypt.dll -0x00007ffb8bd70000 - 0x00007ffb8bd9e000 C:\WINDOWS\SYSTEM32\USERENV.dll -0x00007ffb8b770000 - 0x00007ffb8b77c000 C:\WINDOWS\SYSTEM32\CRYPTBASE.dll -0x00007ffb8b270000 - 0x00007ffb8b2ac000 C:\WINDOWS\SYSTEM32\IPHLPAPI.DLL -0x00007ffb8e5a0000 - 0x00007ffb8e5a8000 C:\WINDOWS\System32\NSI.dll -0x00007ffb7dfb0000 - 0x00007ffb7dfc7000 C:\WINDOWS\SYSTEM32\dhcpcsvc6.DLL -0x00007ffb7e4f0000 - 0x00007ffb7e50d000 C:\WINDOWS\SYSTEM32\dhcpcsvc.DLL -0x00007ffb8b2b0000 - 0x00007ffb8b37a000 C:\WINDOWS\SYSTEM32\DNSAPI.dll -0x00007ffb72570000 - 0x00007ffb72587000 C:\WINDOWS\system32\napinsp.dll -0x00007ffb72550000 - 0x00007ffb7256b000 C:\WINDOWS\system32\pnrpnsp.dll -0x00007ffb863a0000 - 0x00007ffb863b5000 C:\WINDOWS\system32\wshbth.dll -0x00007ffb874f0000 - 0x00007ffb8750d000 C:\WINDOWS\system32\NLAapi.dll -0x00007ffb72530000 - 0x00007ffb72542000 C:\WINDOWS\System32\winrnr.dll -0x00007ffb828b0000 - 0x00007ffb828ba000 C:\Windows\System32\rasadhlp.dll -0x00007ffb7b200000 - 0x00007ffb7b282000 C:\WINDOWS\System32\fwpuclnt.dll -0x00007ffb7f1a0000 - 0x00007ffb7f1c7000 C:\Program Files\Android\Android Studio1\jre\bin\sunec.dll - -dbghelp: loaded successfully - version: 4.0.5 - missing functions: none -symbol engine: initialized successfully - sym options: 0x614 - pdb path: .;C:\Program Files\Android\Android Studio1\jre\bin;C:\WINDOWS\SYSTEM32;C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e;C:\Program Files\Android\Android Studio1\jre\bin\server;C:\Users\USER\.gradle\native\68d5fa5c4cc2d200863cafc0d521ce42e7d3e7ee720ec0a83991735586a16f82\windows-amd64;C:\Users\USER\.gradle\native\e376f236ea51e6404a007f0833ffe2c6e607c4080706a723a18a27aeea778392\windows-amd64 - -VM Arguments: -jvm_args: --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.prefs/java.util.prefs=ALL-UNNAMED --add-opens=java.base/java.nio.charset=ALL-UNNAMED --add-opens=java.base/java.net=ALL-UNNAMED --add-opens=java.base/java.util.concurrent.atomic=ALL-UNNAMED -Xmx2048M -Dfile.encoding=UTF-8 -Duser.country=RU -Duser.language=ru -Duser.variant -java_command: org.gradle.launcher.daemon.bootstrap.GradleDaemon 8.0.2 -java_class_path (initial): C:\Users\USER\.gradle\wrapper\dists\gradle-8.0.2-bin\25jlreiuz6u3xu2phlpa2vv4m\gradle-8.0.2\lib\gradle-launcher-8.0.2.jar -Launcher Type: SUN_STANDARD - -[Global flags] - intx CICompilerCount = 2 {product} {ergonomic} - uint ConcGCThreads = 1 {product} {ergonomic} - uint G1ConcRefinementThreads = 2 {product} {ergonomic} - size_t G1HeapRegionSize = 1048576 {product} {ergonomic} - uintx GCDrainStackTargetSize = 64 {product} {ergonomic} - size_t InitialHeapSize = 58720256 {product} {ergonomic} - size_t MarkStackSize = 4194304 {product} {ergonomic} - size_t MaxHeapSize = 2147483648 {product} {command line} - size_t MaxNewSize = 1287651328 {product} {ergonomic} - size_t MinHeapDeltaBytes = 1048576 {product} {ergonomic} - uintx NonNMethodCodeHeapSize = 5825164 {pd product} {ergonomic} - uintx NonProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} - uintx ProfiledCodeHeapSize = 122916538 {pd product} {ergonomic} - uintx ReservedCodeCacheSize = 251658240 {pd product} {ergonomic} - bool SegmentedCodeCache = true {product} {ergonomic} - bool UseCompressedClassPointers = true {lp64_product} {ergonomic} - bool UseCompressedOops = true {lp64_product} {ergonomic} - bool UseG1GC = true {product} {ergonomic} - bool UseLargePagesIndividualAllocation = false {pd product} {ergonomic} - -Logging: -Log output configuration: - #0: stdout all=warning uptime,level,tags - #1: stderr all=off uptime,level,tags - -Environment Variables: -PATH=C:\Program Files\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files\dotnet\;C:\Program Files\Git\cmd;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;C:\Users\USER\AppData\Local\Microsoft\WindowsApps;C:\Program Files\JetBrains\IntelliJ IDEA Community Edition 2020.3\bin;;C:\Users\USER\Programming\Maven\apache-maven-3.6.3\bin;C:\Users\USER\.dotnet\tools;C:\Users\USER\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\USER\Programming\effective_android\flutter\bin; -USERNAME=USER -OS=Windows_NT -PROCESSOR_IDENTIFIER=AMD64 Family 21 Model 112 Stepping 0, AuthenticAMD - - - ---------------- S Y S T E M --------------- - -OS: Windows 10 , 64 bit Build 19041 (10.0.19041.3031) -OS uptime: 6 days 20:35 hours - -CPU:total 2 (initial active 2) (2 cores per cpu, 1 threads per core) family 21 model 112 stepping 0 microcode 0x0, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv, bmi1, bmi2, fma - -Memory: 4k page, system-wide physical 3471M (45M free) -TotalPageFile size 14223M (AvailPageFile size 4M) -current process WorkingSet (physical memory assigned to process): 250M, peak: 323M -current process commit charge ("private bytes"): 537M, peak: 538M - -vm_info: OpenJDK 64-Bit Server VM (11.0.13+0-b1751.21-8125866) for windows-amd64 JRE (11.0.13+0-b1751.21-8125866), built on Feb 2 2022 03:00:22 by "builder" with MS VC++ 14.0 (VS2015) - -END. -- GitLab From 87bae40987e0a1ea98b98577762787012d75e49a Mon Sep 17 00:00:00 2001 From: Margarita Date: Fri, 7 Jul 2023 13:37:55 +0600 Subject: [PATCH 42/63] [+] libres, modal window layout without close logic and successstate --- .../features/selectRoom/build.gradle.kts | 17 +++ .../ui/selectRoomScreen/SelectRoomScreen.kt | 102 +++++++++++++++++- .../uiComponents/BookingButtonView.kt | 45 ++++++++ .../uiComponents/DateTimeView.kt | 69 ++++++++++++ .../uiComponents/LengthEventView.kt | 48 +++++++++ .../uiComponents/OrganizerEventView.kt | 34 ++++++ .../uiComponents/TitleFieldView.kt | 29 +++++ .../commonMain/libres/strings/strings_ru.xml | 9 ++ .../src/main/res/drawable/cross.xml | 4 + 9 files changed, 356 insertions(+), 1 deletion(-) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml create mode 100644 tabletApp/features/selectRoom/src/main/res/drawable/cross.xml diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index 1815ff28..3f2d3d1c 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -3,10 +3,15 @@ plugins { id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) id(Plugins.Parcelize.plugin) + id(Plugins.Libres.plugin) } android { compileSdk = 33 + sourceSets["main"].apply { + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } } kotlin { @@ -32,6 +37,9 @@ kotlin { //Koin api(Dependencies.Koin.core) + + //Libres + implementation(Dependencies.Libres.libresCompose) } } @@ -43,4 +51,13 @@ kotlin { } } + libres { + // https://github.com/Skeptick/libres#setup + generatedClassName = "MainRes" // "Res" by default + generateNamedArguments = true // false by default + baseLocaleLanguageCode = "ru" // "en" by default + camelCaseNamesForAppleFramework = true // false by default + + } + } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index 2daab3df..3e3e811b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,9 +1,37 @@ package tablet.ui.selectRoomScreen +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties +import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun SelectRoomScreen(component: RealSelectRoomComponent){ @@ -31,5 +59,77 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ fun SelectRoomView( component: RealSelectRoomComponent ){ - Text(text = component.booking.nameRoom) + val modifier = Modifier.background(Color(0xFF3A3736)) + val shape = RoundedCornerShape(16) + + + Dialog( + onDismissRequest = {} + ) + { + Box( + modifier = Modifier + .size(575.dp, 510.dp) + .clip(RoundedCornerShape(5)) + .background(Color(0xFF302D2C)), + contentAlignment = Alignment.Center + ) { + Column{ + Text( + modifier = Modifier.width(415.dp), + text = "Занять ${component.booking.nameRoom}?", + fontSize = 28.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center + ) + Spacer(modifier = Modifier.height(24.dp)) + TitleFieldView( + modifier = Modifier.width(415.dp), + title = "когда" + ) + Spacer(modifier = Modifier.height(16.dp)) + DateTimeView( + modifier = modifier.height(64.dp).width(415.dp), + shape = shape, + booking = component.booking + ) + Spacer(modifier = Modifier.height(24.dp)) + Row { + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(156.dp), + title = "на сколько" + ) + LengthEventView( + modifier = modifier.height(64.dp).width(156.dp), + shape = shape, + booking = component.booking + ) + } + Spacer(modifier = Modifier.width(16.dp)) + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(243.dp), + title = "организатор" + ) + OrganizerEventView( + modifier = modifier.height(64.dp).width(243.dp), + shape = shape, + booking = component.booking + ) + } + } + Spacer(modifier = Modifier.height(40.dp)) + BookingButtonView( + modifier = Modifier.height(64.dp).width(415.dp), + color = Color(0xFFEF7234), + shape = RoundedCornerShape(40), + booking = component.booking + ) + } + } + } + } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt new file mode 100644 index 00000000..31a2344e --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -0,0 +1,45 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking + +@Composable +fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { + val isPressed = remember { mutableStateOf(false) } + val colorButton = if(isPressed.value) Color(0xFFED6521) else color + + Button( + modifier = modifier, + colors = ButtonDefaults.buttonColors(colorButton), + shape = shape, + onClick = { isPressed.value = !isPressed.value} + ) { + Box(contentAlignment = Alignment.Center) + { + Text( + text = "Занять с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + fontSize = 20.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt new file mode 100644 index 00000000..fd2a29a3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -0,0 +1,69 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.background +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.LineHeightStyle +import androidx.compose.ui.unit.TextUnit +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Locale + +@Composable +fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736) + ) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center + ) { + Row { + Text( + text = booking.eventInfo.startTime.date(), + fontSize = 20.sp, + fontWeight = FontWeight(700), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFA362F8) + ) + + Spacer(modifier = Modifier.width(5.dp)) + + Text( + text = "с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + fontSize = 20.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } + + } +} + +private fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + + SimpleDateFormat("MMMM", Locale("ru")).format(this.time) + +fun Calendar.time24() = SimpleDateFormat( + "HH:mm", + Locale("ru") +).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt new file mode 100644 index 00000000..589b774f --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -0,0 +1,48 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking +import java.util.Calendar + +@Composable +fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + + val hours = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) / 60 + val minutes = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) % 60 + val lengthEvent: String = when(hours){ + 0 -> "$minutes мин" + else -> "${hours}ч ${minutes}мин" + } + + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736) + ) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center + ) { + Text( + text = lengthEvent, + fontSize = 20.sp, + fontWeight = FontWeight(700), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} + +private fun getLengthEvent(start: Calendar, finish: Calendar) = + finish.get(Calendar.MINUTE) - start.get(Calendar.MINUTE) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt new file mode 100644 index 00000000..4a317e25 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -0,0 +1,34 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp +import tablet.domain.model.Booking + +@Composable +fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { + Card( + shape = shape, + backgroundColor = Color(0xFF3A3736)) { + Box( + modifier = modifier, + contentAlignment = Alignment.Center) { + Text( + text = booking.eventInfo.organizer, + fontWeight = FontWeight(700), + fontSize = 20.sp, + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt new file mode 100644 index 00000000..af465560 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun TitleFieldView(modifier: Modifier, title: String) { + Box( + modifier = modifier.padding(0.dp), + contentAlignment = Alignment.CenterStart + ) { + Text( + text = title, + fontSize = 16.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFF808080) + ) + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml new file mode 100644 index 00000000..a5e70883 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml @@ -0,0 +1,9 @@ + + + Занять c ${startTime} до ${finishTime} + с ${startTime} до ${finishTime} + Занять ${nameRoom}? + когда + на сколько + организатор + \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml new file mode 100644 index 00000000..336fd8bb --- /dev/null +++ b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml @@ -0,0 +1,4 @@ + + + -- GitLab From ef98b24d9c82781f014aa58cd665b3f12a89bc40 Mon Sep 17 00:00:00 2001 From: Margarita Date: Mon, 10 Jul 2023 05:42:42 +0600 Subject: [PATCH 43/63] [+] closing modal, mocks, length calculation bug fixed --- .../kotlin/tablet/domain/MockBooking.kt | 49 +++++++ .../RealSelectRoomComponent.kt | 8 +- .../selectRoomScreen/SelectRoomComponent.kt | 2 - .../ui/selectRoomScreen/SelectRoomScreen.kt | 111 +------------- .../ui/selectRoomScreen/SelectRoomView.kt | 135 ++++++++++++++++++ .../uiComponents/BookingButtonView.kt | 16 ++- .../uiComponents/CrossButtonView.kt | 39 +++++ .../uiComponents/DateTimeView.kt | 25 +--- .../uiComponents/LengthEventView.kt | 11 +- .../uiComponents/OrganizerEventView.kt | 4 +- .../uiComponents/TitleModal.kt | 29 ++++ .../tablet/utils/ConvertCalendarToTime.kt | 10 ++ .../src/commonMain/libres/images/cross.svg | 3 + .../commonMain/libres/strings/strings_ru.xml | 2 + .../src/main/res/drawable/cross.xml | 4 - .../office/tablet/ui/root/RootComponent.kt | 14 +- 16 files changed, 299 insertions(+), 163 deletions(-) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg delete mode 100644 tabletApp/features/selectRoom/src/main/res/drawable/cross.xml diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt new file mode 100644 index 00000000..6ad5aff4 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt @@ -0,0 +1,49 @@ +package tablet.domain + +import tablet.domain.model.Booking +import tablet.domain.model.EventInfo +import java.util.Calendar + +object MockBooking { + val bookingCheckTime15min = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 4, 20, 15, 20), + finishTime = setTime(2023, 4, 20, 15, 35), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckTime1h = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 11, 11, 15, 20), + finishTime = setTime(2023, 11, 11, 16, 20), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckTime1h15min = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 11, 11, 15, 20), + finishTime = setTime(2023, 11, 11, 16, 35), + organizer = "Ольга Белозёрова" + ) + ) + + val bookingCheckOrganizer = Booking( + nameRoom = "Sirius", + eventInfo = EventInfo( + startTime = setTime(2023, 1, 7, 9, 20), + finishTime = setTime(2023, 1, 7, 11, 35), + organizer = "Абдурахмангаджи Константинопольский" + ) + ) + + private fun setTime(y: Int, m: Int, d: Int, h: Int, min: Int): Calendar { + val currentTime = Calendar.getInstance() + currentTime.set(y, m, d, h, min) + return currentTime + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt index 1de4be7e..12451cc4 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -9,21 +9,15 @@ import tablet.domain.ISelectRoomInteractor import tablet.domain.model.Booking class RealSelectRoomComponent(componentContext: ComponentContext, - booking: Booking) + val booking: Booking) : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ private val interactor: ISelectRoomInteractor by inject() - val booking = booking private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) override val state = _state.asStateFlow() override fun bookRoom() { - TODO("Not yet implemented") - } - - override fun close() { - TODO("Not yet implemented") } } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index cdfdf472..498c251b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -5,7 +5,5 @@ import tablet.domain.model.Booking interface SelectRoomComponent { val state: StateFlow - fun bookRoom() - fun close() } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index 3e3e811b..b1bed1ea 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,37 +1,8 @@ package tablet.ui.selectRoomScreen -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxSize -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.size -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.font.FontFamily -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp -import androidx.compose.ui.window.Dialog -import androidx.compose.ui.window.DialogProperties -import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView -import tablet.ui.selectRoomScreen.uiComponents.DateTimeView -import tablet.ui.selectRoomScreen.uiComponents.LengthEventView -import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView -import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun SelectRoomScreen(component: RealSelectRoomComponent){ @@ -39,7 +10,8 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ when{ state.isData -> { - SelectRoomView(component) + // SelectRoomView(component) + CheckButton(component) } state.isLoad -> { @@ -53,83 +25,4 @@ fun SelectRoomScreen(component: RealSelectRoomComponent){ } } -} - -@Composable -fun SelectRoomView( - component: RealSelectRoomComponent -){ - val modifier = Modifier.background(Color(0xFF3A3736)) - val shape = RoundedCornerShape(16) - - - Dialog( - onDismissRequest = {} - ) - { - Box( - modifier = Modifier - .size(575.dp, 510.dp) - .clip(RoundedCornerShape(5)) - .background(Color(0xFF302D2C)), - contentAlignment = Alignment.Center - ) { - Column{ - Text( - modifier = Modifier.width(415.dp), - text = "Занять ${component.booking.nameRoom}?", - fontSize = 28.sp, - fontWeight = FontWeight(500), - fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA), - textAlign = TextAlign.Center - ) - Spacer(modifier = Modifier.height(24.dp)) - TitleFieldView( - modifier = Modifier.width(415.dp), - title = "когда" - ) - Spacer(modifier = Modifier.height(16.dp)) - DateTimeView( - modifier = modifier.height(64.dp).width(415.dp), - shape = shape, - booking = component.booking - ) - Spacer(modifier = Modifier.height(24.dp)) - Row { - Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { - TitleFieldView( - modifier = Modifier.width(156.dp), - title = "на сколько" - ) - LengthEventView( - modifier = modifier.height(64.dp).width(156.dp), - shape = shape, - booking = component.booking - ) - } - Spacer(modifier = Modifier.width(16.dp)) - Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { - TitleFieldView( - modifier = Modifier.width(243.dp), - title = "организатор" - ) - OrganizerEventView( - modifier = modifier.height(64.dp).width(243.dp), - shape = shape, - booking = component.booking - ) - } - } - Spacer(modifier = Modifier.height(40.dp)) - BookingButtonView( - modifier = Modifier.height(64.dp).width(415.dp), - color = Color(0xFFEF7234), - shape = RoundedCornerShape(40), - booking = component.booking - ) - } - } - } - } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt new file mode 100644 index 00000000..c3b21f2a --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt @@ -0,0 +1,135 @@ +package tablet.ui.selectRoomScreen + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.MutableState +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.draw.clip +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import tablet.ui.selectRoomScreen.uiComponents.CrossButtonView +import tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import tablet.ui.selectRoomScreen.uiComponents.Title +import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView + +@Composable +fun CheckButton(component: RealSelectRoomComponent) { + val showDialog = remember { mutableStateOf(false) } + Button( + onClick = { showDialog.value = true } + ) { + Text( + text = "check", + ) + } + + if(showDialog.value){ + SelectRoomView(component, showDialog) + } +} + +@Composable +fun SelectRoomView( + component: RealSelectRoomComponent, + showDialog: MutableState +) { + // val showDialog = remember { mutableStateOf(true) } + val modifier = Modifier.background(Color(0xFF3A3736)) + val shape = RoundedCornerShape(16) + + if (!showDialog.value) return + + Dialog( + onDismissRequest = { showDialog.value = false } + ) + { + Box( + modifier = Modifier + .size(575.dp, 510.dp) + .clip(RoundedCornerShape(5)) + .background(Color(0xFF302D2C)), + ) { + Column( + modifier = Modifier.matchParentSize(), + horizontalAlignment = Alignment.CenterHorizontally, + verticalArrangement = Arrangement.Center + ) { + Spacer(modifier = Modifier.height(30.dp)) + CrossButtonView( + Modifier.width(575.dp), + onDismissRequest = { showDialog.value = false } + ) + Title(component) + Spacer(modifier = Modifier.height(24.dp)) + TitleFieldView( + modifier = Modifier.width(415.dp), + title = MainRes.string.whenEvent + ) + Spacer(modifier = Modifier.height(16.dp)) + DateTimeView( + modifier = modifier.height(64.dp).width(415.dp), + shape = shape, + booking = component.booking + ) + Spacer(modifier = Modifier.height(24.dp)) + RowInfoLengthAndOrganizer(modifier, shape, component) + Spacer(modifier = Modifier.height(40.dp)) + BookingButtonView( + modifier = Modifier.height(64.dp).width(415.dp), + color = Color(0xFFEF7234), + shape = RoundedCornerShape(40), + booking = component.booking + ) + Spacer(modifier = Modifier.height(80.dp)) + } + } + } +} + +@Composable +fun RowInfoLengthAndOrganizer(modifier: Modifier, shape: RoundedCornerShape, component: RealSelectRoomComponent){ + Row { + Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { + TitleFieldView( + modifier = Modifier.width(156.dp), + title = MainRes.string.how_much + ) + LengthEventView( + modifier = modifier.height(64.dp).width(156.dp), + shape = shape, + booking = component.booking + ) + } + Spacer(modifier = Modifier.width(16.dp)) + Column(verticalArrangement = Arrangement.spacedBy(16.dp)) { + TitleFieldView( + modifier = Modifier.width(243.dp), + title = MainRes.string.organizer + ) + OrganizerEventView( + modifier = modifier.height(64.dp).width(243.dp), + shape = shape, + booking = component.booking + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt index 31a2344e..3613b943 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -1,8 +1,6 @@ package tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.width import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults @@ -15,10 +13,10 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.TextAlign -import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking +import tablet.utils.time24 @Composable fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { @@ -34,11 +32,15 @@ fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShap Box(contentAlignment = Alignment.Center) { Text( - text = "Занять с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + text = MainRes.string.booking_time_button.format( + startTime = booking.eventInfo.startTime.time24(), + finishTime = booking.eventInfo.finishTime.time24() + ), fontSize = 20.sp, fontWeight = FontWeight(500), - fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA) + color = Color(0xFFFAFAFA), + letterSpacing = 0.1.sp, + fontFamily = FontFamily.SansSerif ) } } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt new file mode 100644 index 00000000..d1dfc7e0 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt @@ -0,0 +1,39 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.background +import androidx.compose.material.Icon +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material.IconButton +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.unit.dp +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.domain.model.Booking + +@Composable +fun CrossButtonView(modifier: Modifier, onDismissRequest:() -> Unit) { + + Box( + modifier = modifier.padding(end = 54.dp), + contentAlignment = Alignment.CenterEnd + ) { + IconButton( + onClick = { onDismissRequest() }, + modifier = Modifier + .size(40.dp) + ) { + Icon( + imageVector = ImageVector.vectorResource(MainRes.image.cross), + contentDescription = "Cross", + modifier = Modifier.size(25.dp), + tint = Color(0xFF808080) + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt index fd2a29a3..83140c52 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -1,8 +1,5 @@ package tablet.ui.selectRoomScreen.uiComponents -import androidx.compose.foundation.background -import androidx.compose.foundation.border -import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer @@ -13,18 +10,15 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.text.style.LineHeightStyle -import androidx.compose.ui.unit.TextUnit import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking -import java.text.SimpleDateFormat -import java.util.Calendar -import java.util.Locale +import tablet.utils.date +import tablet.utils.time24 @Composable fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { @@ -48,7 +42,10 @@ fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking Spacer(modifier = Modifier.width(5.dp)) Text( - text = "с ${booking.eventInfo.startTime.time24()} до ${booking.eventInfo.finishTime.time24()}", + text = MainRes.string.booking_time.format( + startTime = booking.eventInfo.startTime.time24(), + finishTime = booking.eventInfo.finishTime.time24() + ), fontSize = 20.sp, fontWeight = FontWeight(500), fontFamily = FontFamily.SansSerif, @@ -59,11 +56,3 @@ fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking } } - -private fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + - SimpleDateFormat("MMMM", Locale("ru")).format(this.time) - -fun Calendar.time24() = SimpleDateFormat( - "HH:mm", - Locale("ru") -).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt index 589b774f..d55125c8 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -12,6 +12,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes import tablet.domain.model.Booking import java.util.Calendar @@ -21,8 +22,11 @@ fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Book val hours = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) / 60 val minutes = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) % 60 val lengthEvent: String = when(hours){ - 0 -> "$minutes мин" - else -> "${hours}ч ${minutes}мин" + 0 -> MainRes.string.minutes.format( minutes = minutes.toString()) + else -> MainRes.string.hours_minutes.format( + hours = hours.toString(), + minutes = minutes.toString() + ) } Card( @@ -45,4 +49,5 @@ fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Book } private fun getLengthEvent(start: Calendar, finish: Calendar) = - finish.get(Calendar.MINUTE) - start.get(Calendar.MINUTE) \ No newline at end of file + (finish.get(Calendar.HOUR) * 60 + finish.get(Calendar.MINUTE)) - + (start.get(Calendar.HOUR) * 60 + start.get(Calendar.MINUTE)) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt index 4a317e25..fe8ecb6b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -11,6 +11,7 @@ import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp import tablet.domain.model.Booking @@ -27,7 +28,8 @@ fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: B fontWeight = FontWeight(700), fontSize = 20.sp, fontFamily = FontFamily.SansSerif, - color = Color(0xFFFAFAFA) + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center ) } } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt new file mode 100644 index 00000000..ba1f0ea3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt @@ -0,0 +1,29 @@ +package tablet.ui.selectRoomScreen.uiComponents + +import androidx.compose.foundation.layout.width +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.text.style.TextAlign +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.tablet.features.selectRoom.MainRes +import tablet.ui.selectRoomScreen.RealSelectRoomComponent + +@Composable +fun Title(component: RealSelectRoomComponent){ + Text( + modifier = Modifier.width(415.dp), + text = MainRes.string.title_booking_dialog.format( + nameRoom = component.booking.nameRoom + ), + fontSize = 28.sp, + fontWeight = FontWeight(500), + fontFamily = FontFamily.SansSerif, + color = Color(0xFFFAFAFA), + textAlign = TextAlign.Center + ) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt new file mode 100644 index 00000000..0879e1b3 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt @@ -0,0 +1,10 @@ +package tablet.utils + +import java.text.SimpleDateFormat +import java.util.Calendar +import java.util.Locale + +fun Calendar.date() = "${this.get(Calendar.DAY_OF_MONTH)} " + + SimpleDateFormat("MMMM", Locale("ru")).format(this.time) + +fun Calendar.time24() = SimpleDateFormat("HH:mm", Locale("ru")).format(this.time) diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg b/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg new file mode 100644 index 00000000..626d0499 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/libres/images/cross.svg @@ -0,0 +1,3 @@ + + + diff --git a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml index a5e70883..281a0ebf 100644 --- a/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml +++ b/tabletApp/features/selectRoom/src/commonMain/libres/strings/strings_ru.xml @@ -6,4 +6,6 @@ когда на сколько организатор + ${minutes} мин + ${hours}ч ${minutes}мин \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml b/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml deleted file mode 100644 index 336fd8bb..00000000 --- a/tabletApp/features/selectRoom/src/main/res/drawable/cross.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 0be3fc5d..25ec0e75 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -7,10 +7,8 @@ import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo +import tablet.domain.MockBooking import tablet.ui.selectRoomScreen.RealSelectRoomComponent -import java.util.Calendar class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -41,15 +39,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co Child.SelectRoomChild( RealSelectRoomComponent( componentContext, - Booking - ("Sirius", - EventInfo - ( - Calendar.getInstance(), - Calendar.getInstance(), - "Ольга Белозёрова" - ) - ) + MockBooking.bookingCheckTime15min ) ) } -- GitLab From c586d82ed4b5fa12a7634d0af5ecd0cd898ed28f Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 6 Jul 2023 18:41:46 +0600 Subject: [PATCH 44/63] [Feature] Add free negotiations screen --- assets/person.svg | 4 + .../FreeNegotiationsComponent.kt | 12 ++ .../FreeNegotiationsScreen.kt | 141 ++++++++++++++++++ .../free_negotiations/components/RoomCard.kt | 86 +++++++++++ .../components/Room\320\241haracteristics.kt" | 36 +++++ .../ui/free_negotiations/models/RoomItem.kt | 13 ++ .../office/elevator/ui/main/MainComponent.kt | 7 +- .../office/elevator/ui/main/MainScreen.kt | 3 + 8 files changed, 301 insertions(+), 1 deletion(-) create mode 100644 assets/person.svg create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt create mode 100644 "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" create mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt diff --git a/assets/person.svg b/assets/person.svg new file mode 100644 index 00000000..89371094 --- /dev/null +++ b/assets/person.svg @@ -0,0 +1,4 @@ + + + + diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt new file mode 100644 index 00000000..da14e870 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt @@ -0,0 +1,12 @@ +package band.effective.office.elevator.ui.free_negotiations + +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.mvikotlin.core.store.StoreFactory + + +class FreeNegotiationsComponent( + componentContext: ComponentContext, + storeFactory: StoreFactory +) : + ComponentContext by componentContext { +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt new file mode 100644 index 00000000..35a202c6 --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt @@ -0,0 +1,141 @@ +package band.effective.office.elevator.ui.free_negotiations + +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.width +import androidx.compose.foundation.rememberScrollState +import androidx.compose.foundation.verticalScroll +import androidx.compose.material.Icon +import androidx.compose.material.IconButton +import androidx.compose.material.Text +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.ArrowBack +import androidx.compose.material.icons.filled.Person +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.elevator.ui.free_negotiations.components.RoomCard +import band.effective.office.elevator.ui.free_negotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.free_negotiations.models.RoomItem + + +@Composable +fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { + FreeNegotiationsContent(date = "5 июля", timeStart = "17:49", timeEnd = "19:00", onClick = {}) + +} + +@OptIn(ExperimentalLayoutApi::class) +@Composable +internal fun FreeNegotiationsContent( + date: String?, + timeStart: String?, + timeEnd: String?, + onClick: () -> Unit +) { + val rooms: List = listOf( + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + ) + + Column( + modifier = Modifier + .fillMaxSize() + .background(Color(0XFF1E1C1A)) + .verticalScroll( + rememberScrollState() + ) + ) { + Row( + modifier = Modifier + .fillMaxWidth() + .height(100.dp) + .background(Color(0xFFF252322)), + verticalAlignment = Alignment.CenterVertically, + horizontalArrangement = Arrangement.Start + ) { + Spacer(modifier = Modifier.height(60.dp)) + IconButton(onClick = { onClick() }) { + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + Icons.Filled.ArrowBack, + contentDescription = null, + tint = Color(0xFFFA362F8) + ) + } + } + Spacer(modifier = Modifier.width(4.dp)) + Text( + text = "Занять $date с $timeStart до $timeEnd", + style = TextStyle( + color = Color(0xFFFA362F8), + fontSize = 20.sp + ) + ) + } + FlowRow(modifier = Modifier.padding(24.dp)) { + for (room in rooms) { + RoomCard( + roomItem = room, + onClick = {}, + modifier = Modifier.fillMaxWidth(0.3F) + ) + Spacer(modifier = Modifier.width(24.dp)) + } + } + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt new file mode 100644 index 00000000..fe82f81a --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt @@ -0,0 +1,86 @@ +package band.effective.office.elevator.ui.free_negotiations.components + +import androidx.compose.foundation.border +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.ExperimentalLayoutApi +import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material.Card +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import band.effective.office.elevator.ui.free_negotiations.models.RoomItem + +@OptIn(ExperimentalLayoutApi::class) +@Composable +fun RoomCard( + roomItem: RoomItem, + onClick: () -> Unit, + modifier: Modifier = Modifier +) { + Column(modifier = modifier) { + Card( + modifier = Modifier + .fillMaxWidth().height(288.dp), + shape = RoundedCornerShape(16.dp), + backgroundColor = Color(0xFFF3A3736) + ) { + Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { + Text( + text = roomItem.name, + style = TextStyle( + color = Color.White, + fontSize = 48.sp + ) + ) + Spacer(modifier = Modifier.height(28.dp)) + FlowRow( + horizontalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.padding(horizontal = 32.dp, vertical = 28.dp), + maxItemsInEachRow = 2 + ) { + for (stuff in roomItem.stuff) { + RoomCharacteristics( + icon = stuff.icon, + text = stuff.text + ) + } + } + Spacer(modifier = Modifier.height(50.dp)) + } + } + Spacer(modifier = Modifier.height(16.dp)) + Button( + onClick = { onClick() }, + modifier = Modifier + .border(2.dp, shape = RoundedCornerShape(40.dp), color = Color(0xFFFEF7234)) + .fillMaxWidth(), + shape = RoundedCornerShape(40.dp), + colors = ButtonDefaults.buttonColors( + backgroundColor = Color( + 0xFFFF1E1C1A + ) + ) + ) { + Text( + text = "Занять ${roomItem.name}", + style = TextStyle( + color = Color(0xFFFEF7234), + fontSize = 18.sp + ) + ) + } + Spacer(modifier = Modifier.height(16.dp)) + } +} \ No newline at end of file diff --git "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" "b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" new file mode 100644 index 00000000..1baedbf2 --- /dev/null +++ "b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" @@ -0,0 +1,36 @@ +package band.effective.office.elevator.ui.free_negotiations.components + +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.width +import androidx.compose.material.Icon +import androidx.compose.material.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp + +@Composable +fun RoomCharacteristics(icon: ImageVector, text: String) { + Row(verticalAlignment = Alignment.CenterVertically) { + Icon( + imageVector = icon, + contentDescription = null, + tint = Color.White, + modifier = Modifier.size(30.dp) + ) + Spacer(modifier = Modifier.width(8.dp)) + Text( + text = text, + style = TextStyle( + color = Color.White, + fontSize = 16.sp + ) + ) + } +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt new file mode 100644 index 00000000..fb9128eb --- /dev/null +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt @@ -0,0 +1,13 @@ +package band.effective.office.elevator.ui.free_negotiations.models + +import androidx.compose.ui.graphics.vector.ImageVector + +class RoomItem( + val name: String, + val stuff: List +) + +class RoomCharacteristicsItem( + val icon: ImageVector, + val text: String +) \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt index 491dd20e..86822ffc 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt @@ -1,6 +1,7 @@ package band.effective.office.elevator.ui.main import band.effective.office.elevator.ui.elevator.ElevatorComponent +import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsComponent import band.effective.office.elevator.ui.profile.ProfileComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.ChildStack @@ -22,7 +23,7 @@ class MainComponent( private val navigation = StackNavigation() private val stack = childStack( source = navigation, - initialStack = { listOf(Config.Elevator) }, + initialStack = { listOf(Config.FreeNegotiations) }, childFactory = ::child, ) val childStack: Value> = stack @@ -36,6 +37,7 @@ class MainComponent( ::profileOutput ) ) + is Config.FreeNegotiations -> Child.FreeNegotiations(FreeNegotiationsComponent(componentContext, storeFactory)) } fun onOutput(output: Output) { @@ -54,6 +56,7 @@ class MainComponent( sealed class Child { class Elevator(val component: ElevatorComponent) : Child() class Profile(val component: ProfileComponent) : Child() + class FreeNegotiations(val component: FreeNegotiationsComponent) : Child() } private sealed interface Config : Parcelable { @@ -62,6 +65,8 @@ class MainComponent( @Parcelize object Profile : Config + @Parcelize + object FreeNegotiations : Config } sealed class Output { diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt index 33e32eff..f41a0596 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt @@ -13,6 +13,7 @@ import band.effective.office.elevator.components.TabNavigationItem import band.effective.office.elevator.navigation.ElevatorTab import band.effective.office.elevator.navigation.ProfileTab import band.effective.office.elevator.ui.elevator.ElevatorScreen +import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsScreen import band.effective.office.elevator.ui.profile.ProfileScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.Direction @@ -39,6 +40,7 @@ fun MainScreen(component: MainComponent) { when (val child = it.instance) { is MainComponent.Child.Elevator -> ElevatorScreen(child.component) is MainComponent.Child.Profile -> ProfileScreen(child.component) + is MainComponent.Child.FreeNegotiations -> FreeNegotiationsScreen(child.component) } } } @@ -69,6 +71,7 @@ private val MainComponent.Child.index: Int when (this) { is MainComponent.Child.Elevator -> 0 is MainComponent.Child.Profile -> 1 + is MainComponent.Child.FreeNegotiations -> 2 } @Composable -- GitLab From 77c8521268a5efb67fd687e92eb2155de9491384 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 6 Jul 2023 19:43:37 +0600 Subject: [PATCH 45/63] [Feature] Add free negotiations screen --- .../FreeNegotiationsComponent.kt | 12 ---- .../office/elevator/ui/main/MainComponent.kt | 7 +- .../office/elevator/ui/main/MainScreen.kt | 3 - .../FreeNegotiationsComponent.kt | 61 +++++++++++++++++ .../FreeNegotiationsScreen.kt | 68 ++++--------------- .../components/RoomCard.kt | 4 +- .../components/Room\320\241haracteristics.kt" | 2 +- .../models/RoomItem.kt | 2 +- 8 files changed, 80 insertions(+), 79 deletions(-) delete mode 100644 composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/FreeNegotiationsScreen.kt (62%) rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/components/RoomCard.kt (95%) rename "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" => "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" (93%) rename {composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations => tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen}/models/RoomItem.kt (76%) diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt deleted file mode 100644 index da14e870..00000000 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsComponent.kt +++ /dev/null @@ -1,12 +0,0 @@ -package band.effective.office.elevator.ui.free_negotiations - -import com.arkivanov.decompose.ComponentContext -import com.arkivanov.mvikotlin.core.store.StoreFactory - - -class FreeNegotiationsComponent( - componentContext: ComponentContext, - storeFactory: StoreFactory -) : - ComponentContext by componentContext { -} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt index 86822ffc..491dd20e 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainComponent.kt @@ -1,7 +1,6 @@ package band.effective.office.elevator.ui.main import band.effective.office.elevator.ui.elevator.ElevatorComponent -import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsComponent import band.effective.office.elevator.ui.profile.ProfileComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.ChildStack @@ -23,7 +22,7 @@ class MainComponent( private val navigation = StackNavigation() private val stack = childStack( source = navigation, - initialStack = { listOf(Config.FreeNegotiations) }, + initialStack = { listOf(Config.Elevator) }, childFactory = ::child, ) val childStack: Value> = stack @@ -37,7 +36,6 @@ class MainComponent( ::profileOutput ) ) - is Config.FreeNegotiations -> Child.FreeNegotiations(FreeNegotiationsComponent(componentContext, storeFactory)) } fun onOutput(output: Output) { @@ -56,7 +54,6 @@ class MainComponent( sealed class Child { class Elevator(val component: ElevatorComponent) : Child() class Profile(val component: ProfileComponent) : Child() - class FreeNegotiations(val component: FreeNegotiationsComponent) : Child() } private sealed interface Config : Parcelable { @@ -65,8 +62,6 @@ class MainComponent( @Parcelize object Profile : Config - @Parcelize - object FreeNegotiations : Config } sealed class Output { diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt index f41a0596..33e32eff 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt +++ b/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/main/MainScreen.kt @@ -13,7 +13,6 @@ import band.effective.office.elevator.components.TabNavigationItem import band.effective.office.elevator.navigation.ElevatorTab import band.effective.office.elevator.navigation.ProfileTab import band.effective.office.elevator.ui.elevator.ElevatorScreen -import band.effective.office.elevator.ui.free_negotiations.FreeNegotiationsScreen import band.effective.office.elevator.ui.profile.ProfileScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import com.arkivanov.decompose.extensions.compose.jetbrains.stack.animation.Direction @@ -40,7 +39,6 @@ fun MainScreen(component: MainComponent) { when (val child = it.instance) { is MainComponent.Child.Elevator -> ElevatorScreen(child.component) is MainComponent.Child.Profile -> ProfileScreen(child.component) - is MainComponent.Child.FreeNegotiations -> FreeNegotiationsScreen(child.component) } } } @@ -71,7 +69,6 @@ private val MainComponent.Child.index: Int when (this) { is MainComponent.Child.Elevator -> 0 is MainComponent.Child.Profile -> 1 - is MainComponent.Child.FreeNegotiations -> 2 } @Composable diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt new file mode 100644 index 00000000..ec82b835 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt @@ -0,0 +1,61 @@ +package band.effective.office.elevator.ui.freeNegotiations + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.filled.Person +import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.mvikotlin.core.store.StoreFactory + + +class FreeNegotiationsComponent( + componentContext: ComponentContext, + storeFactory: StoreFactory +) : ComponentContext by componentContext { + val rooms: List = listOf( + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ), + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + RoomItem( + name = "Moon", + stuff = listOf( + RoomCharacteristicsItem( + icon = Icons.Default.Person, + text = "5" + ) + ) + ), + ) + +} \ No newline at end of file diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt similarity index 62% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 35a202c6..1451f995 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/FreeNegotiationsScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations +package band.effective.office.elevator.ui.freeNegotiations import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -27,15 +27,20 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.free_negotiations.components.RoomCard -import band.effective.office.elevator.ui.free_negotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.free_negotiations.models.RoomItem +import band.effective.office.elevator.ui.freeNegotiations.components.RoomCard +import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem @Composable fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { - FreeNegotiationsContent(date = "5 июля", timeStart = "17:49", timeEnd = "19:00", onClick = {}) - + FreeNegotiationsContent( + date = "5 июля", + timeStart = "17:49", + timeEnd = "19:00", + onClick = {}, + component = component, + ) } @OptIn(ExperimentalLayoutApi::class) @@ -44,54 +49,9 @@ internal fun FreeNegotiationsContent( date: String?, timeStart: String?, timeEnd: String?, - onClick: () -> Unit + onClick: () -> Unit, + component: FreeNegotiationsComponent ) { - val rooms: List = listOf( - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ), - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - RoomItem( - name = "Moon", - stuff = listOf( - RoomCharacteristicsItem( - icon = Icons.Default.Person, - text = "5" - ) - ) - ), - ) - Column( modifier = Modifier .fillMaxSize() @@ -128,7 +88,7 @@ internal fun FreeNegotiationsContent( ) } FlowRow(modifier = Modifier.padding(24.dp)) { - for (room in rooms) { + for (room in component.rooms) { RoomCard( roomItem = room, onClick = {}, diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt similarity index 95% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index fe82f81a..db9cdebb 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/RoomCard.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.components +package band.effective.office.elevator.ui.freeNegotiations.components import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement @@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.free_negotiations.models.RoomItem +import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem @OptIn(ExperimentalLayoutApi::class) @Composable diff --git "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" similarity index 93% rename from "composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" rename to "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index 1baedbf2..cce06584 100644 --- "a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.components +package band.effective.office.elevator.ui.freeNegotiations.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer diff --git a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt similarity index 76% rename from composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt index fb9128eb..277858fb 100644 --- a/composeApp/src/commonMain/kotlin/band/effective/office/elevator/ui/free_negotiations/models/RoomItem.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.free_negotiations.models +package band.effective.office.elevator.ui.freeNegotiations.models import androidx.compose.ui.graphics.vector.ImageVector -- GitLab From 78d594dd042aae94a7625b909a42221bbdd4d0ce Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:45:40 +0600 Subject: [PATCH 46/63] [~] fix package name --- .../FreeNegotiationsComponent.kt | 10 ++++------ .../freeNegotiationsScreen/FreeNegotiationsScreen.kt | 7 ++----- .../ui/freeNegotiationsScreen/components/RoomCard.kt | 4 ++-- .../components/Room\320\241haracteristics.kt" | 2 +- .../ui/freeNegotiationsScreen/models/RoomItem.kt | 2 +- 5 files changed, 10 insertions(+), 15 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt index ec82b835..70b6caf5 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt @@ -1,16 +1,14 @@ -package band.effective.office.elevator.ui.freeNegotiations +package band.effective.office.tablet.ui.freeNegotiationsScreen import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.Person -import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomCharacteristicsItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem import com.arkivanov.decompose.ComponentContext -import com.arkivanov.mvikotlin.core.store.StoreFactory class FreeNegotiationsComponent( - componentContext: ComponentContext, - storeFactory: StoreFactory + componentContext: ComponentContext ) : ComponentContext by componentContext { val rooms: List = listOf( RoomItem( diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 1451f995..19d8bc10 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations +package band.effective.office.tablet.ui.freeNegotiationsScreen import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -19,7 +19,6 @@ import androidx.compose.material.IconButton import androidx.compose.material.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack -import androidx.compose.material.icons.filled.Person import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier @@ -27,9 +26,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.freeNegotiations.components.RoomCard -import band.effective.office.elevator.ui.freeNegotiations.models.RoomCharacteristicsItem -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.components.RoomCard @Composable diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index db9cdebb..f5b83a4f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.components +package band.effective.office.tablet.ui.freeNegotiationsScreen.components import androidx.compose.foundation.border import androidx.compose.foundation.layout.Arrangement @@ -20,7 +20,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp -import band.effective.office.elevator.ui.freeNegotiations.models.RoomItem +import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem @OptIn(ExperimentalLayoutApi::class) @Composable diff --git "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index cce06584..a175a241 100644 --- "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.components +package band.effective.office.tablet.ui.freeNegotiationsScreen.components import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt index 277858fb..e4e650c1 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt @@ -1,4 +1,4 @@ -package band.effective.office.elevator.ui.freeNegotiations.models +package band.effective.office.tablet.ui.freeNegotiationsScreen.models import androidx.compose.ui.graphics.vector.ImageVector -- GitLab From 64352559ae3e191804957cb866729a3fca3d355f Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:50:51 +0600 Subject: [PATCH 47/63] [~] add switch on FreeNegotiationsScreen --- .../effective/office/tablet/ui/root/Root.kt | 3 ++- .../office/tablet/ui/root/RootComponent.kt | 21 +++++++------------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index 0e0fbed1..d8d20b5f 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.root import androidx.compose.runtime.Composable +import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen import band.effective.office.tablet.ui.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children import tablet.ui.selectRoomScreen.SelectRoomScreen @@ -12,7 +13,7 @@ fun Root(component: RootComponent) { ) { child -> when (val instance = child.instance) { is RootComponent.Child.MainChild -> MainScreen(instance.component) - is RootComponent.Child.SelectRoomChild -> SelectRoomScreen(instance.component) + is RootComponent.Child.SelectRoomChild -> FreeNegotiationsScreen(instance.component) } } } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 25ec0e75..7321ebe0 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,14 +1,14 @@ package band.effective.office.tablet.ui.root -import band.effective.office.tablet.ui.mainScreen.MainComponent +import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsComponent +import band.effective.office.tablet.ui.mainScreen.RealMainComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.domain.MockBooking -import tablet.ui.selectRoomScreen.RealSelectRoomComponent +import tablet.ui.selectRoomScreen.SelectRoomComponent class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -27,27 +27,22 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co ): Child = when (config) { is Config.Main -> { - Child.MainChild(MainComponent( + Child.MainChild(RealMainComponent( componentContext = componentContext, - onClick = { + OnSelectOtherRoomRequest = { navigation.push(Config.SelectRoom) } )) } is Config.SelectRoom -> { - Child.SelectRoomChild( - RealSelectRoomComponent( - componentContext, - MockBooking.bookingCheckTime15min - ) - ) + Child.SelectRoomChild(FreeNegotiationsComponent(componentContext)) } } sealed class Child { - data class SelectRoomChild(val component: RealSelectRoomComponent) : Child() - data class MainChild(val component: MainComponent) : Child() + data class SelectRoomChild(val component: FreeNegotiationsComponent) : Child() + data class MainChild(val component: RealMainComponent) : Child() } sealed class Config : Parcelable { -- GitLab From 59e691aeebefefd1cf93cc2d1ffa5d9b4106ba4b Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Thu, 6 Jul 2023 20:58:46 +0600 Subject: [PATCH 48/63] [~] move new code in separate package --- settings.gradle.kts | 3 +- tabletApp/build.gradle.kts | 2 ++ .../freeNegotiationsScreen/build.gradle.kts | 34 +++++++++++++++++++ .../src/androidMain/AndroidManifest.xml | 4 +++ .../FreeNegotiationsComponent.kt | 0 .../FreeNegotiationsScreen.kt | 0 .../components/RoomCard.kt | 0 .../components/Room\320\241haracteristics.kt" | 0 .../freeNegotiationsScreen/models/RoomItem.kt | 0 9 files changed, 42 insertions(+), 1 deletion(-) create mode 100644 tabletApp/features/freeNegotiationsScreen/build.gradle.kts create mode 100644 tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt (100%) rename "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" => "tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" (100%) rename tabletApp/features/{roomInfo => freeNegotiationsScreen}/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt (100%) diff --git a/settings.gradle.kts b/settings.gradle.kts index 9f929f38..1fe7c018 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -8,4 +8,5 @@ include(":tabletApp:features:selectRoom") include(":tabletApp:features:roomInfo") include(":tabletApp:features:network") include(":tabletApp:features:domain") -include(":tabletApp:features:core") \ No newline at end of file +include(":tabletApp:features:core") +include(":tabletApp:features:freeNegotiationsScreen") \ No newline at end of file diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index b2017966..497d9eb8 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -53,6 +53,8 @@ kotlin { implementation(project(":tabletApp:features:selectRoom")) implementation(project(":tabletApp:features:roomInfo")) + implementation(project(":tabletApp:features:freeNegotiationsScreen")) + } } val androidMain by getting { diff --git a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts new file mode 100644 index 00000000..f3da50b5 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts @@ -0,0 +1,34 @@ +plugins { + id(Plugins.AndroidLib.plugin) + id(Plugins.MultiplatformCompose.plugin) + id(Plugins.Kotlin.plugin) + id(Plugins.Parcelize.plugin) +} + +android { + compileSdk = 33 +} + +kotlin { + android { + compilations.all { + kotlinOptions { + jvmTarget = "1.8" + } + } + } + + sourceSets { + val commonMain by getting { + dependencies { + implementation(compose.runtime) + implementation(compose.foundation) + implementation(compose.material) + + // Decompose + implementation(Dependencies.Decompose.decompose) + implementation(Dependencies.Decompose.extensions) + } + } + } +} diff --git a/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml b/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml new file mode 100644 index 00000000..c5c2a6c3 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/src/androidMain/AndroidManifest.xml @@ -0,0 +1,4 @@ + + + + diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt diff --git "a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" similarity index 100% rename from "tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" rename to "tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt similarity index 100% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt rename to tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/models/RoomItem.kt -- GitLab From 77223771d40c6f65687a624bf4ac7a52e1585be4 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Mon, 10 Jul 2023 12:39:54 +0600 Subject: [PATCH 49/63] [~] add booking dialog in main screen --- .../office/tablet/domain/model/EventInfo.kt | 4 +- tabletApp/features/roomInfo/build.gradle.kts | 8 +-- .../office/tablet/di/InitRoomInfoKoin.kt | 2 +- .../tablet/ui/mainScreen/MainComponent.kt | 2 + .../office/tablet/ui/mainScreen/MainScreen.kt | 6 +- .../tablet/ui/mainScreen/MainScreenEvent.kt | 3 +- .../tablet/ui/mainScreen/MainScreenState.kt | 6 +- .../tablet/ui/mainScreen/RealMainComponent.kt | 36 +++++----- .../mainScreen/components/MainScreenView.kt | 38 +++++++---- .../RealBookingRoomComponent.kt | 65 +++++++++---------- .../features/selectRoom/build.gradle.kts | 1 + .../office}/tablet/di/initSelectRoomKoin.kt | 3 +- .../office/tablet/di/SelectRoomModule.kt | 9 +++ .../tablet/domain/ISelectRoomInteractor.kt | 8 +++ .../office}/tablet/domain/MockBooking.kt | 6 +- .../tablet/domain/SelectRoomInteractorImpl.kt | 10 +++ .../office}/tablet/domain/model/Booking.kt | 2 +- .../office/tablet/domain/model/EventInfo.kt | 18 +++++ .../tablet/network/ISelectRoomRepository.kt | 8 +++ .../RealSelectRoomComponent.kt | 18 +++-- .../selectRoomScreen/SelectRoomComponent.kt | 4 +- .../ui/selectRoomScreen/SelectRoomScreen.kt | 2 +- .../selectRoomScreen/SelectRoomScreenState.kt | 2 +- .../ui/selectRoomScreen/SelectRoomView.kt | 37 ++++++----- .../uiComponents/BookingButtonView.kt | 6 +- .../uiComponents/CrossButtonView.kt | 4 +- .../uiComponents/DateTimeView.kt | 8 +-- .../uiComponents/LengthEventView.kt | 4 +- .../uiComponents/OrganizerEventView.kt | 4 +- .../uiComponents/TitleFieldView.kt | 2 +- .../uiComponents/TitleModal.kt | 4 +- .../tablet/utils/ConvertCalendarToTime.kt | 2 +- .../kotlin/tablet/di/SelectRoomModule.kt | 9 --- .../tablet/domain/ISelectRoomInteractor.kt | 8 --- .../tablet/domain/SelectRoomInteractorImpl.kt | 9 --- .../kotlin/tablet/domain/model/EventInfo.kt | 9 --- .../tablet/network/ISelectRoomRepository.kt | 8 --- .../effective/office/tablet/MainActivity.kt | 3 +- .../effective/office/tablet/ui/root/Root.kt | 2 +- .../office/tablet/ui/root/RootComponent.kt | 3 +- 40 files changed, 209 insertions(+), 174 deletions(-) rename tabletApp/features/selectRoom/src/androidMain/kotlin/{ => band/effective/office}/tablet/di/initSelectRoomKoin.kt (53%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/domain/MockBooking.kt (89%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/domain/model/Booking.kt (59%) create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt create mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt (50%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomComponent.kt (55%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomScreen.kt (91%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt (86%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/SelectRoomView.kt (79%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt (89%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt (93%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt (90%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt (92%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt (85%) rename tabletApp/features/selectRoom/src/commonMain/kotlin/{ => band/effective/office}/tablet/utils/ConvertCalendarToTime.kt (87%) delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt index 888fea56..f228f4fa 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -3,7 +3,7 @@ package band.effective.office.tablet.domain.model import java.util.Calendar import java.util.GregorianCalendar -data class EventInfo( +/*data class EventInfo( val startTime: Calendar, val finishTime: Calendar, val organizer: String @@ -15,4 +15,4 @@ data class EventInfo( organizer = "" ) } -} +}*/ diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index 250ed26e..a9d5ca66 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -42,15 +42,15 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) - implementation(project(":tabletApp:features:core")) - implementation(project(":tabletApp:features:network")) - implementation(project(":tabletApp:features:domain")) + implementation(project(":tabletApp:features:selectRoom")) } } val androidMain by getting { - dependencies { + dependencies{ // Koin api(Dependencies.Koin.android) + + implementation(project(":tabletApp:features:selectRoom")) } } } diff --git a/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt index d18a61df..07f2ebf4 100644 --- a/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt +++ b/tabletApp/features/roomInfo/src/androidMain/kotlin/band/effective/office/tablet/di/InitRoomInfoKoin.kt @@ -3,5 +3,5 @@ package band.effective.office.tablet.di import org.koin.core.context.startKoin fun initRoomInfoKoin() = startKoin { - modules(commonModule) + modules(commonModule, selectRoomModule) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt index 03297ff7..d44b7123 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt @@ -2,11 +2,13 @@ package band.effective.office.tablet.ui.mainScreen import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent import kotlinx.coroutines.flow.StateFlow interface MainComponent { val state: StateFlow val mockSettingsComponent: MockSettingsComponent val bookingRoomComponent: BookingRoomComponent + val selectRoomComponent: RealSelectRoomComponent fun sendEvent(event: MainScreenEvent) } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt index 1fa780f8..5c261769 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt @@ -11,14 +11,16 @@ import band.effective.office.tablet.ui.mainScreen.components.MainScreenView @Composable fun MainScreen(component: MainComponent) { val state by component.state.collectAsState() - when{ + when { state.isError -> {} state.isLoad -> {} state.isData -> { MainScreenView( room = state.roomInfo, + showBookingModal = state.showBookingModal, mockComponent = component.mockSettingsComponent, - bookingRoomComponent = component.bookingRoomComponent + bookingRoomComponent = component.bookingRoomComponent, + selectRoomComponent = component.selectRoomComponent ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt index d5e0da17..3a01dde2 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt @@ -1,5 +1,6 @@ package band.effective.office.tablet.ui.mainScreen sealed class MainScreenEvent { - object OnCLick: MainScreenEvent() + object OnBookingCurentRoomRequest: MainScreenEvent() + object OnBookingOtherRoomRequest: MainScreenEvent() } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt index 665e0a71..a6afc7a1 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt @@ -8,7 +8,8 @@ data class MainScreenState( val isData: Boolean, val isError: Boolean, val roomInfo: RoomInfo, - val error: String + val error: String, + val showBookingModal: Boolean ) { companion object { val defaultState = @@ -17,7 +18,8 @@ data class MainScreenState( isData = false, isError = false, roomInfo = RoomInfo.defaultValue, - error = "" + error = "", + showBookingModal = false ) } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt index 9cff7774..b0a9820a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt @@ -1,17 +1,17 @@ package band.effective.office.tablet.ui.mainScreen -import band.effective.office.tablet.domain.useCase.UpdateUseCase +import band.effective.office.tablet.domain.MockBooking +import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealBookingRoomComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent -import band.effective.office.tablet.utils.componentCoroutineScope +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import kotlinx.coroutines.flow.update -import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject @@ -20,44 +20,50 @@ class RealMainComponent( private val OnSelectOtherRoomRequest: () -> Unit ) : ComponentContext by componentContext, KoinComponent, MainComponent { - private val updateUseCase: UpdateUseCase by inject() - - private val scope = componentContext.componentCoroutineScope() + private val interactor: RoomInteractor by inject() private var mutableState = MutableStateFlow(MainScreenState.defaultState) override val state = mutableState.asStateFlow() override val mockSettingsComponent: MockSettingsComponent = RealMockSettingsComponent( - componentContext = childContext(key = "mock") + componentContext = childContext(key = "mock"), + updateData = { updateData() } ) override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( componentContext = childContext(key = "bookingRoom"), - onSelectOtherRoom = { OnSelectOtherRoomRequest() }, + onBookingRoom = { sendEvent(it) }, roomName = "Sirius" ) + override val selectRoomComponent: RealSelectRoomComponent = + RealSelectRoomComponent( + componentContext = childContext(key = "bookingCurrentRoom"), + booking = MockBooking.bookingCheckTime15min, + onCloseRequest = { mutableState.update { it.copy(showBookingModal = false) } } + ) init { updateData() } - private fun updateData() = scope.launch { - updateUseCase( - scope = scope, - roomUpdateHandler = { roomInfo -> mutableState.update { it.copy(roomInfo = roomInfo) } }, - organizerUpdateHandler = {}) + private fun updateData() { mutableState.update { it.copy( isLoad = false, isData = true, - roomInfo = updateUseCase.getRoomInfo() + roomInfo = interactor.getRoomInfo("sirius") ) } + bookingRoomComponent.update() } override fun sendEvent(event: MainScreenEvent) = when (event) { - is MainScreenEvent.OnCLick -> { + is MainScreenEvent.OnBookingCurentRoomRequest -> { + mutableState.update { it.copy(showBookingModal = true) } + } + + is MainScreenEvent.OnBookingOtherRoomRequest -> { OnSelectOtherRoomRequest() } } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt index 1c557f3b..c38e2151 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt @@ -22,30 +22,42 @@ import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponen import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingView import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomInfoComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomView @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable fun MainScreenView( room: RoomInfo, + showBookingModal: Boolean, mockComponent: MockSettingsComponent, - bookingRoomComponent: BookingRoomComponent + bookingRoomComponent: BookingRoomComponent, + selectRoomComponent: RealSelectRoomComponent ) { - /*NOTE(Maksim Mishenko): + Box(modifier = Modifier.fillMaxSize()) { + /*NOTE(Maksim Mishenko): * infoViewWidth is part of the width occupied by roomInfoView * infoViewWidth = infoViewFrame.width / mainScreenFrame.width * where infoViewFrame, mainScreenFrame is frames from figma and all width I get from figma*/ - val infoViewWidth = 627f / 1133f - Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { - RoomInfoComponent( - modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), - room = room - ) - Box(modifier = Modifier.fillMaxSize()) { - BookingRoomView( - modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize().padding(25.dp), - bookingRoomComponent = bookingRoomComponent + val infoViewWidth = 627f / 1133f + Row(modifier = Modifier.fillMaxSize().background(color = Color(0xff1E1C1A))) { + RoomInfoComponent( + modifier = Modifier.fillMaxHeight().fillMaxWidth(infoViewWidth), + room = room ) - MockSettingView(mockComponent) + Box(modifier = Modifier.fillMaxSize()) { + BookingRoomView( + modifier = Modifier.background(color = Color(0xFF252322)).fillMaxSize() + .padding(25.dp), + bookingRoomComponent = bookingRoomComponent + ) + MockSettingView(mockComponent) + } + } + Box(modifier = Modifier.fillMaxSize()) { + if (showBookingModal) + SelectRoomView(component = selectRoomComponent) } } + } \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt index 6b33fdeb..76887142 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt @@ -1,11 +1,16 @@ package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +import band.effective.office.tablet.domain.RoomInteractor import band.effective.office.tablet.domain.model.EventInfo -import band.effective.office.tablet.domain.useCase.CheckBookingUseCase -import band.effective.office.tablet.domain.useCase.UpdateUseCase -import band.effective.office.tablet.utils.componentCoroutineScope +import band.effective.office.tablet.ui.mainScreen.MainScreenEvent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.childContext +import com.arkivanov.essenty.lifecycle.Lifecycle +import com.arkivanov.essenty.lifecycle.doOnDestroy +import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.SupervisorJob +import kotlinx.coroutines.cancel import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow @@ -18,7 +23,7 @@ import java.util.GregorianCalendar class RealBookingRoomComponent( private val componentContext: ComponentContext, - private val onSelectOtherRoom: () -> Unit, + private val onBookingRoom: (MainScreenEvent) -> Unit, roomName: String ) : ComponentContext by componentContext, BookingRoomComponent, KoinComponent { @@ -38,47 +43,32 @@ class RealBookingRoomComponent( childContext("organizer"), onSelectOrganizer = { selectOrganizer(it) }) - private val updateUseCase: UpdateUseCase by inject() - private val checkBookingUseCase: CheckBookingUseCase by inject() + private val roomInfoInteractor: RoomInteractor by inject() init { mutableState.update { it.copy(roomName = roomName) } updateSelectTime() update() - componentCoroutineScope().launch { - updateUseCase(scope = componentCoroutineScope(), roomUpdateHandler = { - componentContext.componentCoroutineScope().launch { - mutableState.update { - it.copy( - organizers = updateUseCase.getOrganizersList(), - isBusy = !checkBookingUseCase(state.value.toEvent()), - busyEvent = checkBookingUseCase.busyEvent(state.value.toEvent()) - ?: EventInfo.emptyEvent, - ) - } - } - }, organizerUpdateHandler = {}) - } } override fun sendEvent(event: BookingRoomViewEvent) { when (event) { is BookingRoomViewEvent.OnBookingCurrentRoom -> { - onSelectOtherRoom() + onBookingRoom(MainScreenEvent.OnBookingCurentRoomRequest) } is BookingRoomViewEvent.OnBookingOtherRoom -> { - onSelectOtherRoom() + onBookingRoom(MainScreenEvent.OnBookingOtherRoomRequest) } } } - private fun update() = componentCoroutineScope().launch { + override fun update() { mutableState.update { it.copy( - organizers = updateUseCase.getOrganizersList(), - isBusy = !checkBookingUseCase(state.value.toEvent()), - busyEvent = checkBookingUseCase.busyEvent(state.value.toEvent()) + organizers = roomInfoInteractor.getOrganizers(), + isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, + busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) ?: EventInfo.emptyEvent, ) } @@ -87,7 +77,6 @@ class RealBookingRoomComponent( private fun changeLength(delta: Int) { if (state.value.length + delta >= 0) { mutableState.update { it.copy(length = it.length + delta) } - update() } } @@ -95,7 +84,6 @@ class RealBookingRoomComponent( val newValue = state.value.selectDate.clone() as Calendar newValue.add(Calendar.DAY_OF_MONTH, day) mutableState.update { it.copy(selectDate = newValue) } - update() } //TODO(Maksim Mishenko): think about while(true) @@ -112,14 +100,19 @@ class RealBookingRoomComponent( private fun selectOrganizer(organizer: String) { mutableState.update { it.copy(organizer = organizer) } } +} - private fun BookingRoomState.toEvent(): EventInfo { - val finishTime = selectDate.clone() as Calendar - finishTime.add(Calendar.MINUTE, length) - return EventInfo( - startTime = selectDate, - finishTime = finishTime, - organizer = organizer - ) +//NOTE(Maksim Mishenko): https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 +fun ComponentContext.componentCoroutineScope(): CoroutineScope { + val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) + + if (lifecycle.state != Lifecycle.State.DESTROYED) { + lifecycle.doOnDestroy { + scope.cancel() + } + } else { + scope.cancel() } + + return scope } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index 3f2d3d1c..8c7f4efc 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -40,6 +40,7 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + } } diff --git a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt b/tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt similarity index 53% rename from tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt rename to tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt index f0fca77e..30bfc57f 100644 --- a/tabletApp/features/selectRoom/src/androidMain/kotlin/tablet/di/initSelectRoomKoin.kt +++ b/tabletApp/features/selectRoom/src/androidMain/kotlin/band/effective/office/tablet/di/initSelectRoomKoin.kt @@ -1,5 +1,6 @@ -package tablet.di +package band.effective.office.tablet.di +import band.effective.office.tablet.di.selectRoomModule import org.koin.core.context.startKoin fun initSelectRoomKoin() = startKoin { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt new file mode 100644 index 00000000..a4fda7ef --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/di/SelectRoomModule.kt @@ -0,0 +1,9 @@ +package band.effective.office.tablet.di + +import org.koin.dsl.module +import band.effective.office.tablet.domain.ISelectRoomInteractor +import band.effective.office.tablet.domain.SelectRoomInteractorImpl + +val selectRoomModule = module{ + single { SelectRoomInteractorImpl(get()) } +} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt new file mode 100644 index 00000000..16c84fcd --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo + +interface ISelectRoomInteractor { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt similarity index 89% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt index 6ad5aff4..6a073923 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/MockBooking.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt @@ -1,7 +1,7 @@ -package tablet.domain +package band.effective.office.tablet.domain -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar object MockBooking { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt new file mode 100644 index 00000000..e20e7048 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt @@ -0,0 +1,10 @@ +package band.effective.office.tablet.domain + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.network.ISelectRoomRepository + +class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): + ISelectRoomInteractor { + override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt similarity index 59% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt index 3a81e0df..91345394 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/Booking.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt @@ -1,4 +1,4 @@ -package tablet.domain.model +package band.effective.office.tablet.domain.model data class Booking( val nameRoom: String, diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt new file mode 100644 index 00000000..65fbcc91 --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -0,0 +1,18 @@ +package band.effective.office.tablet.domain.model + +import java.util.Calendar +import java.util.GregorianCalendar + +data class EventInfo( + val startTime: Calendar, + val finishTime: Calendar, + val organizer: String +){ + companion object{ + val emptyEvent = EventInfo( + startTime = GregorianCalendar(), + finishTime = GregorianCalendar(), + organizer = "" + ) + } +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt new file mode 100644 index 00000000..865247fc --- /dev/null +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt @@ -0,0 +1,8 @@ +package band.effective.office.tablet.network + +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.EventInfo + +interface ISelectRoomRepository { + suspend fun bookRoom(booking: Booking) +} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt similarity index 50% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt index 12451cc4..d9a6c8db 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -1,16 +1,18 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import com.arkivanov.decompose.ComponentContext import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.asStateFlow import org.koin.core.component.KoinComponent import org.koin.core.component.inject -import tablet.domain.ISelectRoomInteractor -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.ISelectRoomInteractor +import band.effective.office.tablet.domain.model.Booking -class RealSelectRoomComponent(componentContext: ComponentContext, - val booking: Booking) - : ComponentContext by componentContext, SelectRoomComponent, KoinComponent{ +class RealSelectRoomComponent( + componentContext: ComponentContext, + val booking: Booking, + private val onCloseRequest: () -> Unit +) : ComponentContext by componentContext, SelectRoomComponent, KoinComponent { private val interactor: ISelectRoomInteractor by inject() private var _state = MutableStateFlow(SelectRoomScreenState.defaultState) @@ -20,4 +22,8 @@ class RealSelectRoomComponent(componentContext: ComponentContext, override fun bookRoom() { } + fun close() { + onCloseRequest() + } + } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt similarity index 55% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index 498c251b..a7e2ba39 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,7 +1,7 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import kotlinx.coroutines.flow.StateFlow -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking interface SelectRoomComponent { val state: StateFlow diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt similarity index 91% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt index b1bed1ea..5967840e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreen.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreen.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt similarity index 86% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt index a0dc436d..9a09fb5f 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomScreenState.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen data class SelectRoomScreenState( val isLoad: Boolean, diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt similarity index 79% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt index c3b21f2a..6003605e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/SelectRoomView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen +package band.effective.office.tablet.ui.selectRoomScreen import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement @@ -23,13 +23,13 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.window.Dialog import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.ui.selectRoomScreen.uiComponents.BookingButtonView -import tablet.ui.selectRoomScreen.uiComponents.CrossButtonView -import tablet.ui.selectRoomScreen.uiComponents.DateTimeView -import tablet.ui.selectRoomScreen.uiComponents.LengthEventView -import tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView -import tablet.ui.selectRoomScreen.uiComponents.Title -import tablet.ui.selectRoomScreen.uiComponents.TitleFieldView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.BookingButtonView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.CrossButtonView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.DateTimeView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.LengthEventView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.OrganizerEventView +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.Title +import band.effective.office.tablet.ui.selectRoomScreen.uiComponents.TitleFieldView @Composable fun CheckButton(component: RealSelectRoomComponent) { @@ -42,24 +42,21 @@ fun CheckButton(component: RealSelectRoomComponent) { ) } - if(showDialog.value){ - SelectRoomView(component, showDialog) + if (showDialog.value) { + SelectRoomView(component) } } @Composable fun SelectRoomView( - component: RealSelectRoomComponent, - showDialog: MutableState + component: RealSelectRoomComponent ) { - // val showDialog = remember { mutableStateOf(true) } + // val showDialog = remember { mutableStateOf(true) } val modifier = Modifier.background(Color(0xFF3A3736)) val shape = RoundedCornerShape(16) - if (!showDialog.value) return - Dialog( - onDismissRequest = { showDialog.value = false } + onDismissRequest = { component.close() } ) { Box( @@ -76,7 +73,7 @@ fun SelectRoomView( Spacer(modifier = Modifier.height(30.dp)) CrossButtonView( Modifier.width(575.dp), - onDismissRequest = { showDialog.value = false } + onDismissRequest = { component.close() } ) Title(component) Spacer(modifier = Modifier.height(24.dp)) @@ -106,7 +103,11 @@ fun SelectRoomView( } @Composable -fun RowInfoLengthAndOrganizer(modifier: Modifier, shape: RoundedCornerShape, component: RealSelectRoomComponent){ +fun RowInfoLengthAndOrganizer( + modifier: Modifier, + shape: RoundedCornerShape, + component: RealSelectRoomComponent +) { Row { Column(verticalArrangement = Arrangement.spacedBy(12.dp)) { TitleFieldView( diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt index 3613b943..b82bbb7b 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -15,8 +15,8 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking -import tablet.utils.time24 +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.utils.time24 @Composable fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt index d1dfc7e0..ab21a65e 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.background import androidx.compose.material.Icon @@ -14,7 +14,7 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking @Composable fun CrossButtonView(modifier: Modifier, onDismissRequest:() -> Unit) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt similarity index 89% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt index 83140c52..4cf008c1 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Row @@ -16,9 +16,9 @@ import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking -import tablet.utils.date -import tablet.utils.time24 +import band.effective.office.tablet.domain.model.Booking +import band.effective.office.tablet.utils.date +import band.effective.office.tablet.utils.time24 @Composable fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt similarity index 93% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt index d55125c8..616aaf6f 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -13,7 +13,7 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking import java.util.Calendar @Composable diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt similarity index 90% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt index fe8ecb6b..a2585dd7 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.shape.RoundedCornerShape @@ -13,7 +13,7 @@ import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.sp -import tablet.domain.model.Booking +import band.effective.office.tablet.domain.model.Booking @Composable fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt similarity index 92% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt index af465560..7a22a571 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleFieldView.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt similarity index 85% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt index ba1f0ea3..a9aa93da 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/TitleModal.kt @@ -1,4 +1,4 @@ -package tablet.ui.selectRoomScreen.uiComponents +package band.effective.office.tablet.ui.selectRoomScreen.uiComponents import androidx.compose.foundation.layout.width import androidx.compose.material.Text @@ -11,7 +11,7 @@ import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.selectRoom.MainRes -import tablet.ui.selectRoomScreen.RealSelectRoomComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent @Composable fun Title(component: RealSelectRoomComponent){ diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt similarity index 87% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt rename to tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt index 0879e1b3..22157576 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/utils/ConvertCalendarToTime.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/utils/ConvertCalendarToTime.kt @@ -1,4 +1,4 @@ -package tablet.utils +package band.effective.office.tablet.utils import java.text.SimpleDateFormat import java.util.Calendar diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt deleted file mode 100644 index 32efc178..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/di/SelectRoomModule.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.di - -import org.koin.dsl.module -import tablet.domain.ISelectRoomInteractor -import tablet.domain.SelectRoomInteractorImpl - -val selectRoomModule = module{ - single { SelectRoomInteractorImpl(get()) } -} diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt deleted file mode 100644 index 22d5433d..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/ISelectRoomInteractor.kt +++ /dev/null @@ -1,8 +0,0 @@ -package tablet.domain - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo - -interface ISelectRoomInteractor { - suspend fun bookRoom(booking: Booking) -} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt deleted file mode 100644 index e7b69120..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/SelectRoomInteractorImpl.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.domain - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo -import tablet.network.ISelectRoomRepository - -class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): ISelectRoomInteractor { - override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) -} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt deleted file mode 100644 index c1c4627d..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/domain/model/EventInfo.kt +++ /dev/null @@ -1,9 +0,0 @@ -package tablet.domain.model - -import java.util.Calendar - -data class EventInfo( - val startTime: Calendar, - val finishTime: Calendar, - val organizer: String -) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt deleted file mode 100644 index eb2dea3a..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/tablet/network/ISelectRoomRepository.kt +++ /dev/null @@ -1,8 +0,0 @@ -package tablet.network - -import tablet.domain.model.Booking -import tablet.domain.model.EventInfo - -interface ISelectRoomRepository { - suspend fun bookRoom(booking: Booking) -} \ No newline at end of file diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index db3f3f99..63dfbb14 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -5,14 +5,13 @@ import androidx.appcompat.app.AppCompatActivity import androidx.activity.compose.setContent import band.effective.office.tablet.di.initRoomInfoKoin import com.arkivanov.decompose.defaultComponentContext -import tablet.di.initSelectRoomKoin +import band.effective.office.tablet.di.initSelectRoomKoin class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) initRoomInfoKoin() setContent { - initSelectRoomKoin() App(defaultComponentContext()) } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index d8d20b5f..31b22254 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -4,7 +4,7 @@ import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen import band.effective.office.tablet.ui.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children -import tablet.ui.selectRoomScreen.SelectRoomScreen +import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen @Composable fun Root(component: RootComponent) { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index 7321ebe0..eb968fed 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -8,7 +8,6 @@ import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable import kotlinx.android.parcel.Parcelize -import tablet.ui.selectRoomScreen.SelectRoomComponent class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { @@ -28,7 +27,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co is Config.Main -> { Child.MainChild(RealMainComponent( - componentContext = componentContext, + componentContext = componentContext, OnSelectOtherRoomRequest = { navigation.push(Config.SelectRoom) } -- GitLab From 6d4321dae8e743beeed3df38deeb64338d8c7044 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 11 Jul 2023 12:07:37 +0600 Subject: [PATCH 50/63] [~] add MVIKotlin --- tabletApp/build.gradle.kts | 6 + tabletApp/features/core/build.gradle.kts | 3 + .../office/tablet/domain/model/Booking.kt | 0 .../office/tablet/domain/model/EventInfo.kt | 4 +- .../tablet/domain/useCase/UpdateUseCase.kt | 5 +- .../office/tablet/network/api/WorkApi.kt | 1 - tabletApp/features/roomInfo/build.gradle.kts | 10 +- .../tablet/ui/mainScreen/MainComponent.kt | 14 -- .../tablet/ui/mainScreen/MainScreenEvent.kt | 6 - .../tablet/ui/mainScreen/MainScreenState.kt | 25 --- .../tablet/ui/mainScreen/RealMainComponent.kt | 70 ------- .../BookingRoomComponent.kt | 67 +++++++ .../bookingRoomComponents/BookingRoomView.kt | 14 +- .../RealDateTimeComponent.kt | 2 +- .../RealEventLengthComponent.kt | 2 +- .../RealEventOrganizerComponent.kt | 2 +- .../store/BookingStore.kt | 38 ++++ .../store/BookingStoreFactory.kt | 184 ++++++++++++++++++ .../uiComponents/BusyAlertView.kt | 2 +- .../uiComponents/DateTimeView.kt | 4 +- .../uiComponents/EventLengthView.kt | 9 +- .../uiComponents/EventOrganizerView.kt | 4 +- .../BookingRoomComponent.kt | 13 -- .../bookingRoomComponents/BookingRoomState.kt | 27 --- .../BookingRoomViewEvent.kt | 6 - .../RealBookingRoomComponent.kt | 118 ----------- .../ui/mainScreen/mainScreen/MainComponent.kt | 48 +++++ .../mainScreen/{ => mainScreen}/MainScreen.kt | 3 +- .../MainScreenView.kt | 15 +- .../mainScreen/mainScreen/store/MainStore.kt | 33 ++++ .../mainScreen/store/MainStoreFactory.kt | 87 +++++++++ .../mockComponets/MockSettingView.kt | 2 +- .../mockComponets/MockSettingsComponent.kt | 2 +- .../mockComponets/MockSettingsEvent.kt | 2 +- .../mockComponets/MockState.kt | 2 +- .../RealMockSettingsComponent.kt | 2 +- .../BusyRoomInfoComponent.kt | 4 +- .../CommonRoomInfoComponent.kt | 2 +- .../roomInfoComponents/DateTimeComponent.kt | 2 +- .../FreeRoomInfoComponent.kt | 4 +- .../RoomEventListComponent.kt | 4 +- .../roomInfoComponents/RoomInfoComponent.kt | 4 +- .../features/selectRoom/build.gradle.kts | 1 + .../tablet/domain/ISelectRoomInteractor.kt | 2 +- .../office/tablet/domain/MockBooking.kt | 8 +- .../tablet/domain/SelectRoomInteractorImpl.kt | 3 +- .../office/tablet/domain/model/EventInfo.kt | 18 -- .../tablet/network/ISelectRoomRepository.kt | 3 +- .../RealSelectRoomComponent.kt | 2 +- .../selectRoomScreen/SelectRoomComponent.kt | 1 - .../uiComponents/BookingButtonView.kt | 2 +- .../uiComponents/CrossButtonView.kt | 2 - .../uiComponents/DateTimeView.kt | 2 +- .../uiComponents/LengthEventView.kt | 3 +- .../uiComponents/OrganizerEventView.kt | 3 +- .../effective/office/tablet/MainActivity.kt | 3 +- .../band/effective/office/tablet/App.kt | 5 +- .../effective/office/tablet/ui/root/Root.kt | 3 +- .../office/tablet/ui/root/RootComponent.kt | 23 ++- 59 files changed, 556 insertions(+), 380 deletions(-) rename tabletApp/features/{selectRoom => core}/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt (100%) delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/BookingRoomView.kt (81%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/RealDateTimeComponent.kt (76%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/RealEventLengthComponent.kt (77%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/RealEventOrganizerComponent.kt (90%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStore.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/uiComponents/BusyAlertView.kt (95%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/uiComponents/DateTimeView.kt (94%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/uiComponents/EventLengthView.kt (90%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/bookingRoomComponents/uiComponents/EventOrganizerView.kt (93%) delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt delete mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{ => mainScreen}/MainScreen.kt (86%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => mainScreen}/MainScreenView.kt (75%) create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStore.kt create mode 100644 tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStoreFactory.kt rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/mockComponets/MockSettingView.kt (97%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/mockComponets/MockSettingsComponent.kt (67%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/mockComponets/MockSettingsEvent.kt (79%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/mockComponets/MockState.kt (72%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/mockComponets/RealMockSettingsComponent.kt (95%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/BusyRoomInfoComponent.kt (94%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/CommonRoomInfoComponent.kt (98%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/DateTimeComponent.kt (94%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/FreeRoomInfoComponent.kt (84%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/RoomEventListComponent.kt (96%) rename tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/{components => }/roomInfoComponents/RoomInfoComponent.kt (88%) delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt diff --git a/tabletApp/build.gradle.kts b/tabletApp/build.gradle.kts index 497d9eb8..3e933cb9 100644 --- a/tabletApp/build.gradle.kts +++ b/tabletApp/build.gradle.kts @@ -51,9 +51,15 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + // MVI Kotlin + api(Dependencies.MviKotlin.mviKotlin) + api(Dependencies.MviKotlin.mviKotlinMain) + api(Dependencies.MviKotlin.mviKotlinExtensionsCoroutines) + implementation(project(":tabletApp:features:selectRoom")) implementation(project(":tabletApp:features:roomInfo")) implementation(project(":tabletApp:features:freeNegotiationsScreen")) + implementation(project(":tabletApp:features:core")) } } diff --git a/tabletApp/features/core/build.gradle.kts b/tabletApp/features/core/build.gradle.kts index b4db953e..e369b8ae 100644 --- a/tabletApp/features/core/build.gradle.kts +++ b/tabletApp/features/core/build.gradle.kts @@ -6,6 +6,9 @@ plugins { android { compileSdk = 33 } +dependencies { + implementation("androidx.slice:slice-view:1.0.0") +} kotlin { android { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt similarity index 100% rename from tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt index f228f4fa..888fea56 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -3,7 +3,7 @@ package band.effective.office.tablet.domain.model import java.util.Calendar import java.util.GregorianCalendar -/*data class EventInfo( +data class EventInfo( val startTime: Calendar, val finishTime: Calendar, val organizer: String @@ -15,4 +15,4 @@ import java.util.GregorianCalendar organizer = "" ) } -}*/ +} diff --git a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt index c67ecbb2..81057dbe 100644 --- a/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt +++ b/tabletApp/features/domain/src/commonMain/kotlin/band/effective/office/tablet/domain/useCase/UpdateUseCase.kt @@ -5,6 +5,7 @@ import band.effective.office.tablet.domain.CurrentEventController import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.repository.ServerUpdateRepository import kotlinx.coroutines.CoroutineScope +import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.launch class UpdateUseCase( @@ -32,7 +33,7 @@ class UpdateUseCase( private fun roomUpdate(scope: CoroutineScope): RoomInfo { var newRoomInfo: RoomInfo? = null - scope.launch { + scope.launch(Dispatchers.IO) { newRoomInfo = roomInfoUseCase() } while (newRoomInfo == null) { @@ -44,7 +45,7 @@ class UpdateUseCase( scope: CoroutineScope ): List { var newOrgListInfo: List? = null - scope.launch { + scope.launch(Dispatchers.IO) { newOrgListInfo = organizersInfoUseCase() } while (newOrgListInfo == null) { diff --git a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt index d590dad7..94878ec9 100644 --- a/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt +++ b/tabletApp/features/network/src/commonMain/kotlin/band/effective/office/tablet/network/api/WorkApi.kt @@ -4,7 +4,6 @@ import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.network.model.WebServerEvent import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.delay import kotlinx.coroutines.flow.MutableStateFlow import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch diff --git a/tabletApp/features/roomInfo/build.gradle.kts b/tabletApp/features/roomInfo/build.gradle.kts index a9d5ca66..46ebb661 100644 --- a/tabletApp/features/roomInfo/build.gradle.kts +++ b/tabletApp/features/roomInfo/build.gradle.kts @@ -42,11 +42,19 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + // MVI Kotlin + api(Dependencies.MviKotlin.mviKotlin) + api(Dependencies.MviKotlin.mviKotlinMain) + api(Dependencies.MviKotlin.mviKotlinExtensionsCoroutines) + + implementation(project(":tabletApp:features:core")) + implementation(project(":tabletApp:features:network")) + implementation(project(":tabletApp:features:domain")) implementation(project(":tabletApp:features:selectRoom")) } } val androidMain by getting { - dependencies{ + dependencies { // Koin api(Dependencies.Koin.android) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt deleted file mode 100644 index d44b7123..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainComponent.kt +++ /dev/null @@ -1,14 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen - -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent -import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent -import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent -import kotlinx.coroutines.flow.StateFlow - -interface MainComponent { - val state: StateFlow - val mockSettingsComponent: MockSettingsComponent - val bookingRoomComponent: BookingRoomComponent - val selectRoomComponent: RealSelectRoomComponent - fun sendEvent(event: MainScreenEvent) -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt deleted file mode 100644 index 3a01dde2..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenEvent.kt +++ /dev/null @@ -1,6 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen - -sealed class MainScreenEvent { - object OnBookingCurentRoomRequest: MainScreenEvent() - object OnBookingOtherRoomRequest: MainScreenEvent() -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt deleted file mode 100644 index a6afc7a1..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreenState.kt +++ /dev/null @@ -1,25 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen - -import band.effective.office.tablet.domain.model.RoomInfo - - -data class MainScreenState( - val isLoad: Boolean, - val isData: Boolean, - val isError: Boolean, - val roomInfo: RoomInfo, - val error: String, - val showBookingModal: Boolean -) { - companion object { - val defaultState = - MainScreenState( - isLoad = true, - isData = false, - isError = false, - roomInfo = RoomInfo.defaultValue, - error = "", - showBookingModal = false - ) - } -} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt deleted file mode 100644 index b0a9820a..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/RealMainComponent.kt +++ /dev/null @@ -1,70 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen - -import band.effective.office.tablet.domain.MockBooking -import band.effective.office.tablet.domain.RoomInteractor -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealBookingRoomComponent -import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent -import band.effective.office.tablet.ui.mainScreen.components.mockComponets.RealMockSettingsComponent -import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent -import com.arkivanov.decompose.ComponentContext -import com.arkivanov.decompose.childContext -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.update -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject - -class RealMainComponent( - componentContext: ComponentContext, - private val OnSelectOtherRoomRequest: () -> Unit -) : ComponentContext by componentContext, KoinComponent, MainComponent { - - private val interactor: RoomInteractor by inject() - - private var mutableState = MutableStateFlow(MainScreenState.defaultState) - override val state = mutableState.asStateFlow() - - override val mockSettingsComponent: MockSettingsComponent = - RealMockSettingsComponent( - componentContext = childContext(key = "mock"), - updateData = { updateData() } - ) - override val bookingRoomComponent: BookingRoomComponent = RealBookingRoomComponent( - componentContext = childContext(key = "bookingRoom"), - onBookingRoom = { sendEvent(it) }, - roomName = "Sirius" - ) - override val selectRoomComponent: RealSelectRoomComponent = - RealSelectRoomComponent( - componentContext = childContext(key = "bookingCurrentRoom"), - booking = MockBooking.bookingCheckTime15min, - onCloseRequest = { mutableState.update { it.copy(showBookingModal = false) } } - ) - - init { - updateData() - } - - private fun updateData() { - mutableState.update { - it.copy( - isLoad = false, - isData = true, - roomInfo = interactor.getRoomInfo("sirius") - ) - } - bookingRoomComponent.update() - } - - override fun sendEvent(event: MainScreenEvent) = - when (event) { - is MainScreenEvent.OnBookingCurentRoomRequest -> { - mutableState.update { it.copy(showBookingModal = true) } - } - - is MainScreenEvent.OnBookingOtherRoomRequest -> { - OnSelectOtherRoomRequest() - } - } -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt new file mode 100644 index 00000000..b79a55c9 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt @@ -0,0 +1,67 @@ +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents + +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.store.BookingStore +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.store.BookingStoreFactory +import band.effective.office.tablet.utils.componentCoroutineScope +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.decompose.childContext +import com.arkivanov.mvikotlin.core.instancekeeper.getStore +import com.arkivanov.mvikotlin.core.store.StoreFactory +import com.arkivanov.mvikotlin.extensions.coroutines.stateFlow +import kotlinx.coroutines.ExperimentalCoroutinesApi +import kotlinx.coroutines.delay +import kotlinx.coroutines.flow.MutableStateFlow +import kotlinx.coroutines.flow.asStateFlow +import kotlinx.coroutines.flow.update +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import java.util.Calendar +import java.util.GregorianCalendar + +class BookingRoomComponent( + private val componentContext: ComponentContext, + storeFactory: StoreFactory, + private val onCurrentBookingRoom: () -> Unit +) : + ComponentContext by componentContext { + + private val bookingStore = instanceKeeper.getStore { + BookingStoreFactory(storeFactory).create() + } + + @OptIn(ExperimentalCoroutinesApi::class) + val state = bookingStore.stateFlow + + val dateTimeComponent: RealDateTimeComponent = + RealDateTimeComponent( + childContext("dateTime"), + changeDay = { bookingStore.accept(BookingStore.Intent.OnChangeDate(it)) } + ) + val eventLengthComponent: RealEventLengthComponent = + RealEventLengthComponent(childContext("length"), + changeLength = { bookingStore.accept(BookingStore.Intent.OnChangeLength(it)) }) + val eventOrganizerComponent: RealEventOrganizerComponent = + RealEventOrganizerComponent( + childContext("organizer"), + onSelectOrganizer = { bookingStore.accept(BookingStore.Intent.OnChangeOrganizer(it)) }) + + fun bookingCurrentRoom() { + onCurrentBookingRoom() + } + + fun bookingOtherRoom(){ + + } + + + //TODO(Maksim Mishenko): think about while(true) + private fun updateSelectTime() { + componentCoroutineScope().launch { + while (true) { + val now = GregorianCalendar() + //mutableState.update { it.copy(selectDate = now) } + delay((60 - now.get(Calendar.SECOND)) * 1000L) + } + } + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomView.kt similarity index 81% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomView.kt index e29dd7b5..7c2f0900 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomView.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Column @@ -21,10 +21,10 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.roomInfo.MainRes -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.BusyAlertView -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.DateTimeView -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventLengthView -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents.EventOrganizerView +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents.BusyAlertView +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents.DateTimeView +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents.EventLengthView +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents.EventOrganizerView @Composable fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: BookingRoomComponent) { @@ -61,13 +61,13 @@ fun BookingRoomView(modifier: Modifier = Modifier, bookingRoomComponent: Booking BusyAlertView( modifier = Modifier.fillMaxWidth(), event = state.busyEvent, - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingOtherRoom) }) + onClick = { bookingRoomComponent.bookingOtherRoom() }) } } Box(Modifier.fillMaxSize(), contentAlignment = Alignment.BottomCenter) { Button( modifier = Modifier.fillMaxWidth().height(60.dp).clip(RoundedCornerShape(100.dp)), - onClick = { bookingRoomComponent.sendEvent(BookingRoomViewEvent.OnBookingCurrentRoom) }, + onClick = { bookingRoomComponent.bookingCurrentRoom() }, colors = ButtonDefaults.buttonColors( contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFFEF7234), diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealDateTimeComponent.kt similarity index 76% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealDateTimeComponent.kt index 89f9cf4c..a62bcda6 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealDateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealDateTimeComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents import com.arkivanov.decompose.ComponentContext diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventLengthComponent.kt similarity index 77% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventLengthComponent.kt index 770b2384..5c75b21a 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventLengthComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventLengthComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents import com.arkivanov.decompose.ComponentContext diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventOrganizerComponent.kt similarity index 90% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventOrganizerComponent.kt index d7b6f3ba..9a8f0c23 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealEventOrganizerComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/RealEventOrganizerComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents import com.arkivanov.decompose.ComponentContext import kotlinx.coroutines.flow.MutableStateFlow diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStore.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStore.kt new file mode 100644 index 00000000..c4e96e28 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStore.kt @@ -0,0 +1,38 @@ +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.store + +import band.effective.office.tablet.domain.model.EventInfo +import com.arkivanov.mvikotlin.core.store.Store +import java.util.Calendar +import java.util.GregorianCalendar + +interface BookingStore : Store { + sealed interface Intent { + object OnBookingCurrentRoom : Intent + object OnBookingOtherRoom : Intent + data class OnChangeDate(val changeInDay: Int) : Intent + data class OnChangeLength(val change: Int) : Intent + data class OnChangeOrganizer(val newOrganizer: String) : Intent + } + + data class State( + val length: Int, + val organizer: String, + val organizers: List, + val selectDate: Calendar, + val isBusy: Boolean, + val busyEvent: EventInfo, + val roomName: String + ) { + companion object { + val default = State( + length = 0, + organizer = "", + organizers = listOf(), + selectDate = GregorianCalendar(), + isBusy = false, + busyEvent = EventInfo.emptyEvent, + roomName = "Sirius" + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt new file mode 100644 index 00000000..f9efc014 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt @@ -0,0 +1,184 @@ +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.store + +import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.useCase.CheckBookingUseCase +import band.effective.office.tablet.domain.useCase.UpdateUseCase +import com.arkivanov.mvikotlin.core.store.Reducer +import com.arkivanov.mvikotlin.core.store.Store +import com.arkivanov.mvikotlin.core.store.StoreFactory +import com.arkivanov.mvikotlin.core.utils.ExperimentalMviKotlinApi +import com.arkivanov.mvikotlin.extensions.coroutines.CoroutineExecutor +import com.arkivanov.mvikotlin.extensions.coroutines.coroutineBootstrapper +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject +import java.util.Calendar + +class BookingStoreFactory(private val storeFactory: StoreFactory) : KoinComponent { + + val checkBookingUseCase: CheckBookingUseCase by inject() + val updateUseCase: UpdateUseCase by inject() + + @OptIn(ExperimentalMviKotlinApi::class) + fun create(): BookingStore = + object : BookingStore, + Store by storeFactory.create( + name = "MainStore", + initialState = BookingStore.State.default, + bootstrapper = coroutineBootstrapper { + launch() { + val eventInfo = EventInfo.emptyEvent + dispatch( + Action.Init( + updateUseCase.getOrganizersList(), + !checkBookingUseCase(eventInfo), + checkBookingUseCase.busyEvent(eventInfo) ?: EventInfo.emptyEvent + ) + ) + dispatch(Action.UpdateOrganizers(updateUseCase.getOrganizersList())) + updateUseCase(this, + { + launch { + dispatch( + Action.UpdateEvents( + !checkBookingUseCase(eventInfo), + checkBookingUseCase.busyEvent(eventInfo) + ?: EventInfo.emptyEvent + ) + ) + } + + }, + { dispatch(Action.UpdateOrganizers(it)) }) + } + }, + executorFactory = ::ExecutorImpl, + reducer = ReducerImpl + ) {} + + private sealed interface Action { + data class UpdateOrganizers(val organizers: List) : Action + data class Init( + val organizers: List, + val isBusy: Boolean, + val busyEvent: EventInfo + ) : Action + + data class UpdateEvents( + val isBusy: Boolean, + val busyEvent: EventInfo + ) : Action + } + + private sealed interface Message { + data class ChangeEvent( + val selectDate: Calendar, + val length: Int, + val isBusy: Boolean, + val busyEvent: EventInfo + ) : Message + + data class ChangeOrganizer(val newOrganizer: String) : Message + object BookingCurrentRoom : Message + object BookingOtherRoom : Message + data class UpdateOrganizers(val organizers: List) : Message + data class UpdateBusy( + val isBusy: Boolean, + val busyEvent: EventInfo + ) : Message + } + + private inner class ExecutorImpl() : + CoroutineExecutor() { + override fun executeIntent( + intent: BookingStore.Intent, + getState: () -> BookingStore.State + ) { + when (intent) { + is BookingStore.Intent.OnBookingCurrentRoom -> dispatch(Message.BookingCurrentRoom) + is BookingStore.Intent.OnBookingOtherRoom -> dispatch(Message.BookingOtherRoom) + is BookingStore.Intent.OnChangeDate -> changeDate(getState(), intent.changeInDay) + is BookingStore.Intent.OnChangeLength -> changeLength(getState(), intent.change) + is BookingStore.Intent.OnChangeOrganizer -> dispatch(Message.ChangeOrganizer(intent.newOrganizer)) + } + } + + override fun executeAction(action: Action, getState: () -> BookingStore.State) { + when (action) { + is Action.UpdateOrganizers -> dispatch(Message.UpdateOrganizers(action.organizers)) + is Action.Init -> { + val defaultEvent = EventInfo.emptyEvent + dispatch( + Message.ChangeEvent( + selectDate = defaultEvent.startTime, + length = 0, + isBusy = action.isBusy, + busyEvent = action.busyEvent + ) + ) + } + + is Action.UpdateEvents -> Message.UpdateBusy(action.isBusy, action.busyEvent) + } + } + + fun changeDate(state: BookingStore.State, changeDay: Int) = scope.launch() { + val event = state.copy(selectDate = state.selectDate.dayUpdate(changeDay)).toEvent() + dispatch( + Message.ChangeEvent( + event.startTime, + state.length, + !checkBookingUseCase(event), + checkBookingUseCase.busyEvent(event) ?: EventInfo.emptyEvent + ) + ) + } + + fun changeLength(state: BookingStore.State, change: Int) = scope.launch() { + val event = state.copy(length = state.length + change).toEvent() + dispatch( + Message.ChangeEvent( + event.startTime, + state.length + change, + !checkBookingUseCase(event), + checkBookingUseCase.busyEvent(event) ?: EventInfo.emptyEvent + ) + ) + } + } + + private fun BookingStore.State.toEvent(): EventInfo { + val finishDate = selectDate.clone() as Calendar + finishDate.add(Calendar.MINUTE, length) + return EventInfo( + startTime = selectDate.clone() as Calendar, + finishTime = finishDate, + organizer = organizer + ) + } + + private object ReducerImpl : Reducer { + override fun BookingStore.State.reduce(msg: Message): BookingStore.State = + when (msg) { + is Message.BookingCurrentRoom -> copy() + is Message.BookingOtherRoom -> copy() + is Message.ChangeEvent -> copy( + selectDate = msg.selectDate, + length = msg.length, + isBusy = msg.isBusy, + busyEvent = msg.busyEvent + ) + + is Message.ChangeOrganizer -> copy(organizer = msg.newOrganizer) + is Message.UpdateOrganizers -> copy(organizers = msg.organizers) + is Message.UpdateBusy -> copy(isBusy = msg.isBusy, busyEvent = msg.busyEvent) + } + + } + + private fun Calendar.dayUpdate(changeDay: Int): Calendar { + val result = clone() as Calendar + result.add(Calendar.DAY_OF_MONTH, changeDay) + return result + } +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/BusyAlertView.kt similarity index 95% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/BusyAlertView.kt index 7ec603f0..410640d1 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/BusyAlertView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/BusyAlertView.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Arrangement diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/DateTimeView.kt similarity index 94% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/DateTimeView.kt index f90e0367..bb621344 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/DateTimeView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/DateTimeView.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents import androidx.compose.foundation.Image import androidx.compose.foundation.layout.Column @@ -19,7 +19,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.roomInfo.MainRes -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealDateTimeComponent +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.RealDateTimeComponent import band.effective.office.tablet.utils.CalendarStringConverter import io.github.skeptick.libres.compose.painterResource import java.util.Calendar diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventLengthView.kt similarity index 90% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventLengthView.kt index eaf6eb26..f0e17603 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventLengthView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventLengthView.kt @@ -1,5 +1,6 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents +import android.util.Log import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -20,7 +21,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.roomInfo.MainRes -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealEventLengthComponent +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.RealEventLengthComponent @Composable fun EventLengthView( @@ -65,7 +66,9 @@ fun EventLengthView( Spacer(modifier = Modifier.width(space)) Button( modifier = Modifier.fillMaxHeight().weight(1f).clip(RoundedCornerShape(15.dp)), - onClick = { component.increment() }, + onClick = { + Log.e("checj","gbgdgh") + component.increment() }, colors = ButtonDefaults.buttonColors( contentColor = Color(0xFFFFFFFF), backgroundColor = Color(0xFF302D2C) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventOrganizerView.kt similarity index 93% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventOrganizerView.kt index 8d17fd80..e60d4f05 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/uiComponents/EventOrganizerView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/uiComponents/EventOrganizerView.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.uiComponents +package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.uiComponents import androidx.compose.foundation.Image import androidx.compose.foundation.background @@ -27,7 +27,7 @@ import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import band.effective.office.tablet.features.roomInfo.MainRes -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.RealEventOrganizerComponent +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.RealEventOrganizerComponent import io.github.skeptick.libres.compose.painterResource @OptIn(ExperimentalMaterialApi::class) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt deleted file mode 100644 index bfffb1b7..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomComponent.kt +++ /dev/null @@ -1,13 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents - -import kotlinx.coroutines.flow.StateFlow - -interface BookingRoomComponent { - val state: StateFlow - - val dateTimeComponent: RealDateTimeComponent - val eventLengthComponent: RealEventLengthComponent - val eventOrganizerComponent: RealEventOrganizerComponent - - fun sendEvent(event: BookingRoomViewEvent) -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt deleted file mode 100644 index ceed1d76..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomState.kt +++ /dev/null @@ -1,27 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents - -import band.effective.office.tablet.domain.model.EventInfo -import java.util.Calendar -import java.util.GregorianCalendar - -data class BookingRoomState( - val length: Int, - val organizer: String, - val organizers: List, - val selectDate: Calendar, - val isBusy: Boolean, - val busyEvent: EventInfo, - val roomName: String -) { - companion object { - val default = BookingRoomState( - length = 0, - organizer = "", - organizers = listOf(), - selectDate = GregorianCalendar(), - isBusy = false, - busyEvent = EventInfo.emptyEvent, - roomName = "" - ) - } -} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt deleted file mode 100644 index 10c9fca5..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/BookingRoomViewEvent.kt +++ /dev/null @@ -1,6 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents - -sealed interface BookingRoomViewEvent{ - object OnBookingCurrentRoom: BookingRoomViewEvent - object OnBookingOtherRoom: BookingRoomViewEvent -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt deleted file mode 100644 index 76887142..00000000 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/bookingRoomComponents/RealBookingRoomComponent.kt +++ /dev/null @@ -1,118 +0,0 @@ -package band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents - -import band.effective.office.tablet.domain.RoomInteractor -import band.effective.office.tablet.domain.model.EventInfo -import band.effective.office.tablet.ui.mainScreen.MainScreenEvent -import com.arkivanov.decompose.ComponentContext -import com.arkivanov.decompose.childContext -import com.arkivanov.essenty.lifecycle.Lifecycle -import com.arkivanov.essenty.lifecycle.doOnDestroy -import kotlinx.coroutines.CoroutineScope -import kotlinx.coroutines.Dispatchers -import kotlinx.coroutines.SupervisorJob -import kotlinx.coroutines.cancel -import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.update -import kotlinx.coroutines.launch -import org.koin.core.component.KoinComponent -import org.koin.core.component.inject -import java.util.Calendar -import java.util.GregorianCalendar - -class RealBookingRoomComponent( - private val componentContext: ComponentContext, - private val onBookingRoom: (MainScreenEvent) -> Unit, - roomName: String -) : - ComponentContext by componentContext, BookingRoomComponent, KoinComponent { - private var mutableState = MutableStateFlow(BookingRoomState.default) - override val state = mutableState.asStateFlow() - - override val dateTimeComponent: RealDateTimeComponent = - RealDateTimeComponent( - childContext("dateTime"), - changeDay = { changeDate(it) } - ) - override val eventLengthComponent: RealEventLengthComponent = - RealEventLengthComponent(childContext("length"), - changeLength = { changeLength(it) }) - override val eventOrganizerComponent: RealEventOrganizerComponent = - RealEventOrganizerComponent( - childContext("organizer"), - onSelectOrganizer = { selectOrganizer(it) }) - - private val roomInfoInteractor: RoomInteractor by inject() - - init { - mutableState.update { it.copy(roomName = roomName) } - updateSelectTime() - update() - } - - override fun sendEvent(event: BookingRoomViewEvent) { - when (event) { - is BookingRoomViewEvent.OnBookingCurrentRoom -> { - onBookingRoom(MainScreenEvent.OnBookingCurentRoomRequest) - } - - is BookingRoomViewEvent.OnBookingOtherRoom -> { - onBookingRoom(MainScreenEvent.OnBookingOtherRoomRequest) - } - } - } - - override fun update() { - mutableState.update { - it.copy( - organizers = roomInfoInteractor.getOrganizers(), - isBusy = roomInfoInteractor.checkRoom("", GregorianCalendar()) != null, - busyEvent = roomInfoInteractor.checkRoom("", GregorianCalendar()) - ?: EventInfo.emptyEvent, - ) - } - } - - private fun changeLength(delta: Int) { - if (state.value.length + delta >= 0) { - mutableState.update { it.copy(length = it.length + delta) } - } - } - - private fun changeDate(day: Int) { - val newValue = state.value.selectDate.clone() as Calendar - newValue.add(Calendar.DAY_OF_MONTH, day) - mutableState.update { it.copy(selectDate = newValue) } - } - - //TODO(Maksim Mishenko): think about while(true) - private fun updateSelectTime() { - componentCoroutineScope().launch { - while (true) { - val now = GregorianCalendar() - mutableState.update { it.copy(selectDate = now) } - delay((60 - now.get(Calendar.SECOND)) * 1000L) - } - } - } - - private fun selectOrganizer(organizer: String) { - mutableState.update { it.copy(organizer = organizer) } - } -} - -//NOTE(Maksim Mishenko): https://gist.github.com/aartikov/a56cc94bb306e05b7b7927353910da08 -fun ComponentContext.componentCoroutineScope(): CoroutineScope { - val scope = CoroutineScope(SupervisorJob() + Dispatchers.Main.immediate) - - if (lifecycle.state != Lifecycle.State.DESTROYED) { - lifecycle.doOnDestroy { - scope.cancel() - } - } else { - scope.cancel() - } - - return scope -} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt new file mode 100644 index 00000000..24eba435 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt @@ -0,0 +1,48 @@ +package band.effective.office.tablet.ui.mainScreen.mainScreen + +import band.effective.office.tablet.domain.MockBooking +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.BookingRoomComponent +import band.effective.office.tablet.ui.mainScreen.mainScreen.store.MainStore +import band.effective.office.tablet.ui.mainScreen.mainScreen.store.MainStoreFactory +import band.effective.office.tablet.ui.mainScreen.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.mainScreen.mockComponets.RealMockSettingsComponent +import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent +import com.arkivanov.decompose.ComponentContext +import com.arkivanov.decompose.childContext +import com.arkivanov.mvikotlin.core.instancekeeper.getStore +import com.arkivanov.mvikotlin.core.store.StoreFactory +import com.arkivanov.mvikotlin.extensions.coroutines.stateFlow +import kotlinx.coroutines.ExperimentalCoroutinesApi + +class MainComponent( + componentContext: ComponentContext, + storeFactory: StoreFactory, + private val OnSelectOtherRoomRequest: () -> Unit +) : ComponentContext by componentContext { + + val mockSettingsComponent: MockSettingsComponent = + RealMockSettingsComponent( + componentContext = childContext(key = "mock") + ) + val bookingRoomComponent: BookingRoomComponent = BookingRoomComponent( + componentContext = childContext(key = "bookingRoom"), + onCurrentBookingRoom = { mainStore.accept(MainStore.Intent.OnBookingCurrentRoomRequest) }, + storeFactory = storeFactory + ) + val selectRoomComponent: RealSelectRoomComponent = + RealSelectRoomComponent( + componentContext = childContext(key = "bookingCurrentRoom"), + booking = MockBooking.bookingCheckTime15min, + onCloseRequest = { mainStore.accept(MainStore.Intent.CloseModal) } + ) + + private val mainStore = instanceKeeper.getStore { + MainStoreFactory( + storeFactory = storeFactory + ).create() + } + + @OptIn(ExperimentalCoroutinesApi::class) + val state = mainStore.stateFlow + +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreen.kt similarity index 86% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreen.kt index 5c261769..ebf18566 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/MainScreen.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreen.kt @@ -1,11 +1,10 @@ -package band.effective.office.tablet.ui.mainScreen +package band.effective.office.tablet.ui.mainScreen.mainScreen import android.os.Build import androidx.annotation.RequiresApi import androidx.compose.runtime.Composable import androidx.compose.runtime.collectAsState import androidx.compose.runtime.getValue -import band.effective.office.tablet.ui.mainScreen.components.MainScreenView @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreenView.kt similarity index 75% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreenView.kt index c38e2151..42e022c8 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/MainScreenView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainScreenView.kt @@ -1,27 +1,24 @@ -package band.effective.office.tablet.ui.mainScreen.components +package band.effective.office.tablet.ui.mainScreen.mainScreen import android.os.Build import androidx.annotation.RequiresApi import androidx.compose.foundation.background import androidx.compose.foundation.layout.Box -import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxHeight import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.rememberScrollState -import androidx.compose.foundation.verticalScroll import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.unit.dp import band.effective.office.tablet.domain.model.RoomInfo -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomComponent -import band.effective.office.tablet.ui.mainScreen.components.bookingRoomComponents.BookingRoomView -import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingView -import band.effective.office.tablet.ui.mainScreen.components.mockComponets.MockSettingsComponent -import band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents.RoomInfoComponent +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.BookingRoomComponent +import band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.BookingRoomView +import band.effective.office.tablet.ui.mainScreen.mockComponets.MockSettingView +import band.effective.office.tablet.ui.mainScreen.mockComponets.MockSettingsComponent +import band.effective.office.tablet.ui.mainScreen.roomInfoComponents.RoomInfoComponent import band.effective.office.tablet.ui.selectRoomScreen.RealSelectRoomComponent import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomView diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStore.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStore.kt new file mode 100644 index 00000000..f0a30f35 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStore.kt @@ -0,0 +1,33 @@ +package band.effective.office.tablet.ui.mainScreen.mainScreen.store + +import band.effective.office.tablet.domain.model.RoomInfo +import com.arkivanov.mvikotlin.core.store.Store + +interface MainStore : Store { + sealed interface Intent { + object OnBookingCurrentRoomRequest : Intent + object OnBookingOtherRoomRequest : Intent + object CloseModal: Intent + } + + data class State( + val isLoad: Boolean, + val isData: Boolean, + val isError: Boolean, + val roomInfo: RoomInfo, + val error: String, + val showBookingModal: Boolean + ) { + companion object { + val defaultState = + State( + isLoad = true, + isData = false, + isError = false, + roomInfo = RoomInfo.defaultValue, + error = "", + showBookingModal = false + ) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStoreFactory.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStoreFactory.kt new file mode 100644 index 00000000..bc3317f1 --- /dev/null +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/store/MainStoreFactory.kt @@ -0,0 +1,87 @@ +package band.effective.office.tablet.ui.mainScreen.mainScreen.store + +import band.effective.office.tablet.domain.model.RoomInfo +import band.effective.office.tablet.domain.useCase.UpdateUseCase +import com.arkivanov.mvikotlin.core.store.Reducer +import com.arkivanov.mvikotlin.core.store.Store +import com.arkivanov.mvikotlin.core.store.StoreFactory +import com.arkivanov.mvikotlin.core.utils.ExperimentalMviKotlinApi +import com.arkivanov.mvikotlin.extensions.coroutines.CoroutineExecutor +import com.arkivanov.mvikotlin.extensions.coroutines.coroutineBootstrapper +import kotlinx.coroutines.Dispatchers +import kotlinx.coroutines.launch +import org.koin.core.component.KoinComponent +import org.koin.core.component.inject + +class MainStoreFactory(private val storeFactory: StoreFactory) : KoinComponent { + + private val updateUseCase: UpdateUseCase by inject() + + @OptIn(ExperimentalMviKotlinApi::class) + fun create(): MainStore = + object : MainStore, + Store by storeFactory.create( + name = "MainStore", + initialState = MainStore.State.defaultState, + bootstrapper = coroutineBootstrapper { + launch() { + dispatch(Action.UpdateRoomInfo(updateUseCase.getRoomInfo())) + updateUseCase( + scope = this, + roomUpdateHandler = { roomInfo -> + dispatch( + Action.UpdateRoomInfo( + roomInfo + ) + ) + }, + organizerUpdateHandler = {}) + } + }, + executorFactory = ::ExecutorImpl, + reducer = ReducerImpl + ) {} + + private sealed interface Action { + data class UpdateRoomInfo(val roomInfo: RoomInfo) : Action + } + + private sealed interface Message { + data class UpdateRoomInfo(val roomInfo: RoomInfo) : Message + object BookingCurrentRoom : Message + object BookingOtherRoom : Message + object CloseModal : Message + } + + private inner class ExecutorImpl() : + CoroutineExecutor() { + override fun executeIntent(intent: MainStore.Intent, getState: () -> MainStore.State) { + when (intent) { + is MainStore.Intent.OnBookingCurrentRoomRequest -> dispatch(Message.BookingCurrentRoom) + is MainStore.Intent.OnBookingOtherRoomRequest -> dispatch(Message.BookingOtherRoom) + is MainStore.Intent.CloseModal -> dispatch(Message.CloseModal) + } + } + + override fun executeAction(action: Action, getState: () -> MainStore.State) { + when (action) { + is Action.UpdateRoomInfo -> dispatch(Message.UpdateRoomInfo(action.roomInfo)) + } + } + } + + private object ReducerImpl : Reducer { + override fun MainStore.State.reduce(message: Message): MainStore.State = + when (message) { + is Message.BookingCurrentRoom -> copy(showBookingModal = true) + is Message.BookingOtherRoom -> copy() + is Message.UpdateRoomInfo -> copy( + roomInfo = message.roomInfo, + isData = true, + isLoad = false + ) + + is Message.CloseModal -> copy(showBookingModal = false) + } + } +} \ No newline at end of file diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingView.kt similarity index 97% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingView.kt index 5e0f65c4..84c488ac 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingView.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingView.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.mockComponets +package band.effective.office.tablet.ui.mainScreen.mockComponets import androidx.compose.foundation.background import androidx.compose.foundation.layout.Arrangement diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsComponent.kt similarity index 67% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsComponent.kt index fe69efe9..a4d5b074 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.mockComponets +package band.effective.office.tablet.ui.mainScreen.mockComponets import kotlinx.coroutines.flow.StateFlow diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsEvent.kt similarity index 79% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsEvent.kt index ccce7a4f..c581c91d 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockSettingsEvent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockSettingsEvent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.mockComponets +package band.effective.office.tablet.ui.mainScreen.mockComponets sealed interface MockSettingsEvent{ data class OnSwitchEventCount(val newState: Boolean): MockSettingsEvent diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockState.kt similarity index 72% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockState.kt index 2c287e06..ee01fcf2 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/MockState.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/MockState.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.mockComponets +package band.effective.office.tablet.ui.mainScreen.mockComponets data class MockState( val isBusy: Boolean = false, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/RealMockSettingsComponent.kt similarity index 95% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/RealMockSettingsComponent.kt index 50339853..41bb9eee 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/mockComponets/RealMockSettingsComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mockComponets/RealMockSettingsComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.mockComponets +package band.effective.office.tablet.ui.mainScreen.mockComponets import band.effective.office.tablet.domain.MockController import com.arkivanov.decompose.ComponentContext diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/BusyRoomInfoComponent.kt similarity index 94% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/BusyRoomInfoComponent.kt index 06870fc7..2321563f 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/BusyRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/BusyRoomInfoComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import androidx.compose.foundation.background import androidx.compose.foundation.border @@ -30,7 +30,7 @@ fun BusyRoomInfoComponent( capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, - event: band.effective.office.tablet.domain.model.EventInfo? + event: EventInfo? ) { val backgroundColor = Color(0xFFF94C4C) Surface { diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/CommonRoomInfoComponent.kt similarity index 98% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/CommonRoomInfoComponent.kt index 02239e73..07964acd 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/CommonRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/CommonRoomInfoComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import androidx.compose.foundation.Image import androidx.compose.foundation.background diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/DateTimeComponent.kt similarity index 94% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/DateTimeComponent.kt index 0d412a8b..d0a2fc63 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/DateTimeComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/DateTimeComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import android.os.Build import android.widget.TextClock diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/FreeRoomInfoComponent.kt similarity index 84% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/FreeRoomInfoComponent.kt index 1a76ac22..fc11d324 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/FreeRoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/FreeRoomInfoComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier @@ -15,7 +15,7 @@ fun FreeRoomInfoComponent( capacity: Int, isHaveTv: Boolean, electricSocketCount: Int, - nextEvent: band.effective.office.tablet.domain.model.EventInfo? + nextEvent: EventInfo? ) { CommonRoomInfoComponent( modifier = modifier, diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomEventListComponent.kt similarity index 96% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomEventListComponent.kt index 7772bc1e..657dce99 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomEventListComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomEventListComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Row @@ -25,7 +25,7 @@ import band.effective.office.tablet.utils.CalendarStringConverter import java.util.Calendar @Composable -fun RoomEventListComponent(modifier: Modifier = Modifier, eventsList: List) { +fun RoomEventListComponent(modifier: Modifier = Modifier, eventsList: List) { Column(modifier = modifier) { Text( text = "Занятое время", diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomInfoComponent.kt similarity index 88% rename from tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt rename to tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomInfoComponent.kt index 864821c8..dacc3459 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/components/roomInfoComponents/RoomInfoComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/roomInfoComponents/RoomInfoComponent.kt @@ -1,4 +1,4 @@ -package band.effective.office.tablet.ui.mainScreen.components.roomInfoComponents +package band.effective.office.tablet.ui.mainScreen.roomInfoComponents import android.os.Build import androidx.annotation.RequiresApi @@ -13,7 +13,7 @@ import band.effective.office.tablet.domain.model.RoomInfo @RequiresApi(Build.VERSION_CODES.JELLY_BEAN_MR1) @Composable -fun RoomInfoComponent(modifier: Modifier = Modifier, room: band.effective.office.tablet.domain.model.RoomInfo) { +fun RoomInfoComponent(modifier: Modifier = Modifier, room: RoomInfo) { val paddings = 30.dp Column(modifier = modifier) { DateTimeComponent(modifier = Modifier.padding(paddings)) diff --git a/tabletApp/features/selectRoom/build.gradle.kts b/tabletApp/features/selectRoom/build.gradle.kts index 8c7f4efc..56b4f878 100644 --- a/tabletApp/features/selectRoom/build.gradle.kts +++ b/tabletApp/features/selectRoom/build.gradle.kts @@ -41,6 +41,7 @@ kotlin { //Libres implementation(Dependencies.Libres.libresCompose) + implementation(project(":tabletApp:features:core")) } } diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt index 16c84fcd..bd81297c 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/ISelectRoomInteractor.kt @@ -1,7 +1,7 @@ package band.effective.office.tablet.domain import band.effective.office.tablet.domain.model.Booking -import band.effective.office.tablet.domain.model.EventInfo + interface ISelectRoomInteractor { suspend fun bookRoom(booking: Booking) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt index 6a073923..0139ccf3 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/MockBooking.kt @@ -5,7 +5,7 @@ import band.effective.office.tablet.domain.model.EventInfo import java.util.Calendar object MockBooking { - val bookingCheckTime15min = Booking( + val bookingCheckTime15min = band.effective.office.tablet.domain.model.Booking( nameRoom = "Sirius", eventInfo = EventInfo( startTime = setTime(2023, 4, 20, 15, 20), @@ -14,7 +14,7 @@ object MockBooking { ) ) - val bookingCheckTime1h = Booking( + val bookingCheckTime1h = band.effective.office.tablet.domain.model.Booking( nameRoom = "Sirius", eventInfo = EventInfo( startTime = setTime(2023, 11, 11, 15, 20), @@ -23,7 +23,7 @@ object MockBooking { ) ) - val bookingCheckTime1h15min = Booking( + val bookingCheckTime1h15min = band.effective.office.tablet.domain.model.Booking( nameRoom = "Sirius", eventInfo = EventInfo( startTime = setTime(2023, 11, 11, 15, 20), @@ -32,7 +32,7 @@ object MockBooking { ) ) - val bookingCheckOrganizer = Booking( + val bookingCheckOrganizer = band.effective.office.tablet.domain.model.Booking( nameRoom = "Sirius", eventInfo = EventInfo( startTime = setTime(2023, 1, 7, 9, 20), diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt index e20e7048..bd6c79d3 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/SelectRoomInteractorImpl.kt @@ -1,10 +1,9 @@ package band.effective.office.tablet.domain import band.effective.office.tablet.domain.model.Booking -import band.effective.office.tablet.domain.model.EventInfo import band.effective.office.tablet.network.ISelectRoomRepository class SelectRoomInteractorImpl(private val repository: ISelectRoomRepository): ISelectRoomInteractor { - override suspend fun bookRoom(booking: Booking) = repository.bookRoom(booking) + override suspend fun bookRoom(booking: band.effective.office.tablet.domain.model.Booking) = repository.bookRoom(booking) } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt deleted file mode 100644 index 65fbcc91..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ /dev/null @@ -1,18 +0,0 @@ -package band.effective.office.tablet.domain.model - -import java.util.Calendar -import java.util.GregorianCalendar - -data class EventInfo( - val startTime: Calendar, - val finishTime: Calendar, - val organizer: String -){ - companion object{ - val emptyEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), - organizer = "" - ) - } -} \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt index 865247fc..49cb6739 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/network/ISelectRoomRepository.kt @@ -1,8 +1,7 @@ package band.effective.office.tablet.network import band.effective.office.tablet.domain.model.Booking -import band.effective.office.tablet.domain.model.EventInfo interface ISelectRoomRepository { - suspend fun bookRoom(booking: Booking) + suspend fun bookRoom(booking: band.effective.office.tablet.domain.model.Booking) } \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt index d9a6c8db..32f4335f 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/RealSelectRoomComponent.kt @@ -10,7 +10,7 @@ import band.effective.office.tablet.domain.model.Booking class RealSelectRoomComponent( componentContext: ComponentContext, - val booking: Booking, + val booking: band.effective.office.tablet.domain.model.Booking, private val onCloseRequest: () -> Unit ) : ComponentContext by componentContext, SelectRoomComponent, KoinComponent { private val interactor: ISelectRoomInteractor by inject() diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt index a7e2ba39..7216f25c 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/SelectRoomComponent.kt @@ -1,7 +1,6 @@ package band.effective.office.tablet.ui.selectRoomScreen import kotlinx.coroutines.flow.StateFlow -import band.effective.office.tablet.domain.model.Booking interface SelectRoomComponent { val state: StateFlow diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt index b82bbb7b..aacc2271 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/BookingButtonView.kt @@ -19,7 +19,7 @@ import band.effective.office.tablet.domain.model.Booking import band.effective.office.tablet.utils.time24 @Composable -fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: Booking) { +fun BookingButtonView(modifier: Modifier, color: Color, shape: RoundedCornerShape, booking: band.effective.office.tablet.domain.model.Booking) { val isPressed = remember { mutableStateOf(false) } val colorButton = if(isPressed.value) Color(0xFFED6521) else color diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt index ab21a65e..d4829a5c 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/CrossButtonView.kt @@ -1,6 +1,5 @@ package band.effective.office.tablet.ui.selectRoomScreen.uiComponents -import androidx.compose.foundation.background import androidx.compose.material.Icon import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.padding @@ -14,7 +13,6 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp import band.effective.office.tablet.features.selectRoom.MainRes -import band.effective.office.tablet.domain.model.Booking @Composable fun CrossButtonView(modifier: Modifier, onDismissRequest:() -> Unit) { diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt index 4cf008c1..09e26601 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/DateTimeView.kt @@ -21,7 +21,7 @@ import band.effective.office.tablet.utils.date import band.effective.office.tablet.utils.time24 @Composable -fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { +fun DateTimeView(modifier: Modifier, shape: RoundedCornerShape, booking: band.effective.office.tablet.domain.model.Booking) { Card( shape = shape, backgroundColor = Color(0xFF3A3736) diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt index 616aaf6f..9da83f48 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/LengthEventView.kt @@ -7,7 +7,6 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight @@ -17,7 +16,7 @@ import band.effective.office.tablet.domain.model.Booking import java.util.Calendar @Composable -fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { +fun LengthEventView(modifier: Modifier, shape: RoundedCornerShape, booking: band.effective.office.tablet.domain.model.Booking) { val hours = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) / 60 val minutes = getLengthEvent(booking.eventInfo.startTime, booking.eventInfo.finishTime) % 60 diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt index a2585dd7..befc3907 100644 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt +++ b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/ui/selectRoomScreen/uiComponents/OrganizerEventView.kt @@ -7,7 +7,6 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontWeight @@ -16,7 +15,7 @@ import androidx.compose.ui.unit.sp import band.effective.office.tablet.domain.model.Booking @Composable -fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: Booking) { +fun OrganizerEventView(modifier: Modifier, shape: RoundedCornerShape, booking: band.effective.office.tablet.domain.model.Booking) { Card( shape = shape, backgroundColor = Color(0xFF3A3736)) { diff --git a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt index 63dfbb14..93b48575 100644 --- a/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt +++ b/tabletApp/src/androidMain/kotlin/band/effective/office/tablet/MainActivity.kt @@ -6,13 +6,14 @@ import androidx.activity.compose.setContent import band.effective.office.tablet.di.initRoomInfoKoin import com.arkivanov.decompose.defaultComponentContext import band.effective.office.tablet.di.initSelectRoomKoin +import com.arkivanov.mvikotlin.main.store.DefaultStoreFactory class MainActivity : AppCompatActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) initRoomInfoKoin() setContent { - App(defaultComponentContext()) + App(defaultComponentContext(),DefaultStoreFactory()) } } } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index 1df588dd..8d9baa50 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -5,10 +5,11 @@ import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.root.Root import band.effective.office.tablet.ui.root.RootComponent import com.arkivanov.decompose.ComponentContext +import com.arkivanov.mvikotlin.core.store.StoreFactory @Composable -fun App(componentContext: ComponentContext) { - val rootComponent = RootComponent(componentContext) +fun App(componentContext: ComponentContext, storeFactory: StoreFactory) { + val rootComponent = RootComponent(componentContext, storeFactory) MaterialTheme { Root(rootComponent) } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index 31b22254..3faad3de 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -2,9 +2,8 @@ package band.effective.office.tablet.ui.root import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen -import band.effective.office.tablet.ui.mainScreen.MainScreen +import band.effective.office.tablet.ui.mainScreen.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen @Composable fun Root(component: RootComponent) { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt index eb968fed..3c94f454 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/RootComponent.kt @@ -1,15 +1,17 @@ package band.effective.office.tablet.ui.root import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsComponent -import band.effective.office.tablet.ui.mainScreen.RealMainComponent +import band.effective.office.tablet.ui.mainScreen.mainScreen.MainComponent import com.arkivanov.decompose.ComponentContext import com.arkivanov.decompose.router.stack.StackNavigation import com.arkivanov.decompose.router.stack.childStack import com.arkivanov.decompose.router.stack.push import com.arkivanov.essenty.parcelable.Parcelable +import com.arkivanov.mvikotlin.core.store.StoreFactory import kotlinx.android.parcel.Parcelize -class RootComponent(componentContext: ComponentContext) : ComponentContext by componentContext { +class RootComponent(componentContext: ComponentContext, private val storeFactory: StoreFactory) : + ComponentContext by componentContext { private val navigation = StackNavigation() @@ -26,12 +28,15 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co ): Child = when (config) { is Config.Main -> { - Child.MainChild(RealMainComponent( - componentContext = componentContext, - OnSelectOtherRoomRequest = { - navigation.push(Config.SelectRoom) - } - )) + Child.MainChild( + MainComponent( + componentContext = componentContext, + OnSelectOtherRoomRequest = { + navigation.push(Config.SelectRoom) + }, + storeFactory = storeFactory + ) + ) } is Config.SelectRoom -> { @@ -41,7 +46,7 @@ class RootComponent(componentContext: ComponentContext) : ComponentContext by co sealed class Child { data class SelectRoomChild(val component: FreeNegotiationsComponent) : Child() - data class MainChild(val component: RealMainComponent) : Child() + data class MainChild(val component: MainComponent) : Child() } sealed class Config : Parcelable { -- GitLab From 40026a6fb2f186d50f39f928ebde0e6babeb1cd0 Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 10 Jul 2023 01:49:55 +0600 Subject: [PATCH 51/63] Rewritten implementation of colors for themes and fonts --- .../band/effective/office/tablet/App.kt | 1 - .../effective/office/tablet/ui/theme/Color.kt | 42 ++++++++++---- .../effective/office/tablet/ui/theme/Theme.kt | 57 +++++++++++++------ .../office/tablet/ui/theme/Typography.kt | 56 ++++++++++++++++++ 4 files changed, 129 insertions(+), 27 deletions(-) create mode 100644 tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index 8e19a020..2cc904e3 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -1,6 +1,5 @@ package band.effective.office.tablet -import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.root.Root import band.effective.office.tablet.ui.root.RootComponent diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt index 89e6000f..a6df49d1 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt @@ -2,15 +2,37 @@ package band.effective.office.tablet.ui.theme import androidx.compose.ui.graphics.Color -internal val md_theme_dark_primary = Color(0xFFEF7234) -internal val md_theme_dark_onPrimary = Color(0xFFFAFAFA) -internal val md_theme_dark_primaryContainer = Color(0xFF004E5C) -internal val md_theme_dark_secondary = Color(0xFFA362F8) -internal val md_theme_dark_onSecondary = Color(0xFF00373A) -internal val md_theme_dark_secondaryContainer = Color(0xFF004F53) -internal val md_theme_dark_error = Color(0xFFEB4C2A) -internal val md_theme_dark_onError = Color(0xFF690005) +internal val md_theme_dark_primary = Color(0xFFEE7234) +internal val md_theme_dark_secondary = Color(0xFFA262F7) internal val md_theme_dark_background = Color(0xFF1E1C1A) -internal val md_theme_dark_onBackground = Color(0xFFFFE264) internal val md_theme_dark_surface = Color(0xFF252322) -internal val md_theme_dark_onSurface = Color(0xFFFFFFFF) \ No newline at end of file +internal val md_theme_dark_elevationBackground = Color(0xFF302D2C) +internal val md_theme_dark_mountainBackground = Color(0xFF3A3736) +internal val md_theme_dark_busyStatus = Color(0xFFF84C4C) +internal val md_theme_dark_freeStatus = Color(0xFF36C85F) +internal val md_theme_dark_onError = Color(0xFFEA4C2A) +internal val md_theme_dark_onSuccess = Color(0xFF25C050) +internal val md_theme_dark_secondaryButton = Color(0xFFFEFEFE) +internal val md_theme_dark_primaryTextAndIcon = Color(0xFFF9F9F9) +internal val md_theme_dark_secondaryTextAndIcon = Color(0xFF7F7F7F) +internal val md_theme_dark_tertiaryTextAndIcon = Color(0xFF777777) +internal val md_theme_dark_pressedPrimaryButton = Color(0xFFEC6521) +internal val md_theme_dark_disabledPrimaryButton = Color(0xFF342C28) + + +internal val md_theme_light_primary = Color(0xFFE55A0F) +internal val md_theme_light_secondary = Color(0xFF6E00FE) +internal val md_theme_light_background = Color(0xFFFEFEFE) +internal val md_theme_light_surface = Color(0xFFF9F9F9) +internal val md_theme_light_elevationBackground = Color(0xFFEFEFEF) +internal val md_theme_light_mountainBackground = Color(0xFFEFEFEF) +internal val md_theme_light_busyStatus = Color(0xFFF84343) +internal val md_theme_light_freeStatus = Color(0xFF36C85F) +internal val md_theme_light_onError = Color(0xFFEA4C2A) +internal val md_theme_light_onSuccess = Color(0xFF25C050) +internal val md_theme_light_secondaryButton = Color(0xFFE55A0F) +internal val md_theme_light_primaryTextAndIcon = Color(0xFF1F1814) +internal val md_theme_light_secondaryTextAndIcon = Color(0xFF747474) +internal val md_theme_light_tertiaryTextAndIcon = Color(0xFF979797) +internal val md_theme_light_pressedPrimaryButton = Color(0xFFED6F2F) +internal val md_theme_light_disabledPrimaryButton = Color(0xFFD1C9C5) diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt index 8b423a53..a255765e 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -3,40 +3,65 @@ package band.effective.office.tablet.ui.theme import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.material.MaterialTheme import androidx.compose.material.Surface -import androidx.compose.material.Typography import androidx.compose.material.darkColors -import androidx.compose.ui.text.font.FontFamily +import androidx.compose.material.lightColors import androidx.compose.runtime.Composable -private val DarkColors = darkColors( +private val darkColors = darkColors( primary = md_theme_dark_primary, - primaryVariant = md_theme_dark_primaryContainer, secondary = md_theme_dark_secondary, - secondaryVariant = md_theme_dark_secondaryContainer, background = md_theme_dark_background, surface = md_theme_dark_surface, - error = md_theme_dark_error, - onPrimary = md_theme_dark_onPrimary, - onSecondary = md_theme_dark_onSecondary, - onBackground = md_theme_dark_onBackground, - onSurface = md_theme_dark_onSurface, - onError = md_theme_dark_onError + onError = md_theme_dark_onError, ) +object CustomDarkColors { + val elevationBackground = md_theme_dark_elevationBackground + val mountainBackground = md_theme_dark_mountainBackground + val busyStatus = md_theme_dark_busyStatus + val freeStatus = md_theme_dark_freeStatus + val onSuccess = md_theme_dark_onSuccess + val secondaryButton = md_theme_dark_secondaryButton + val primaryTextAndIcon = md_theme_dark_primaryTextAndIcon + val secondaryTextAndIcon = md_theme_dark_secondaryTextAndIcon + val tertiaryTextAndIcon = md_theme_dark_tertiaryTextAndIcon + val pressedPrimaryButton = md_theme_dark_pressedPrimaryButton + val disabledPrimaryButton = md_theme_dark_disabledPrimaryButton +} + +private val lightColors = lightColors( + primary = md_theme_light_primary, + secondary = md_theme_light_secondary, + background = md_theme_light_background, + surface = md_theme_light_surface, + onError = md_theme_light_onError, +) + +object CustomLightColors { + val elevationBackground = md_theme_light_elevationBackground + val mountainBackground = md_theme_light_mountainBackground + val busyStatus = md_theme_light_busyStatus + val freeStatus = md_theme_light_freeStatus + val onSuccess = md_theme_light_onSuccess + val secondaryButton = md_theme_light_secondaryButton + val primaryTextAndIcon = md_theme_light_primaryTextAndIcon + val secondaryTextAndIcon = md_theme_light_secondaryTextAndIcon + val tertiaryTextAndIcon = md_theme_light_tertiaryTextAndIcon + val pressedPrimaryButton = md_theme_light_pressedPrimaryButton + val disabledPrimaryButton = md_theme_light_disabledPrimaryButton +} + @Composable internal fun AppTheme( useDarkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit ) { - val colors = DarkColors - val typography = Typography(defaultFontFamily = FontFamily.Default) - + val colors = darkColors MaterialTheme( colors = colors, - typography = typography, content = { - Surface(content = content) + Surface (content = content) } ) } \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt new file mode 100644 index 00000000..1762bd05 --- /dev/null +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt @@ -0,0 +1,56 @@ +package band.effective.office.tablet.ui.theme + +import androidx.compose.ui.text.TextStyle +import androidx.compose.ui.text.font.FontFamily +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.sp + +val header1 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 56.sp, + lineHeight = 56.sp * 1.5f, + letterSpacing = 56.sp * 0.02f +) +val header2 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 48.sp, + lineHeight = 48.sp * 1.5f, + letterSpacing = 48.sp * 0.02f +) +val header3 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 36.sp, + lineHeight = 36.sp * 1.5f, + letterSpacing = 36.sp * 0.02f +) +val header4 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 28.sp, + lineHeight = 28.sp * 1.5f, + letterSpacing = 28.sp * 0.02f +) +val header5 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 24.sp, + lineHeight = 24.sp * 1.5f, + letterSpacing = 24.sp * 0.02f +) +val header6 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 20.sp, + lineHeight = 20.sp * 1.5f, + letterSpacing = 20.sp * 0.02f +) +val header7 = TextStyle( + fontFamily = FontFamily.Default, + fontWeight = FontWeight.Medium, + fontSize = 18.sp, + lineHeight = 18.sp * 1.5f, + letterSpacing = 18.sp * 0.02f +) -- GitLab From c77364b5b4aaa1ceb37fc27760ccc282c8288a97 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 11 Jul 2023 15:47:17 +0600 Subject: [PATCH 52/63] [~] fix update booking screen when current event change --- .../store/BookingStoreFactory.kt | 23 +++++++++++-------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt index f9efc014..66e57ac0 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/store/BookingStoreFactory.kt @@ -1,6 +1,7 @@ package band.effective.office.tablet.ui.mainScreen.bookingRoomComponents.store import band.effective.office.tablet.domain.model.EventInfo +import band.effective.office.tablet.domain.model.RoomInfo import band.effective.office.tablet.domain.useCase.CheckBookingUseCase import band.effective.office.tablet.domain.useCase.UpdateUseCase import com.arkivanov.mvikotlin.core.store.Reducer @@ -40,11 +41,7 @@ class BookingStoreFactory(private val storeFactory: StoreFactory) : KoinComponen { launch { dispatch( - Action.UpdateEvents( - !checkBookingUseCase(eventInfo), - checkBookingUseCase.busyEvent(eventInfo) - ?: EventInfo.emptyEvent - ) + Action.UpdateEvents(it) ) } @@ -64,10 +61,7 @@ class BookingStoreFactory(private val storeFactory: StoreFactory) : KoinComponen val busyEvent: EventInfo ) : Action - data class UpdateEvents( - val isBusy: Boolean, - val busyEvent: EventInfo - ) : Action + data class UpdateEvents(val newData: RoomInfo) : Action } private sealed interface Message { @@ -118,7 +112,7 @@ class BookingStoreFactory(private val storeFactory: StoreFactory) : KoinComponen ) } - is Action.UpdateEvents -> Message.UpdateBusy(action.isBusy, action.busyEvent) + is Action.UpdateEvents -> checkBusy(getState()) } } @@ -145,6 +139,15 @@ class BookingStoreFactory(private val storeFactory: StoreFactory) : KoinComponen ) ) } + + fun checkBusy(state: BookingStore.State) = scope.launch { + dispatch( + Message.UpdateBusy( + !checkBookingUseCase(state.toEvent()), + checkBookingUseCase.busyEvent(state.toEvent()) ?: EventInfo.emptyEvent + ) + ) + } } private fun BookingStore.State.toEvent(): EventInfo { -- GitLab From 3f0750566898037cbe2405286ab2101c2d3e5b52 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Tue, 11 Jul 2023 17:54:53 +0600 Subject: [PATCH 53/63] [~] fix after merge --- tabletApp/features/core/build.gradle.kts | 3 --- .../office/tablet/domain/model/EventInfo.kt | 4 ++-- .../BookingRoomComponent.kt | 9 +++------ .../ui/mainScreen/mainScreen/MainComponent.kt | 3 ++- .../office/tablet/domain/model/Booking.kt | 6 ------ .../office/tablet/domain/model/EventInfo.kt | 18 ------------------ .../kotlin/band/effective/office/tablet/App.kt | 2 +- .../effective/office/tablet/ui/root/Root.kt | 3 --- 8 files changed, 8 insertions(+), 40 deletions(-) delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt delete mode 100644 tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt diff --git a/tabletApp/features/core/build.gradle.kts b/tabletApp/features/core/build.gradle.kts index e369b8ae..b4db953e 100644 --- a/tabletApp/features/core/build.gradle.kts +++ b/tabletApp/features/core/build.gradle.kts @@ -6,9 +6,6 @@ plugins { android { compileSdk = 33 } -dependencies { - implementation("androidx.slice:slice-view:1.0.0") -} kotlin { android { diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt index f228f4fa..888fea56 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt @@ -3,7 +3,7 @@ package band.effective.office.tablet.domain.model import java.util.Calendar import java.util.GregorianCalendar -/*data class EventInfo( +data class EventInfo( val startTime: Calendar, val finishTime: Calendar, val organizer: String @@ -15,4 +15,4 @@ import java.util.GregorianCalendar organizer = "" ) } -}*/ +} diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt index b79a55c9..8f8bdb48 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/bookingRoomComponents/BookingRoomComponent.kt @@ -10,18 +10,15 @@ import com.arkivanov.mvikotlin.core.store.StoreFactory import com.arkivanov.mvikotlin.extensions.coroutines.stateFlow import kotlinx.coroutines.ExperimentalCoroutinesApi import kotlinx.coroutines.delay -import kotlinx.coroutines.flow.MutableStateFlow -import kotlinx.coroutines.flow.asStateFlow -import kotlinx.coroutines.flow.update import kotlinx.coroutines.launch -import org.koin.core.component.KoinComponent import java.util.Calendar import java.util.GregorianCalendar class BookingRoomComponent( private val componentContext: ComponentContext, storeFactory: StoreFactory, - private val onCurrentBookingRoom: () -> Unit + private val onCurrentBookingRoom: () -> Unit, + private val onBookingOtherRoom: () -> Unit ) : ComponentContext by componentContext { @@ -50,7 +47,7 @@ class BookingRoomComponent( } fun bookingOtherRoom(){ - + onBookingOtherRoom() } diff --git a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt index 24eba435..6083a5ff 100644 --- a/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt +++ b/tabletApp/features/roomInfo/src/commonMain/kotlin/band/effective/office/tablet/ui/mainScreen/mainScreen/MainComponent.kt @@ -27,7 +27,8 @@ class MainComponent( val bookingRoomComponent: BookingRoomComponent = BookingRoomComponent( componentContext = childContext(key = "bookingRoom"), onCurrentBookingRoom = { mainStore.accept(MainStore.Intent.OnBookingCurrentRoomRequest) }, - storeFactory = storeFactory + storeFactory = storeFactory, + onBookingOtherRoom = { OnSelectOtherRoomRequest() } ) val selectRoomComponent: RealSelectRoomComponent = RealSelectRoomComponent( diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt deleted file mode 100644 index 91345394..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/Booking.kt +++ /dev/null @@ -1,6 +0,0 @@ -package band.effective.office.tablet.domain.model - -data class Booking( - val nameRoom: String, - val eventInfo: EventInfo -) \ No newline at end of file diff --git a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt b/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt deleted file mode 100644 index 65fbcc91..00000000 --- a/tabletApp/features/selectRoom/src/commonMain/kotlin/band/effective/office/tablet/domain/model/EventInfo.kt +++ /dev/null @@ -1,18 +0,0 @@ -package band.effective.office.tablet.domain.model - -import java.util.Calendar -import java.util.GregorianCalendar - -data class EventInfo( - val startTime: Calendar, - val finishTime: Calendar, - val organizer: String -){ - companion object{ - val emptyEvent = EventInfo( - startTime = GregorianCalendar(), - finishTime = GregorianCalendar(), - organizer = "" - ) - } -} \ No newline at end of file diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt index a7099ce3..8d9baa50 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/App.kt @@ -1,9 +1,9 @@ package band.effective.office.tablet +import androidx.compose.material.MaterialTheme import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.root.Root import band.effective.office.tablet.ui.root.RootComponent -import band.effective.office.tablet.ui.theme.AppTheme import com.arkivanov.decompose.ComponentContext import com.arkivanov.mvikotlin.core.store.StoreFactory diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt index 22ee0310..3faad3de 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt +++ b/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/root/Root.kt @@ -3,10 +3,7 @@ package band.effective.office.tablet.ui.root import androidx.compose.runtime.Composable import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen import band.effective.office.tablet.ui.mainScreen.mainScreen.MainScreen -import band.effective.office.tablet.ui.freeNegotiationsScreen.FreeNegotiationsScreen -import band.effective.office.tablet.ui.mainScreen.MainScreen import com.arkivanov.decompose.extensions.compose.jetbrains.stack.Children -import band.effective.office.tablet.ui.selectRoomScreen.SelectRoomScreen @Composable fun Root(component: RootComponent) { -- GitLab From f0df6f42558cfb7120fc2d0e2c80bdfdbea7ab01 Mon Sep 17 00:00:00 2001 From: Maksim Mishenko Date: Wed, 12 Jul 2023 15:39:30 +0600 Subject: [PATCH 54/63] [~] move theme in core module --- tabletApp/features/core/build.gradle.kts | 4 ++++ .../effective/office/tablet/ui/theme/Color.kt | 0 .../effective/office/tablet/ui/theme/Theme.kt | 20 +++++++++---------- .../office/tablet/ui/theme/Typography.kt | 0 4 files changed, 14 insertions(+), 10 deletions(-) rename tabletApp/{ => features/core}/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt (100%) rename tabletApp/{ => features/core}/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt (72%) rename tabletApp/{ => features/core}/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt (100%) diff --git a/tabletApp/features/core/build.gradle.kts b/tabletApp/features/core/build.gradle.kts index b4db953e..ed500774 100644 --- a/tabletApp/features/core/build.gradle.kts +++ b/tabletApp/features/core/build.gradle.kts @@ -1,4 +1,7 @@ +import Dependencies.Versions.compose + plugins { + id(Plugins.MultiplatformCompose.plugin) id(Plugins.AndroidLib.plugin) id(Plugins.Kotlin.plugin) } @@ -19,6 +22,7 @@ kotlin { sourceSets { val commonMain by getting { dependencies { + implementation(compose.material) } } } diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt similarity index 100% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt similarity index 72% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt index a255765e..5be05697 100644 --- a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -8,11 +8,11 @@ import androidx.compose.material.lightColors import androidx.compose.runtime.Composable private val darkColors = darkColors( - primary = md_theme_dark_primary, - secondary = md_theme_dark_secondary, - background = md_theme_dark_background, - surface = md_theme_dark_surface, - onError = md_theme_dark_onError, + primary = band.effective.office.tablet.ui.theme.md_theme_dark_primary, + secondary = band.effective.office.tablet.ui.theme.md_theme_dark_secondary, + background = band.effective.office.tablet.ui.theme.md_theme_dark_background, + surface = band.effective.office.tablet.ui.theme.md_theme_dark_surface, + onError = band.effective.office.tablet.ui.theme.md_theme_dark_onError, ) object CustomDarkColors { @@ -30,11 +30,11 @@ object CustomDarkColors { } private val lightColors = lightColors( - primary = md_theme_light_primary, - secondary = md_theme_light_secondary, - background = md_theme_light_background, - surface = md_theme_light_surface, - onError = md_theme_light_onError, + primary = band.effective.office.tablet.ui.theme.md_theme_light_primary, + secondary = band.effective.office.tablet.ui.theme.md_theme_light_secondary, + background = band.effective.office.tablet.ui.theme.md_theme_light_background, + surface = band.effective.office.tablet.ui.theme.md_theme_light_surface, + onError = band.effective.office.tablet.ui.theme.md_theme_light_onError, ) object CustomLightColors { diff --git a/tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt similarity index 100% rename from tabletApp/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt rename to tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Typography.kt -- GitLab From 7a4465fc7449e0736e93cb30fae4e07cbc4cd61d Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:57:46 +0600 Subject: [PATCH 55/63] [Feature] Added a theme to your screen --- tabletApp/features/freeNegotiationsScreen/build.gradle.kts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts index f3da50b5..3af81992 100644 --- a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts +++ b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts @@ -8,6 +8,9 @@ plugins { android { compileSdk = 33 } +dependencies { + implementation(project(mapOf("path" to ":tabletApp:features:core"))) +} kotlin { android { -- GitLab From de493be291aa6f81fd7493e7c7c344a253bf1d64 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 13 Jul 2023 17:59:16 +0600 Subject: [PATCH 56/63] [Feature] Added colors --- .../kotlin/band/effective/office/tablet/ui/theme/Color.kt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt index a6df49d1..280662f9 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Color.kt @@ -18,6 +18,8 @@ internal val md_theme_dark_secondaryTextAndIcon = Color(0xFF7F7F7F) internal val md_theme_dark_tertiaryTextAndIcon = Color(0xFF777777) internal val md_theme_dark_pressedPrimaryButton = Color(0xFFEC6521) internal val md_theme_dark_disabledPrimaryButton = Color(0xFF342C28) +internal val md_theme_dark_iconAndText = Color(0xFFFA362F8) +internal val md_theme_dark_primaryCard = Color(0xFFF3A3736) internal val md_theme_light_primary = Color(0xFFE55A0F) -- GitLab From 5a8d07ac5cece097be5c52132ca3b62151a1315d Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 13 Jul 2023 18:00:20 +0600 Subject: [PATCH 57/63] [Feature] Added colors to the theme --- .../kotlin/band/effective/office/tablet/ui/theme/Theme.kt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt index 5be05697..9829b244 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -20,6 +20,10 @@ object CustomDarkColors { val mountainBackground = md_theme_dark_mountainBackground val busyStatus = md_theme_dark_busyStatus val freeStatus = md_theme_dark_freeStatus + val background = md_theme_dark_background + val surface = md_theme_dark_surface + val primaryCard = md_theme_dark_primaryCard + val iconAndText = md_theme_dark_iconAndText val onSuccess = md_theme_dark_onSuccess val secondaryButton = md_theme_dark_secondaryButton val primaryTextAndIcon = md_theme_dark_primaryTextAndIcon -- GitLab From 3a80c2db520655b607ab96c990de6a1907b30c6c Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Thu, 13 Jul 2023 18:03:40 +0600 Subject: [PATCH 58/63] [Feature] Added dark theme colors to the screen --- .../effective/office/tablet/ui/theme/Theme.kt | 1 + .../FreeNegotiationsScreen.kt | 18 ++++++-------- .../components/RoomCard.kt | 24 +++++++------------ .../components/Room\320\241haracteristics.kt" | 12 ++++------ 4 files changed, 20 insertions(+), 35 deletions(-) diff --git a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt index 9829b244..426e1a20 100644 --- a/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt +++ b/tabletApp/features/core/src/commonMain/kotlin/band/effective/office/tablet/ui/theme/Theme.kt @@ -22,6 +22,7 @@ object CustomDarkColors { val freeStatus = md_theme_dark_freeStatus val background = md_theme_dark_background val surface = md_theme_dark_surface + val primary = md_theme_dark_primary val primaryCard = md_theme_dark_primaryCard val iconAndText = md_theme_dark_iconAndText val onSuccess = md_theme_dark_onSuccess diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 19d8bc10..db2b0720 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -16,17 +16,16 @@ import androidx.compose.foundation.rememberScrollState import androidx.compose.foundation.verticalScroll import androidx.compose.material.Icon import androidx.compose.material.IconButton +import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.material.icons.Icons import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import band.effective.office.tablet.ui.freeNegotiationsScreen.components.RoomCard +import band.effective.office.tablet.ui.theme.CustomDarkColors @Composable @@ -52,7 +51,7 @@ internal fun FreeNegotiationsContent( Column( modifier = Modifier .fillMaxSize() - .background(Color(0XFF1E1C1A)) + .background(CustomDarkColors.background) .verticalScroll( rememberScrollState() ) @@ -61,7 +60,7 @@ internal fun FreeNegotiationsContent( modifier = Modifier .fillMaxWidth() .height(100.dp) - .background(Color(0xFFF252322)), + .background(CustomDarkColors.surface), verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.Start ) { @@ -71,20 +70,17 @@ internal fun FreeNegotiationsContent( Icon( Icons.Filled.ArrowBack, contentDescription = null, - tint = Color(0xFFFA362F8) + tint = CustomDarkColors.iconAndText ) } } Spacer(modifier = Modifier.width(4.dp)) Text( text = "Занять $date с $timeStart до $timeEnd", - style = TextStyle( - color = Color(0xFFFA362F8), - fontSize = 20.sp - ) + style = MaterialTheme.typography.h6.copy(color = CustomDarkColors.iconAndText) ) } - FlowRow(modifier = Modifier.padding(24.dp)) { + FlowRow(modifier = Modifier.padding(24.dp), horizontalArrangement = Arrangement.Center) { for (room in component.rooms) { RoomCard( roomItem = room, diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index f5b83a4f..325e2f0e 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -13,14 +13,14 @@ import androidx.compose.foundation.shape.RoundedCornerShape import androidx.compose.material.Button import androidx.compose.material.ButtonDefaults import androidx.compose.material.Card +import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem +import band.effective.office.tablet.ui.theme.CustomDarkColors @OptIn(ExperimentalLayoutApi::class) @Composable @@ -34,15 +34,12 @@ fun RoomCard( modifier = Modifier .fillMaxWidth().height(288.dp), shape = RoundedCornerShape(16.dp), - backgroundColor = Color(0xFFF3A3736) + backgroundColor = CustomDarkColors.primaryCard ) { Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { Text( text = roomItem.name, - style = TextStyle( - color = Color.White, - fontSize = 48.sp - ) + style = MaterialTheme.typography.h2.copy(Color.White) ) Spacer(modifier = Modifier.height(28.dp)) FlowRow( @@ -64,21 +61,16 @@ fun RoomCard( Button( onClick = { onClick() }, modifier = Modifier - .border(2.dp, shape = RoundedCornerShape(40.dp), color = Color(0xFFFEF7234)) - .fillMaxWidth(), + .border(2.dp, shape = RoundedCornerShape(40.dp), color = CustomDarkColors.primary) + .fillMaxWidth().height(64.dp), shape = RoundedCornerShape(40.dp), colors = ButtonDefaults.buttonColors( - backgroundColor = Color( - 0xFFFF1E1C1A - ) + backgroundColor = CustomDarkColors.background ) ) { Text( text = "Занять ${roomItem.name}", - style = TextStyle( - color = Color(0xFFFEF7234), - fontSize = 18.sp - ) + style = MaterialTheme.typography.subtitle1.copy(color = CustomDarkColors.primaryCard) ) } Spacer(modifier = Modifier.height(16.dp)) diff --git "a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index a175a241..5d3ba0c3 100644 --- "a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -5,15 +5,14 @@ import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.size import androidx.compose.foundation.layout.width import androidx.compose.material.Icon +import androidx.compose.material.MaterialTheme import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.vector.ImageVector -import androidx.compose.ui.text.TextStyle import androidx.compose.ui.unit.dp -import androidx.compose.ui.unit.sp +import band.effective.office.tablet.ui.theme.CustomDarkColors @Composable fun RoomCharacteristics(icon: ImageVector, text: String) { @@ -21,16 +20,13 @@ fun RoomCharacteristics(icon: ImageVector, text: String) { Icon( imageVector = icon, contentDescription = null, - tint = Color.White, + tint = CustomDarkColors.primaryTextAndIcon, modifier = Modifier.size(30.dp) ) Spacer(modifier = Modifier.width(8.dp)) Text( text = text, - style = TextStyle( - color = Color.White, - fontSize = 16.sp - ) + style = MaterialTheme.typography.subtitle1.copy(color = CustomDarkColors.primaryTextAndIcon) ) } } \ No newline at end of file -- GitLab From b811db12d3e84be5fa52fee72eaa30d55eb615c0 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Fri, 14 Jul 2023 00:22:09 +0600 Subject: [PATCH 59/63] [Feature] Added libres --- .../freeNegotiationsScreen/build.gradle.kts | 36 ++++++++++++++++--- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts index 3af81992..ac41b56c 100644 --- a/tabletApp/features/freeNegotiationsScreen/build.gradle.kts +++ b/tabletApp/features/freeNegotiationsScreen/build.gradle.kts @@ -3,13 +3,15 @@ plugins { id(Plugins.MultiplatformCompose.plugin) id(Plugins.Kotlin.plugin) id(Plugins.Parcelize.plugin) + id(Plugins.Libres.plugin) } android { - compileSdk = 33 -} -dependencies { - implementation(project(mapOf("path" to ":tabletApp:features:core"))) + compileSdk = 33 + sourceSets["main"].apply { + res.srcDirs("src/androidMain/resources") + res.srcDir("build/generated/libres/android/resources") + } } kotlin { @@ -21,6 +23,7 @@ kotlin { } } + sourceSets { val commonMain by getting { dependencies { @@ -31,7 +34,32 @@ kotlin { // Decompose implementation(Dependencies.Decompose.decompose) implementation(Dependencies.Decompose.extensions) + + //Koin + api(Dependencies.Koin.core) + + //Libres + implementation(Dependencies.Libres.libresCompose) + + implementation(project(":tabletApp:features:core")) + } + } + + val androidMain by getting { + dependencies { + //Koin + api(Dependencies.Koin.android) } } } + + libres { + // https://github.com/Skeptick/libres#setup + generatedClassName = "MainRes" // "Res" by default + generateNamedArguments = true // false by default + baseLocaleLanguageCode = "ru" // "en" by default + camelCaseNamesForAppleFramework = true // false by default + + } + } -- GitLab From 6104676f0b25ac0b3c62235d4c787770eb8333a6 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Fri, 14 Jul 2023 00:22:39 +0600 Subject: [PATCH 60/63] [Feature] Added icon and strings --- .../src/commonMain/libres/images/arrow_to_left.svg | 3 +++ .../src/commonMain/libres/strings/strings_ru.xml | 6 ++++++ 2 files changed, 9 insertions(+) create mode 100644 tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/images/arrow_to_left.svg create mode 100644 tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/strings/strings_ru.xml diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/images/arrow_to_left.svg b/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/images/arrow_to_left.svg new file mode 100644 index 00000000..f7f61fc2 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/images/arrow_to_left.svg @@ -0,0 +1,3 @@ + + + diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/strings/strings_ru.xml b/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/strings/strings_ru.xml new file mode 100644 index 00000000..2f516587 --- /dev/null +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/libres/strings/strings_ru.xml @@ -0,0 +1,6 @@ + + + Занять + с + до + \ No newline at end of file -- GitLab From 7682973de2a11392ac41f2dc19f5dbc3e726407f Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Fri, 14 Jul 2023 00:23:49 +0600 Subject: [PATCH 61/63] [Refactor] Fixed colors and fonts --- .../FreeNegotiationsComponent.kt | 14 +++--- .../FreeNegotiationsScreen.kt | 46 ++++++++++++------- .../components/RoomCard.kt | 38 ++++++++++----- .../components/Room\320\241haracteristics.kt" | 6 ++- 4 files changed, 67 insertions(+), 37 deletions(-) diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt index 70b6caf5..b4d1d55a 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsComponent.kt @@ -16,23 +16,23 @@ class FreeNegotiationsComponent( stuff = listOf( RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ), RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ), RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ), RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ), RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ) ) ), @@ -41,7 +41,7 @@ class FreeNegotiationsComponent( stuff = listOf( RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ) ) ), @@ -50,7 +50,7 @@ class FreeNegotiationsComponent( stuff = listOf( RoomCharacteristicsItem( icon = Icons.Default.Person, - text = "5" + text = "5 человек" ) ) ), diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index db2b0720..8beae154 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -18,12 +18,14 @@ import androidx.compose.material.Icon import androidx.compose.material.IconButton import androidx.compose.material.MaterialTheme import androidx.compose.material.Text -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.filled.ArrowBack import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.res.vectorResource +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import band.effective.office.tablet.features.freeNegotiationsScreen.MainRes import band.effective.office.tablet.ui.freeNegotiationsScreen.components.RoomCard import band.effective.office.tablet.ui.theme.CustomDarkColors @@ -59,16 +61,16 @@ internal fun FreeNegotiationsContent( Row( modifier = Modifier .fillMaxWidth() - .height(100.dp) + .height(130.dp) .background(CustomDarkColors.surface), - verticalAlignment = Alignment.CenterVertically, + verticalAlignment = Alignment.Bottom, horizontalArrangement = Arrangement.Start ) { - Spacer(modifier = Modifier.height(60.dp)) + Spacer(modifier = Modifier.height(22.dp)) IconButton(onClick = { onClick() }) { - Row(verticalAlignment = Alignment.CenterVertically) { + Row(modifier = Modifier.padding(bottom = 22.dp)) { Icon( - Icons.Filled.ArrowBack, + imageVector = ImageVector.vectorResource(MainRes.image.arrow_to_left), contentDescription = null, tint = CustomDarkColors.iconAndText ) @@ -76,18 +78,28 @@ internal fun FreeNegotiationsContent( } Spacer(modifier = Modifier.width(4.dp)) Text( - text = "Занять $date с $timeStart до $timeEnd", - style = MaterialTheme.typography.h6.copy(color = CustomDarkColors.iconAndText) + modifier = Modifier.padding(bottom = 22.dp), + text = "${MainRes.string.occupy} $date ${MainRes.string.with} " + + " $timeStart ${MainRes.string.before} $timeEnd", + style = MaterialTheme.typography.h6.copy( + color = CustomDarkColors.iconAndText, + fontWeight = FontWeight.Medium + ) ) } - FlowRow(modifier = Modifier.padding(24.dp), horizontalArrangement = Arrangement.Center) { - for (room in component.rooms) { - RoomCard( - roomItem = room, - onClick = {}, - modifier = Modifier.fillMaxWidth(0.3F) - ) - Spacer(modifier = Modifier.width(24.dp)) + Row(modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.Center) { + FlowRow( + modifier = Modifier.padding(26.dp), + horizontalArrangement = Arrangement.Center + ) { + for (room in component.rooms) { + RoomCard( + roomItem = room, + onClick = {}, + modifier = Modifier.fillMaxWidth(0.32F) + ) + Spacer(modifier = Modifier.width(24.dp)) + } } } } diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt index 325e2f0e..c3ec2d65 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/RoomCard.kt @@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.ExperimentalLayoutApi import androidx.compose.foundation.layout.FlowRow +import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height @@ -18,7 +19,9 @@ import androidx.compose.material.Text import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp +import band.effective.office.tablet.features.freeNegotiationsScreen.MainRes import band.effective.office.tablet.ui.freeNegotiationsScreen.models.RoomItem import band.effective.office.tablet.ui.theme.CustomDarkColors @@ -39,19 +42,27 @@ fun RoomCard( Column(modifier = Modifier.padding(16.dp).fillMaxWidth()) { Text( text = roomItem.name, - style = MaterialTheme.typography.h2.copy(Color.White) + style = MaterialTheme.typography.h2.copy( + Color.White, + fontWeight = FontWeight.Medium + ) ) Spacer(modifier = Modifier.height(28.dp)) - FlowRow( - horizontalArrangement = Arrangement.spacedBy(16.dp), - modifier = Modifier.padding(horizontal = 32.dp, vertical = 28.dp), - maxItemsInEachRow = 2 + Row( + modifier = Modifier.fillMaxWidth(), + horizontalArrangement = Arrangement.SpaceBetween ) { - for (stuff in roomItem.stuff) { - RoomCharacteristics( - icon = stuff.icon, - text = stuff.text - ) + FlowRow( + horizontalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.padding(horizontal = 32.dp, vertical = 28.dp), + maxItemsInEachRow = 2 + ) { + for (stuff in roomItem.stuff) { + RoomCharacteristics( + icon = stuff.icon, + text = stuff.text + ) + } } } Spacer(modifier = Modifier.height(50.dp)) @@ -69,8 +80,11 @@ fun RoomCard( ) ) { Text( - text = "Занять ${roomItem.name}", - style = MaterialTheme.typography.subtitle1.copy(color = CustomDarkColors.primaryCard) + text = "${MainRes.string.occupy} ${roomItem.name}", + style = MaterialTheme.typography.subtitle1.copy( + color = CustomDarkColors.primary, + fontWeight = FontWeight.Medium + ) ) } Spacer(modifier = Modifier.height(16.dp)) diff --git "a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" index 5d3ba0c3..ed002c4a 100644 --- "a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" +++ "b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/components/Room\320\241haracteristics.kt" @@ -11,6 +11,7 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.unit.dp import band.effective.office.tablet.ui.theme.CustomDarkColors @@ -26,7 +27,10 @@ fun RoomCharacteristics(icon: ImageVector, text: String) { Spacer(modifier = Modifier.width(8.dp)) Text( text = text, - style = MaterialTheme.typography.subtitle1.copy(color = CustomDarkColors.primaryTextAndIcon) + style = MaterialTheme.typography.subtitle1.copy( + color = CustomDarkColors.primaryTextAndIcon, + fontWeight = FontWeight.Medium + ) ) } } \ No newline at end of file -- GitLab From 9d0cba4621f05ff09cb8d77c084fd83f158efcfe Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Fri, 14 Jul 2023 00:26:30 +0600 Subject: [PATCH 62/63] [Fix] Changed the type to a String --- .../tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index 8beae154..e2e9663e 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -44,7 +44,7 @@ fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { @OptIn(ExperimentalLayoutApi::class) @Composable internal fun FreeNegotiationsContent( - date: String?, + date: String, timeStart: String?, timeEnd: String?, onClick: () -> Unit, -- GitLab From 48d607a63c8de3a2ada32ba082e8ed9388000200 Mon Sep 17 00:00:00 2001 From: Liker4ik26 <104251391+Liker4ik26@users.noreply.github.com> Date: Fri, 14 Jul 2023 00:44:44 +0600 Subject: [PATCH 63/63] [Fix] Changed the type to a String --- .../ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt index e2e9663e..c264ffb5 100644 --- a/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt +++ b/tabletApp/features/freeNegotiationsScreen/src/commonMain/kotlin/band/effective/office/tablet/ui/freeNegotiationsScreen/FreeNegotiationsScreen.kt @@ -45,8 +45,8 @@ fun FreeNegotiationsScreen(component: FreeNegotiationsComponent) { @Composable internal fun FreeNegotiationsContent( date: String, - timeStart: String?, - timeEnd: String?, + timeStart: String, + timeEnd: String, onClick: () -> Unit, component: FreeNegotiationsComponent ) { -- GitLab