Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Screens/schedule #248

Draft
wants to merge 2 commits into
base: screens/settings
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ compose-android = "1.7.6"
compose-multiplatform = "1.8.0-alpha02"
compose-hot-reload = "1.0.0-dev.32.1"

coroutines = "1.10.1"
coil = "3.0.3"
exposed = "0.55.0"
h2 = "2.2.224"
Expand All @@ -30,6 +31,7 @@ logbackClassic = "1.5.6"
markdown = "0.29.0"
postgresql = "42.7.3"
androidx-navigation = "2.8.0-alpha12"
doistx-normalize = "1.0.5"

[libraries]

Expand Down Expand Up @@ -87,8 +89,10 @@ ktor-server-status-pages = { module = "io.ktor:ktor-server-status-pages", versio
ktor-server-swagger = { module = "io.ktor:ktor-server-swagger", version.ref = "ktor" }

# utility
kotlinx-coroutines-swing = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-swing", version.ref = "coroutines" }
kotlinx-datetime = { module = "org.jetbrains.kotlinx:kotlinx-datetime", version.ref = "kotlinx-datetime" }
logback-classic = { module = "ch.qos.logback:logback-classic", version.ref = "logbackClassic" }
doistx-normalize = { module = "com.doist.x:normalize", version.ref = "doistx-normalize" }

# images
android-svg = { module = "com.caverock:androidsvg-aar", version.ref = "android-svg" }
Expand Down
49 changes: 35 additions & 14 deletions shared/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ plugins {
kotlin {
androidTarget {
compilerOptions {
freeCompilerArgs.addAll("-P", "plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=org.jetbrains.kotlinconf.ui.components.zoomable.internal.AndroidParcelize")
freeCompilerArgs.addAll(
"-P",
"plugin:org.jetbrains.kotlin.parcelize:additionalAnnotation=org.jetbrains.kotlinconf.ui.components.zoomable.internal.AndroidParcelize"
)
}
}

Expand Down Expand Up @@ -82,23 +85,41 @@ kotlin {
implementation(kotlin("test"))
}

androidMain.dependencies {
implementation(libs.android.svg)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.work.runtime)
implementation(libs.androidx.preference)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.ktor.client.okhttp)
val nonWebMain by creating {
dependsOn(commonMain.get())
dependencies {
// TODO move this to commonMain once Wasm version is available
implementation(libs.doistx.normalize)
}
}

iosMain.dependencies {
implementation(libs.ktor.client.darwin)
androidMain {
dependsOn(nonWebMain)
dependencies {
implementation(libs.android.svg)
implementation(libs.androidx.core.ktx)
implementation(libs.androidx.work.runtime)
implementation(libs.androidx.preference)
implementation(libs.compose.ui.tooling.preview)
implementation(libs.ktor.client.okhttp)
}
}

jvmMain.dependencies {
implementation(libs.ktor.client.okhttp)
implementation(compose.desktop.currentOs)
implementation(libs.android.svg)
iosMain {
dependsOn(nonWebMain)
dependencies {
implementation(libs.ktor.client.darwin)
}
}

jvmMain {
dependsOn(nonWebMain)
dependencies {
implementation(libs.ktor.client.okhttp)
implementation(compose.desktop.currentOs)
implementation(libs.android.svg)
implementation(libs.kotlinx.coroutines.swing)
}
}

val webMain by creating {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,14 @@ class ConferenceService(
* Get current time synchronized with server.
*/
private fun now(): GMTDate {
return GMTDate() + (serverTime.timestamp - requestTime.timestamp)
return GMTDate(
seconds = 0,
minutes = 0,
hours = 14, // 2 PM
dayOfMonth = 23,
month = Month.MAY,
year = 2024
)
}

override fun close() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ fun List<Session>.groupByTime(
val isBreak = cards.all { it.isBreak }
val isLunch = cards.all { it.isLunch }
val isParty = cards.all { it.isParty }
val isLive = start <= now && now < end
val isLive = start.dayOfMonth == 22 && start.hours == 14 && start.month.ordinal == 4
val isFinished = end <= now

TimeSlot(start, end, isLive, isFinished, cards, isBreak, isLunch, isParty)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,8 @@ fun MainScreen(
)
}
composable<ScheduleScreen> {
Schedule(
service.agenda.collectAsState().value,
onBack = { rootNavController.popBackStack() },
ScheduleScreen(
service = service,
onSession = { rootNavController.navigate(TalkDetailsScreen(it)) },
)
}
Expand Down

This file was deleted.

Loading