diff --git a/android/src/main/java/co/touchlab/droidcon/android/MainActivity.kt b/android/src/main/java/co/touchlab/droidcon/android/MainActivity.kt index 2fb3dab9..a5c4e27b 100644 --- a/android/src/main/java/co/touchlab/droidcon/android/MainActivity.kt +++ b/android/src/main/java/co/touchlab/droidcon/android/MainActivity.kt @@ -44,7 +44,9 @@ import org.brightify.hyperdrive.multiplatformx.LifecycleGraph import org.koin.core.component.KoinComponent import org.koin.core.component.inject -class MainActivity : ComponentActivity(), KoinComponent { +class MainActivity : + ComponentActivity(), + KoinComponent { private val notificationSchedulingService: NotificationSchedulingService by inject() private val syncService: SyncService by inject() diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/settings/SettingsView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/settings/SettingsView.kt index 512559e0..5a2bfb0e 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/settings/SettingsView.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/settings/SettingsView.kt @@ -47,7 +47,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) { if (Constants.SisterApp.showLaunchButton) { PlatformSwitchApp() } - } + }, ) }, ) { paddingValues -> @@ -56,7 +56,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) { modifier = Modifier .padding(top = paddingValues.calculateTopPadding()) .fillMaxHeight() - .verticalScroll(scrollState) + .verticalScroll(scrollState), ) { IconTextSwitchRow( text = "Enable feedback", @@ -82,11 +82,7 @@ internal fun SettingsView(viewModel: SettingsViewModel) { } @Composable -internal fun IconTextSwitchRow( - text: String, - image: ImageVector, - checked: MutableObservableProperty -) { +internal fun IconTextSwitchRow(text: String, image: ImageVector, checked: MutableObservableProperty) { val isChecked by checked.observeAsState() Row( modifier = Modifier diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt index fc811a31..fdd3ae68 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/ApplicationViewModel.kt @@ -26,7 +26,8 @@ class ApplicationViewModel( private val notificationService: NotificationService, private val feedbackService: FeedbackService, private val settingsGateway: SettingsGateway, -) : BaseViewModel(), DeepLinkNotificationHandler { +) : BaseViewModel(), + DeepLinkNotificationHandler { val schedule by managed(scheduleFactory.create()) val agenda by managed(agendaFactory.create()) @@ -52,7 +53,7 @@ class ApplicationViewModel( Tab.MyAgenda, if (Constants.showVenueMap) Tab.Venue else null, Tab.Sponsors, - Tab.Settings + Tab.Settings, ) var selectedTab: Tab by published(Tab.Schedule) val observeSelectedTab by observe(::selectedTab) diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutViewModel.kt index a10da475..ffc99102 100644 --- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutViewModel.kt +++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutViewModel.kt @@ -5,10 +5,7 @@ import co.touchlab.droidcon.application.repository.AboutRepository import co.touchlab.droidcon.service.ParseUrlViewService import org.brightify.hyperdrive.multiplatformx.BaseViewModel -class AboutViewModel( - private val aboutRepository: AboutRepository, - private val parseUrlViewService: ParseUrlViewService -) : BaseViewModel() { +class AboutViewModel(private val aboutRepository: AboutRepository, private val parseUrlViewService: ParseUrlViewService) : BaseViewModel() { var items: List by published(emptyList()) private set diff --git a/shared/src/androidMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.android.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.android.kt index 6c0d3d7d..ec752fdd 100644 --- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.android.kt +++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.android.kt @@ -5,10 +5,6 @@ import app.cash.sqldelight.db.SqlDriver import app.cash.sqldelight.driver.android.AndroidSqliteDriver import co.touchlab.droidcon.db.DroidconDatabase -actual class SqlDelightDriverFactory( - private val context: Context, -) { - actual fun createDriver(): SqlDriver { - return AndroidSqliteDriver(DroidconDatabase.Schema, context, "new-droidcon2024.db") - } +actual class SqlDelightDriverFactory(private val context: Context) { + actual fun createDriver(): SqlDriver = AndroidSqliteDriver(DroidconDatabase.Schema, context, "new-droidcon2024.db") } diff --git a/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/NotificationRescheduler.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/NotificationRescheduler.kt index 593cb0d5..ab6cf9f0 100644 --- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/NotificationRescheduler.kt +++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/NotificationRescheduler.kt @@ -9,7 +9,9 @@ import kotlinx.coroutines.launch import org.koin.core.component.KoinComponent import org.koin.core.component.inject -class NotificationRescheduler : BroadcastReceiver(), KoinComponent { +class NotificationRescheduler : + BroadcastReceiver(), + KoinComponent { private val notificationSchedulingService by inject() override fun onReceive(context: Context?, intent: Intent?) { diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt index af9b0f66..345a4e62 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt @@ -2,6 +2,7 @@ package co.touchlab.droidcon import kotlinx.datetime.TimeZone +@Suppress("ktlint:standard:property-naming") object Constants { val conferenceTimeZone = TimeZone.of("Europe/London") diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Sponsor.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Sponsor.kt index 7557a0b3..1bf0d84f 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Sponsor.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Sponsor.kt @@ -2,13 +2,8 @@ package co.touchlab.droidcon.domain.entity import co.touchlab.droidcon.composite.Url -class Sponsor( - override val id: Id, - val hasDetail: Boolean, - val description: String?, - val icon: Url, - val url: Url -) : DomainEntity() { +class Sponsor(override val id: Id, val hasDetail: Boolean, val description: String?, val icon: Url, val url: Url) : + DomainEntity() { val name: String get() = id.name diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightProfileRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightProfileRepository.kt index aefb1039..3077042a 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightProfileRepository.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightProfileRepository.kt @@ -19,7 +19,8 @@ class SqlDelightProfileRepository( private val profileQueries: ProfileQueries, private val speakerQueries: SessionSpeakerQueries, private val representativeQueries: SponsorRepresentativeQueries, -) : BaseRepository(), ProfileRepository { +) : BaseRepository(), + ProfileRepository { override suspend fun getSpeakersBySession(id: Session.Id): List = profileQueries.selectBySession(id.value, ::profileFactory).executeAsList() diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightRoomRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightRoomRepository.kt index 50e532d3..271ef264 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightRoomRepository.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightRoomRepository.kt @@ -10,7 +10,9 @@ import co.touchlab.droidcon.domain.repository.RoomRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow -class SqlDelightRoomRepository(private val roomQueries: RoomQueries) : BaseRepository(), RoomRepository { +class SqlDelightRoomRepository(private val roomQueries: RoomQueries) : + BaseRepository(), + RoomRepository { override fun allSync(): List = roomQueries.selectAll(::roomFactory).executeAsList() diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSessionRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSessionRepository.kt index e20f5cb3..24d5857b 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSessionRepository.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSessionRepository.kt @@ -14,10 +14,9 @@ import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.first import kotlinx.datetime.Instant -class SqlDelightSessionRepository( - private val dateTimeService: DateTimeService, - private val sessionQueries: SessionQueries -) : BaseRepository(), SessionRepository { +class SqlDelightSessionRepository(private val dateTimeService: DateTimeService, private val sessionQueries: SessionQueries) : + BaseRepository(), + SessionRepository { override fun observe(id: Session.Id): Flow = sessionQueries.sessionById(id.value, ::sessionFactory).asFlow().mapToOne(Dispatchers.Main) diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorGroupRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorGroupRepository.kt index cb48c203..145bb588 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorGroupRepository.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorGroupRepository.kt @@ -10,9 +10,9 @@ import co.touchlab.droidcon.domain.repository.SponsorGroupRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow -class SqlDelightSponsorGroupRepository( - private val sponsorGroupQueries: SponsorGroupQueries -) : BaseRepository(), SponsorGroupRepository { +class SqlDelightSponsorGroupRepository(private val sponsorGroupQueries: SponsorGroupQueries) : + BaseRepository(), + SponsorGroupRepository { override fun allSync(): List = sponsorGroupQueries.selectAll(::sponsorGroupFactory).executeAsList() diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorRepository.kt index c1937cce..9d95d8c1 100644 --- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorRepository.kt +++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightSponsorRepository.kt @@ -11,7 +11,9 @@ import co.touchlab.droidcon.domain.repository.SponsorRepository import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.flow.Flow -class SqlDelightSponsorRepository(private val sponsorQueries: SponsorQueries) : BaseRepository(), SponsorRepository { +class SqlDelightSponsorRepository(private val sponsorQueries: SponsorQueries) : + BaseRepository(), + SponsorRepository { override fun observe(id: Sponsor.Id): Flow = sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOne(Dispatchers.Main) diff --git a/shared/src/iosMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.ios.kt b/shared/src/iosMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.ios.kt index e9976814..01c4a01c 100644 --- a/shared/src/iosMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.ios.kt +++ b/shared/src/iosMain/kotlin/co/touchlab/droidcon/domain/repository/impl/SqlDelightDriverFactory.ios.kt @@ -5,7 +5,5 @@ import app.cash.sqldelight.driver.native.NativeSqliteDriver import co.touchlab.droidcon.db.DroidconDatabase actual class SqlDelightDriverFactory { - actual fun createDriver(): SqlDriver { - return NativeSqliteDriver(DroidconDatabase.Schema, "droidcon2024.db") - } + actual fun createDriver(): SqlDriver = NativeSqliteDriver(DroidconDatabase.Schema, "droidcon2024.db") }