diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 000000000..130cf2e07
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,24 @@
+root = true
+
+[*.{kt,kts}]
+end_of_line = lf
+ij_kotlin_packages_to_use_import_on_demand = true
+ij_kotlin_allow_trailing_comma = true
+ij_kotlin_allow_trailing_comma_on_call_site = true
+ij_kotlin_imports_layout = *
+ij_kotlin_indent_before_arrow_on_new_line = false
+ij_kotlin_line_break_after_multiline_when_entry = true
+indent_size = 4
+indent_style = space
+insert_final_newline = true
+parameter-list-wrapping = true
+ktlint_argument_list_wrapping_ignore_when_parameter_count_greater_or_equal_than = 8
+ktlint_chain_method_rule_force_multiline_when_chain_operator_count_greater_or_equal_than = 4
+ktlint_code_style = android_studio
+ktlint_enum_entry_name_casing = upper_or_camel_cases
+ktlint_function_naming_ignore_when_annotated_with = Composable
+ktlint_function_signature_body_expression_wrapping = default
+ktlint_ignore_back_ticked_identifier = false
+max_line_length = 140
+
+
diff --git a/.gitignore b/.gitignore
index 86fdc5392..1f139b6f6 100644
--- a/.gitignore
+++ b/.gitignore
@@ -38,17 +38,7 @@ captures/
*.iml
.gradle
/local.properties
-/.idea/caches
-/.idea/libraries
-/.idea/modules.xml
-/.idea/workspace.xml
-/.idea/navEditor.xml
-/.idea/assetWizardSettings.xml
-/.idea/encodings.xml
-.idea/saveactions_settings.xml
-.idea/deploymentTargetDropDown.xml
-.idea/gradle.xml
-.idea/misc.xml
+
.DS_Store
/build
/captures
@@ -87,8 +77,14 @@ GoogleService-Info.plist
GoogleService-Info.plist
Pods/
*.xcworkspace
-.idea/inspectionProfiles/profiles_settings.xml
-.idea/inspectionProfiles/Project_Default.xml
-.idea/dictionaries/matyas.xml
-/.idea/
.kotlin
+.idea/.name
+.idea/compiler.xml
+.idea/deploymentTargetSelector.xml
+.idea/gradle.xml
+.idea/kotlinc.xml
+.idea/misc.xml
+.idea/runConfigurations.xml
+.idea/vcs.xml
+.idea/workspace.xml
+.idea/caches/deviceStreaming.xml
diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml
new file mode 100644
index 000000000..6c0b91968
--- /dev/null
+++ b/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/codeStyles/codeStyleConfig.xml b/.idea/codeStyles/codeStyleConfig.xml
new file mode 100644
index 000000000..0f7bc519d
--- /dev/null
+++ b/.idea/codeStyles/codeStyleConfig.xml
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/.idea/inspectionProfiles/ktlint.xml b/.idea/inspectionProfiles/ktlint.xml
new file mode 100644
index 000000000..7d04a74be
--- /dev/null
+++ b/.idea/inspectionProfiles/ktlint.xml
@@ -0,0 +1,7 @@
+
+
+
+
+
+
+
diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml
new file mode 100644
index 000000000..64580d143
--- /dev/null
+++ b/.idea/inspectionProfiles/profiles_settings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index a4d91700a..8881129e3 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,9 +1,13 @@
-
-
-
+
-
+
+
+
+
@@ -36,11 +40,13 @@
-
+
+ android:name="co.touchlab.droidcon.android.service.impl.DefaultFirebaseMessagingService"
+ android:exported="false">
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 86e57adfd..a5c4e27b9 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()
@@ -56,7 +58,7 @@ class MainActivity : ComponentActivity(), KoinComponent {
private val root = LifecycleGraph.Root(this)
private val requestPermissionLauncher = registerForActivityResult(
- ActivityResultContracts.RequestPermission()
+ ActivityResultContracts.RequestPermission(),
) { isGranted: Boolean ->
}
@@ -103,12 +105,12 @@ class MainActivity : ComponentActivity(), KoinComponent {
modifier = Modifier
.background(Colors.primary)
.fillMaxSize(),
- contentAlignment = Alignment.Center
+ contentAlignment = Alignment.Center,
) {
Image(
painter = painterResource(id = R.drawable.ic_splash_screen),
contentDescription = getString(R.string.droidcon_title),
- modifier = Modifier.padding(32.dp)
+ modifier = Modifier.padding(32.dp),
)
}
}
diff --git a/android/src/main/java/co/touchlab/droidcon/android/MainApp.kt b/android/src/main/java/co/touchlab/droidcon/android/MainApp.kt
index c073066d7..538bfef59 100644
--- a/android/src/main/java/co/touchlab/droidcon/android/MainApp.kt
+++ b/android/src/main/java/co/touchlab/droidcon/android/MainApp.kt
@@ -50,7 +50,7 @@ class MainApp : Application() {
single {
AndroidAnalyticsService(firebaseAnalytics = Firebase.analytics)
}
- } + uiModule
+ } + uiModule,
)
}
}
diff --git a/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultFirebaseMessagingService.kt b/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultFirebaseMessagingService.kt
index 2fce49a75..8f19da9f5 100644
--- a/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultFirebaseMessagingService.kt
+++ b/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultFirebaseMessagingService.kt
@@ -10,7 +10,6 @@ import com.google.firebase.messaging.RemoteMessage
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.launch
import org.koin.android.ext.android.inject
-import org.koin.core.component.inject
class DefaultFirebaseMessagingService : FirebaseMessagingService() {
private val notificationService: AndroidNotificationService by inject()
@@ -22,10 +21,10 @@ class DefaultFirebaseMessagingService : FirebaseMessagingService() {
override fun onMessageReceived(message: RemoteMessage) {
super.onMessageReceived(message)
- if (message.data.isNotEmpty() && message.data[Notification.Keys.notificationType] == Notification.Values.refreshDataType) {
+ if (message.data.isNotEmpty() && message.data[Notification.Keys.NOTIFICATION_TYPE] == Notification.Values.REFRESH_DATA_TYPE) {
MainScope().launch {
notificationService.handleNotification(
- Notification.Remote.RefreshData
+ Notification.Remote.RefreshData,
)
}
}
diff --git a/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultParseUrlViewService.kt b/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultParseUrlViewService.kt
index 14d7e86d2..0824b44f6 100644
--- a/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultParseUrlViewService.kt
+++ b/android/src/main/java/co/touchlab/droidcon/android/service/impl/DefaultParseUrlViewService.kt
@@ -8,7 +8,5 @@ class DefaultParseUrlViewService : ParseUrlViewService {
private val urlRegex = Patterns.WEB_URL.toRegex()
- override fun parse(text: String): List {
- return urlRegex.findAll(text).map { WebLink(it.range, it.value) }.toList()
- }
+ override fun parse(text: String): List = urlRegex.findAll(text).map { WebLink(it.range, it.value) }.toList()
}
diff --git a/android/src/main/java/co/touchlab/droidcon/android/util/NotificationLocalizedStringFactory.kt b/android/src/main/java/co/touchlab/droidcon/android/util/NotificationLocalizedStringFactory.kt
index 96f07e388..41856c259 100644
--- a/android/src/main/java/co/touchlab/droidcon/android/util/NotificationLocalizedStringFactory.kt
+++ b/android/src/main/java/co/touchlab/droidcon/android/util/NotificationLocalizedStringFactory.kt
@@ -4,24 +4,16 @@ import android.content.Context
import co.touchlab.droidcon.R
import co.touchlab.droidcon.application.service.NotificationSchedulingService
-class NotificationLocalizedStringFactory(
- private val context: Context,
-) : NotificationSchedulingService.LocalizedStringFactory {
+class NotificationLocalizedStringFactory(private val context: Context) : NotificationSchedulingService.LocalizedStringFactory {
override fun reminderTitle(roomName: String?): String {
val ending = roomName?.let { context.getString(R.string.notification_reminder_title_in_room, it) } ?: ""
return context.getString(R.string.notification_reminder_title_base, ending)
}
- override fun reminderBody(sessionTitle: String): String {
- return context.getString(R.string.notification_reminder_body, sessionTitle)
- }
+ override fun reminderBody(sessionTitle: String): String = context.getString(R.string.notification_reminder_body, sessionTitle)
- override fun feedbackTitle(): String {
- return context.getString(R.string.notification_feedback_title)
- }
+ override fun feedbackTitle(): String = context.getString(R.string.notification_feedback_title)
- override fun feedbackBody(): String {
- return context.getString(R.string.notification_feedback_body)
- }
+ override fun feedbackBody(): String = context.getString(R.string.notification_feedback_body)
}
diff --git a/android/src/main/res/drawable-night/about_kotlin.xml b/android/src/main/res/drawable-night/about_kotlin.xml
index 40181fdf2..0d03ca44a 100644
--- a/android/src/main/res/drawable-night/about_kotlin.xml
+++ b/android/src/main/res/drawable-night/about_kotlin.xml
@@ -4,40 +4,45 @@
android:height="528dp"
android:viewportWidth="2435"
android:viewportHeight="528">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/src/main/res/drawable/about_kotlin.xml b/android/src/main/res/drawable/about_kotlin.xml
index dbe8bd541..18bed16fc 100644
--- a/android/src/main/res/drawable/about_kotlin.xml
+++ b/android/src/main/res/drawable/about_kotlin.xml
@@ -4,40 +4,45 @@
android:height="528dp"
android:viewportWidth="2435"
android:viewportHeight="528">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/android/src/main/res/drawable/ic_baseline_insert_invitation_24.xml b/android/src/main/res/drawable/ic_baseline_insert_invitation_24.xml
index 98cf2e2a9..9087f64a5 100755
--- a/android/src/main/res/drawable/ic_baseline_insert_invitation_24.xml
+++ b/android/src/main/res/drawable/ic_baseline_insert_invitation_24.xml
@@ -1,9 +1,9 @@
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ android:pathData="M17,12h-5v5h5v-5zM16,1v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2h-1L18,1h-2zM19,19L5,19L5,8h14v11z" />
diff --git a/android/src/main/res/drawable/linkedin.xml b/android/src/main/res/drawable/linkedin.xml
index b58dac324..b9ed41646 100644
--- a/android/src/main/res/drawable/linkedin.xml
+++ b/android/src/main/res/drawable/linkedin.xml
@@ -1,9 +1,9 @@
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="72"
+ android:viewportHeight="72">
+V31.4h6.8v3.1h0.1c0.9-1.8,3.3-3.7,6.7-3.7c7.2,0,8.5,4.7,8.5,10.9V54.4z" />
diff --git a/android/src/main/res/drawable/twitter.xml b/android/src/main/res/drawable/twitter.xml
index edd5d3001..3241156c7 100644
--- a/android/src/main/res/drawable/twitter.xml
+++ b/android/src/main/res/drawable/twitter.xml
@@ -1,9 +1,9 @@
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportHeight="72"
+ android:viewportWidth="72">
+c0-0.4,0-0.9,0-1.3C57,24.8,58.7,23.1,60,21.1Z" />
diff --git a/android/src/main/res/values/themes.xml b/android/src/main/res/values/themes.xml
index 27cd65174..6ab3e289b 100644
--- a/android/src/main/res/values/themes.xml
+++ b/android/src/main/res/values/themes.xml
@@ -12,8 +12,7 @@
- @style/Theme.Droidcon
-
+
\ No newline at end of file
diff --git a/build.gradle.kts b/build.gradle.kts
index 3249f2af9..287ebc655 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -37,6 +37,9 @@ subprojects {
jvmTarget = "1.8"
}
}
+ configure {
+ version.set("1.4.0")
+ }
}
tasks.register("clean") {
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
index bad9ff8ab..c971bbfad 100644
--- a/gradle/libs.versions.toml
+++ b/gradle/libs.versions.toml
@@ -49,7 +49,7 @@ android-desugaring = "2.1.2"
koin = "3.5.3"
uuid = "0.8.3"
# TODO: Update Ktlint when fix is available
-ktlint = "11.0.0"
+ktlint = "12.1.1"
# TODO: Update Coil library when Ktor is updated to 3.0
coil = "3.0.0-alpha04"
zoomimage = "1.1.0-alpha06"
diff --git a/ios/build.gradle.kts b/ios/build.gradle.kts
index 33a6f5093..6686af727 100644
--- a/ios/build.gradle.kts
+++ b/ios/build.gradle.kts
@@ -15,7 +15,7 @@ kotlin {
val targets = listOf(
iosX64(),
iosArm64(),
- iosSimulatorArm64()
+ iosSimulatorArm64(),
)
sourceSets {
@@ -55,7 +55,7 @@ kotlin {
"-linker-option", "-framework", "-linker-option", "Metal",
"-linker-option", "-framework", "-linker-option", "CoreText",
"-linker-option", "-framework", "-linker-option", "CoreGraphics",
- "-Xdisable-phases=VerifyBitcode"
+ "-Xdisable-phases=VerifyBitcode",
)
linkerOpts.add("-lsqlite3")
export(libs.kermit)
@@ -78,7 +78,7 @@ kotlin {
}
afterEvaluate {
- tasks.withType() {
+ tasks.withType {
(compilerPluginClasspath as? Configuration)?.isTransitive = true
}
}
diff --git a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/DependencyInjection.kt b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/DependencyInjection.kt
index b72072461..cddc46316 100644
--- a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/DependencyInjection.kt
+++ b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/DependencyInjection.kt
@@ -22,10 +22,7 @@ import platform.Foundation.NSBundle
import platform.Foundation.NSUserDefaults
@OptIn(ExperimentalSettingsApi::class)
-fun initKoinIos(
- userDefaults: NSUserDefaults,
- analyticsService: AnalyticsService
-): KoinApplication = initKoin(
+fun initKoinIos(userDefaults: NSUserDefaults, analyticsService: AnalyticsService): KoinApplication = initKoin(
module {
single { BundleProvider(bundle = NSBundle.mainBundle) }
single { NSUserDefaultsSettings(delegate = userDefaults) }
@@ -40,7 +37,7 @@ fun initKoinIos(
single { analyticsService }
single { DefaultParseUrlViewService() }
- } + uiModule
+ } + uiModule,
)
// Workaround class for injecting an `NSObject` class.
diff --git a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/service/DefaultParseUrlViewService.kt b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/service/DefaultParseUrlViewService.kt
index 90dbc71e9..f4b4c1abe 100644
--- a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/service/DefaultParseUrlViewService.kt
+++ b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/service/DefaultParseUrlViewService.kt
@@ -8,7 +8,5 @@ class DefaultParseUrlViewService : ParseUrlViewService {
private val urlRegex =
"https?:\\/\\/(www\\.)?[-a-zA-Z0-9@:%._\\+~#=]{1,256}\\.[a-zA-Z0-9()]{1,6}\\b([-a-zA-Z0-9()@:%_\\+.~#?&//=]*)".toRegex()
- override fun parse(text: String): List {
- return urlRegex.findAll(text).map { WebLink(it.range, it.value) }.toList()
- }
+ override fun parse(text: String): List = urlRegex.findAll(text).map { WebLink(it.range, it.value) }.toList()
}
diff --git a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/NotificationLocalizedStringFactory.kt b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/NotificationLocalizedStringFactory.kt
index 783791d1a..21ee3bf5e 100644
--- a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/NotificationLocalizedStringFactory.kt
+++ b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/NotificationLocalizedStringFactory.kt
@@ -7,27 +7,35 @@ import platform.Foundation.NSString
import platform.Foundation.stringWithFormat
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
-class NotificationLocalizedStringFactory(
- private val bundle: NSBundle,
-) : NotificationSchedulingService.LocalizedStringFactory {
+class NotificationLocalizedStringFactory(private val bundle: NSBundle) : NotificationSchedulingService.LocalizedStringFactory {
override fun reminderTitle(roomName: String?): String {
- val ending = roomName?.let { NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Title.InRoom", null, null).convertParametersForPrintf(), it.cstr) } ?: ""
- return NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Title.Base", null, null).convertParametersForPrintf(), ending.cstr)
+ val ending = roomName?.let {
+ NSString
+ .stringWithFormat(
+ bundle.localizedStringForKey("Notification.Reminder.Title.InRoom", null, null)
+ .convertParametersForPrintf(),
+ it.cstr,
+ )
+ } ?: ""
+ return NSString
+ .stringWithFormat(
+ bundle.localizedStringForKey("Notification.Reminder.Title.Base", null, null)
+ .convertParametersForPrintf(),
+ ending.cstr,
+ )
}
- override fun reminderBody(sessionTitle: String): String {
- return NSString.stringWithFormat(bundle.localizedStringForKey("Notification.Reminder.Body", null, null).convertParametersForPrintf(), sessionTitle.cstr)
- }
+ override fun reminderBody(sessionTitle: String): String = NSString
+ .stringWithFormat(
+ bundle.localizedStringForKey("Notification.Reminder.Body", null, null)
+ .convertParametersForPrintf(),
+ sessionTitle.cstr,
+ )
- override fun feedbackTitle(): String {
- return bundle.localizedStringForKey("Notification.Feedback.Title", null, null)
- }
+ override fun feedbackTitle(): String = bundle.localizedStringForKey("Notification.Feedback.Title", null, null)
- override fun feedbackBody(): String {
- return bundle.localizedStringForKey("Notification.Feedback.Body", null, null)
- }
+ override fun feedbackBody(): String = bundle.localizedStringForKey("Notification.Feedback.Body", null, null)
- private fun String.convertParametersForPrintf(): String =
- replace("%@", "%s")
+ private fun String.convertParametersForPrintf(): String = replace("%@", "%s")
}
diff --git a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/formatter/IOSDateFormatter.kt b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/formatter/IOSDateFormatter.kt
index 0e1385c70..501bb8151 100644
--- a/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/formatter/IOSDateFormatter.kt
+++ b/ios/src/iosMain/kotlin/co/touchlab/droidcon/ios/util/formatter/IOSDateFormatter.kt
@@ -34,21 +34,19 @@ class IOSDateFormatter : DateFormatter {
}
}
- override fun monthWithDay(date: LocalDate) =
- date.date()?.let { monthWithDay.stringFromDate(it) }
+ override fun monthWithDay(date: LocalDate) = date.date()?.let { monthWithDay.stringFromDate(it) }
- override fun timeOnly(dateTime: LocalDateTime) =
- dateTime.date()?.let { timeOnly.stringFromDate(it) }
+ override fun timeOnly(dateTime: LocalDateTime) = dateTime.date()?.let { timeOnly.stringFromDate(it) }
override fun timeOnlyInterval(fromDateTime: LocalDateTime, toDateTime: LocalDateTime) = interval(
fromDateTime.date()?.let { timeOnlyNoPeriod.stringFromDate(it) },
- toDateTime.date()?.let { timeOnly.stringFromDate(it) }
+ toDateTime.date()?.let { timeOnly.stringFromDate(it) },
)
private fun LocalDate.date() = NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())
- private fun LocalDateTime.date() =
- NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents()) // TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
+ // TODOKPG - Pretty sure this is device time zone, might be OK. Just for local formating
+ private fun LocalDateTime.date() = NSCalendar.currentCalendar.dateFromComponents(toNSDateComponents())
private fun interval(from: String?, to: String?) = listOfNotNull(from, to).joinToString(" – ")
}
diff --git a/shared-ui/build.gradle.kts b/shared-ui/build.gradle.kts
index bad22df6c..a5ed24e04 100644
--- a/shared-ui/build.gradle.kts
+++ b/shared-ui/build.gradle.kts
@@ -32,7 +32,7 @@ android {
listOf(
"src/androidMain/resources",
"src/commonMain/resources",
- )
+ ),
)
main.manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
diff --git a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
index 629b12263..b9fdec126 100644
--- a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
+++ b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
@@ -26,11 +26,11 @@ internal actual fun PlatformSwitchApp() {
context.startActivity(
Intent(
Intent.ACTION_VIEW,
- Uri.parse("market://details?id=${Constants.SisterApp.androidPackageName}")
- )
+ Uri.parse("market://details?id=${Constants.SisterApp.androidPackageName}"),
+ ),
)
}
- }
+ },
) {
Text("Open ${Constants.SisterApp.name}")
}
diff --git a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/theme/Type.android.kt b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/theme/Type.android.kt
index fd803324b..43de2f781 100644
--- a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/theme/Type.android.kt
+++ b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/theme/Type.android.kt
@@ -16,5 +16,5 @@ actual val montserratFontFamily: FontFamily = FontFamily(
montserratRegularFont,
montserratMediumFont,
montserratSemiBoldFont,
- montserratBoldFont
+ montserratBoldFont,
)
diff --git a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/Dialog.kt b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/Dialog.kt
index 1a0409859..82eb170e7 100644
--- a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/Dialog.kt
+++ b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/Dialog.kt
@@ -2,8 +2,8 @@ package co.touchlab.droidcon.ui.util
import androidx.compose.runtime.Composable
import androidx.compose.ui.ExperimentalComposeUiApi
-import androidx.compose.ui.window.DialogProperties
import androidx.compose.ui.window.Dialog as AndroidXComposeDialog
+import androidx.compose.ui.window.DialogProperties
@OptIn(ExperimentalComposeUiApi::class)
@Composable
diff --git a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/LocalImage.jvm.kt b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/LocalImage.jvm.kt
index 7ab278101..6f7813f4d 100644
--- a/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/LocalImage.jvm.kt
+++ b/shared-ui/src/androidMain/kotlin/co/touchlab/droidcon/ui/util/LocalImage.jvm.kt
@@ -1,4 +1,6 @@
-package co.touchlab.droidcon.ui.util // ktlint-disable filename
+@file:Suppress("ktlint:standard:filename")
+
+package co.touchlab.droidcon.ui.util
import android.annotation.SuppressLint
import androidx.compose.foundation.background
@@ -32,19 +34,19 @@ internal actual fun __LocalImage(imageResourceName: String, modifier: Modifier,
modifier = modifier,
painter = painterResource(id = imageRes),
contentDescription = contentDescription,
- contentScale = ContentScale.FillWidth
+ contentScale = ContentScale.FillWidth,
)
} else {
Row(
modifier = modifier.background(MaterialTheme.colorScheme.primary, RoundedCornerShape(Dimensions.Padding.half)),
- verticalAlignment = Alignment.CenterVertically
+ verticalAlignment = Alignment.CenterVertically,
) {
Spacer(modifier = Modifier.weight(1f))
Icon(
imageVector = Icons.Default.Warning,
contentDescription = contentDescription,
modifier = Modifier.padding(Dimensions.Padding.half),
- tint = Color.White
+ tint = Color.White,
)
Text("Image not supported", modifier = Modifier.padding(Dimensions.Padding.default), color = Color.White)
Spacer(modifier = Modifier.weight(1f))
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/BottomNavigationView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/BottomNavigationView.kt
index cec2db5a4..ee2375768 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/BottomNavigationView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/BottomNavigationView.kt
@@ -52,12 +52,12 @@ internal fun BottomNavigationView(viewModel: ApplicationViewModel, modifier: Mod
colors = NavigationBarItemDefaults.colors(
indicatorColor = MaterialTheme.colorScheme.primary,
selectedIconColor = MaterialTheme.colorScheme.onPrimary,
- selectedTextColor = MaterialTheme.colorScheme.primary
- )
+ selectedTextColor = MaterialTheme.colorScheme.primary,
+ ),
)
}
}
- }
+ },
) { paddingValues ->
Box(modifier = Modifier.padding(bottom = paddingValues.calculateBottomPadding())) {
when (selectedTab) {
@@ -66,11 +66,13 @@ internal fun BottomNavigationView(viewModel: ApplicationViewModel, modifier: Mod
title = "Droidcon London 2024",
emptyText = "Sessions could not be loaded.",
)
+
ApplicationViewModel.Tab.MyAgenda -> SessionListView(
viewModel = viewModel.agenda,
title = "Agenda",
emptyText = "Add sessions to your agenda from session detail in schedule.",
)
+
ApplicationViewModel.Tab.Venue -> VenueView()
ApplicationViewModel.Tab.Sponsors -> SponsorsView(viewModel.sponsors)
ApplicationViewModel.Tab.Settings -> SettingsView(viewModel.settings)
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/FeedbackDialog.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/FeedbackDialog.kt
index 572c89287..c2ef5507e 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/FeedbackDialog.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/FeedbackDialog.kt
@@ -41,7 +41,7 @@ import co.touchlab.droidcon.viewmodel.FeedbackDialogViewModel
internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
Dialog(dismiss = feedback::skipTapped) {
Card(
- modifier = Modifier.padding(Dimensions.Padding.double)
+ modifier = Modifier.padding(Dimensions.Padding.double),
) {
Column(
modifier = Modifier
@@ -86,7 +86,7 @@ internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
placeholder = {
Text(
text = "(Optional) Suggest improvement",
- style = MaterialTheme.typography.bodyLarge
+ style = MaterialTheme.typography.bodyLarge,
)
},
textStyle = MaterialTheme.typography.bodyLarge,
@@ -113,7 +113,7 @@ internal fun FeedbackDialog(feedback: FeedbackDialogViewModel) {
TextButton(onClick = feedback::closeAndDisableTapped) {
Text(
text = "CLOSE AND DISABLE FEEDBACK",
- color = MaterialTheme.colorScheme.primary
+ color = MaterialTheme.colorScheme.primary,
)
}
TextButton(onClick = feedback::skipTapped) {
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionBlockView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionBlockView.kt
index 3619c74a0..df0dcd47c 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionBlockView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionBlockView.kt
@@ -65,7 +65,7 @@ internal fun SessionBlockView(sessionsBlock: SessionBlockViewModel) {
modifier = Modifier.padding(Dimensions.Padding.half),
fontWeight = FontWeight.Bold,
color = MaterialTheme.colorScheme.onSurface,
- style = MaterialTheme.typography.titleMedium
+ style = MaterialTheme.typography.titleMedium,
)
session.room?.let { roomName ->
Text(
@@ -85,7 +85,7 @@ internal fun SessionBlockView(sessionsBlock: SessionBlockViewModel) {
end = Dimensions.Padding.half,
bottom = Dimensions.Padding.half,
),
- style = MaterialTheme.typography.titleSmall
+ style = MaterialTheme.typography.titleSmall,
)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionDetailView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionDetailView.kt
index 8305c9027..5ddcc4391 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionDetailView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionDetailView.kt
@@ -62,10 +62,10 @@ internal fun SessionDetailView(viewModel: SessionDetailViewModel) {
NavigationStack(
key = viewModel,
links = {
- NavigationLink(viewModel.observePresentedSpeakerDetail) {
+ navigationLink(viewModel.observePresentedSpeakerDetail) {
SpeakerDetailView(viewModel = it)
}
- }
+ },
) {
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
Scaffold(
@@ -81,7 +81,7 @@ internal fun SessionDetailView(viewModel: SessionDetailViewModel) {
)
}
},
- scrollBehavior = scrollBehavior
+ scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
@@ -94,7 +94,7 @@ internal fun SessionDetailView(viewModel: SessionDetailViewModel) {
Column(
modifier = Modifier
.verticalScroll(scrollState)
- .padding(top = paddingValues.calculateTopPadding())
+ .padding(top = paddingValues.calculateTopPadding()),
) {
val state by viewModel.observeState.observeAsState()
Box(contentAlignment = Alignment.BottomStart) {
@@ -215,7 +215,7 @@ private fun HeaderView(title: String, locationInfo: String) {
private fun InfoView(status: String) {
Row(
modifier = Modifier.fillMaxWidth().padding(top = Dimensions.Padding.default),
- verticalAlignment = Alignment.CenterVertically
+ verticalAlignment = Alignment.CenterVertically,
) {
Icon(
imageVector = Icons.Default.Info,
@@ -267,7 +267,7 @@ private fun SpeakerView(speaker: SpeakerListItemViewModel) {
Column(
modifier = Modifier
.fillMaxWidth()
- .clickable { speaker.selected() }
+ .clickable { speaker.selected() },
) {
Row(verticalAlignment = Alignment.CenterVertically) {
val imageUrl = speaker.avatarUrl?.string
@@ -280,7 +280,7 @@ private fun SpeakerView(speaker: SpeakerListItemViewModel) {
.padding(
start = Dimensions.Padding.default,
end = Dimensions.Padding.default,
- top = Dimensions.Padding.half
+ top = Dimensions.Padding.half,
)
.clip(CircleShape)
.aspectRatio(1f)
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionListView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionListView.kt
index d3b42cf5d..dfa6d7274 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionListView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SessionListView.kt
@@ -60,18 +60,14 @@ import kotlinx.coroutines.launch
@OptIn(ExperimentalMaterial3Api::class, ExperimentalFoundationApi::class)
@Composable
-internal fun SessionListView(
- viewModel: BaseSessionListViewModel,
- title: String,
- emptyText: String,
-) {
+internal fun SessionListView(viewModel: BaseSessionListViewModel, title: String, emptyText: String) {
NavigationStack(
key = viewModel,
links = {
- NavigationLink(viewModel.observePresentedSessionDetail) {
+ navigationLink(viewModel.observePresentedSessionDetail) {
SessionDetailView(viewModel = it)
}
- }
+ },
) {
val scrollBehavior = TopAppBarDefaults.exitUntilCollapsedScrollBehavior(rememberTopAppBarState())
Scaffold(
@@ -79,7 +75,7 @@ internal fun SessionListView(
topBar = {
CenterAlignedTopAppBar(
title = { Text(title) },
- scrollBehavior = scrollBehavior
+ scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
@@ -87,7 +83,7 @@ internal fun SessionListView(
Column(
modifier = Modifier
.onSizeChanged { size = it }
- .padding(top = paddingValues.calculateTopPadding())
+ .padding(top = paddingValues.calculateTopPadding()),
) {
val days by viewModel.observeDays.observeAsState()
if (days?.isEmpty() != false) {
@@ -109,13 +105,16 @@ internal fun SessionListView(
indicator = { tabPositions ->
if (tabPositions.indices.contains(pagerState.currentPage)) {
TabIndicator(
- Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage])
+ Modifier.tabIndicatorOffset(tabPositions[pagerState.currentPage]),
)
} else {
- Logger.w("SessionList TabRow requested an indicator for selectedTabIndex: ${pagerState.currentPage}, but only got ${tabPositions.count()} tabs.")
+ Logger.w(
+ "SessionList TabRow requested an indicator for selectedTabIndex: " +
+ "${pagerState.currentPage}, but only got ${tabPositions.count()} tabs.",
+ )
TabRowDefaults.SecondaryIndicator()
}
- }
+ },
) {
days?.forEachIndexed { index, daySchedule ->
Tab(
@@ -127,7 +126,7 @@ internal fun SessionListView(
pagerState.animateScrollToPage(index)
}
},
- unselectedContentColor = MaterialTheme.colorScheme.onSurfaceVariant
+ unselectedContentColor = MaterialTheme.colorScheme.onSurfaceVariant,
) {
Text(
text = daySchedule.day,
@@ -157,7 +156,7 @@ internal fun SessionListView(
) {
day.scrollState = SessionDayViewModel.ScrollState(
scrollState.firstVisibleItemIndex,
- scrollState.firstVisibleItemScrollOffset
+ scrollState.firstVisibleItemScrollOffset,
)
}
@@ -193,7 +192,7 @@ private fun TabIndicator(modifier: Modifier = Modifier) {
.padding(horizontal = 64.dp)
.height(2.dp)
.clip(RoundedCornerShape(topStart = 12.dp, topEnd = 12.dp))
- .background(MaterialTheme.colorScheme.primary)
+ .background(MaterialTheme.colorScheme.primary),
)
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SpeakerDetailView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SpeakerDetailView.kt
index bbdfbcab0..c16ad3dd0 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SpeakerDetailView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/session/SpeakerDetailView.kt
@@ -60,7 +60,7 @@ internal fun SpeakerDetailView(viewModel: SpeakerDetailViewModel) {
)
}
},
- scrollBehavior = scrollBehavior
+ scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
@@ -104,7 +104,7 @@ private fun HeaderView(name: String, tagLine: String, imageUrl: Url?) {
.width(100.dp)
.padding(Dimensions.Padding.default)
.clip(CircleShape)
- .aspectRatio(1f)
+ .aspectRatio(1f),
)
}
@@ -140,7 +140,7 @@ private fun SocialView(url: WebLink, iconName: String) {
contentDescription = null,
modifier = Modifier
.padding(Dimensions.Padding.default)
- .size(28.dp)
+ .size(28.dp),
)
WebLinkText(
text = url.link,
@@ -180,7 +180,7 @@ private fun SocialView(url: WebLink, icon: ImageVector) {
private fun BioView(bio: String, webLinks: List) {
Row(
modifier = Modifier.fillMaxWidth().padding(vertical = Dimensions.Padding.half),
- verticalAlignment = Alignment.Top
+ verticalAlignment = Alignment.Top,
) {
Icon(
imageVector = Icons.Default.Description,
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 512559e07..5a2bfb0e8 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/ui/sponsors/SponsorDetailView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorDetailView.kt
index 2d965cf98..416f58f5d 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorDetailView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorDetailView.kt
@@ -51,10 +51,10 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
NavigationStack(
key = viewModel,
links = {
- NavigationLink(viewModel.observePresentedSpeakerDetail) {
+ navigationLink(viewModel.observePresentedSpeakerDetail) {
SpeakerDetailView(viewModel = it)
}
- }
+ },
) {
Scaffold(
topBar = {
@@ -67,9 +67,9 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
contentDescription = "Back",
)
}
- }
+ },
)
- }
+ },
) { paddingValues ->
val scrollState = rememberScrollState()
Column(
@@ -80,7 +80,7 @@ internal fun SponsorDetailView(viewModel: SponsorDetailViewModel) {
HeaderView(
name = viewModel.name,
groupTitle = viewModel.groupName,
- imageUrl = viewModel.imageUrl
+ imageUrl = viewModel.imageUrl,
)
viewModel.abstract?.let {
@@ -195,7 +195,7 @@ private fun RepresentativeInfoView(profile: SpeakerListItemViewModel) {
.padding(
start = Dimensions.Padding.default,
end = Dimensions.Padding.default,
- top = Dimensions.Padding.half
+ top = Dimensions.Padding.half,
)
.clip(CircleShape)
.aspectRatio(1f)
@@ -211,7 +211,7 @@ private fun RepresentativeInfoView(profile: SpeakerListItemViewModel) {
.padding(
start = Dimensions.Padding.default,
end = Dimensions.Padding.default,
- top = Dimensions.Padding.half
+ top = Dimensions.Padding.half,
)
.clip(CircleShape)
.aspectRatio(1f)
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorsView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorsView.kt
index e3c98e2b0..e1755a5d6 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorsView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/sponsors/SponsorsView.kt
@@ -55,10 +55,10 @@ internal fun SponsorsView(viewModel: SponsorListViewModel) {
NavigationStack(
key = viewModel,
links = {
- NavigationLink(viewModel.observePresentedSponsorDetail) {
+ navigationLink(viewModel.observePresentedSponsorDetail) {
SponsorDetailView(viewModel = it)
}
- }
+ },
) {
val scrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(rememberTopAppBarState())
Scaffold(
@@ -66,7 +66,7 @@ internal fun SponsorsView(viewModel: SponsorListViewModel) {
topBar = {
TopAppBar(
title = { Text("Sponsors") },
- scrollBehavior = scrollBehavior
+ scrollBehavior = scrollBehavior,
)
},
) { paddingValues ->
@@ -99,8 +99,8 @@ private fun SponsorGroupView(sponsorGroup: SponsorGroupViewModel) {
Card(
modifier = Modifier.padding(
vertical = Dimensions.Padding.quarter,
- horizontal = Dimensions.Padding.half
- )
+ horizontal = Dimensions.Padding.half,
+ ),
) {
Column(modifier = Modifier.fillMaxWidth()) {
Text(
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Theme.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Theme.kt
index 923cb1866..85aa1274a 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Theme.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Theme.kt
@@ -14,6 +14,7 @@ private val DarkColorScheme = darkColorScheme(
primary = Colors.primary,
)
+@Suppress("ktlint:standard:backing-property-naming")
private val _LightColorScheme = lightColorScheme(
primary = Colors.primary,
onPrimary = Colors.droidcon_theme_light_onPrimary,
@@ -46,6 +47,7 @@ private val _LightColorScheme = lightColorScheme(
onSurfaceVariant = Colors.droidcon_theme_light_onSurfaceVariant,
)
+@Suppress("ktlint:standard:backing-property-naming")
private val _DarkColorScheme = darkColorScheme(
primary = Colors.droidcon_theme_dark_primary,
onPrimary = Colors.droidcon_theme_dark_onPrimary,
@@ -79,10 +81,7 @@ private val _DarkColorScheme = darkColorScheme(
)
@Composable
-internal fun DroidconTheme(
- darkTheme: Boolean = isSystemInDarkTheme(),
- content: @Composable () -> Unit,
-) {
+internal fun DroidconTheme(darkTheme: Boolean = isSystemInDarkTheme(), content: @Composable () -> Unit) {
val colorScheme = when {
darkTheme -> DarkColorScheme
else -> LightColorScheme
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Typography.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Typography.kt
index 82ab85158..4279960a5 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Typography.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/theme/Typography.kt
@@ -10,64 +10,64 @@ internal object Typography {
headlineLarge = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 32.sp
+ fontSize = 32.sp,
),
headlineMedium = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 28.sp
+ fontSize = 28.sp,
),
headlineSmall = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
fontSize = 22.sp,
- letterSpacing = 0.15.sp
+ letterSpacing = 0.15.sp,
),
titleLarge = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 20.sp
+ fontSize = 20.sp,
),
titleMedium = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 16.sp
+ fontSize = 16.sp,
),
titleSmall = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 14.sp
+ fontSize = 14.sp,
),
bodyLarge = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 16.sp
+ fontSize = 16.sp,
),
bodyMedium = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 14.sp
+ fontSize = 14.sp,
),
bodySmall = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 12.sp
+ fontSize = 12.sp,
),
labelLarge = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.SemiBold,
- fontSize = 12.sp
+ fontSize = 12.sp,
),
labelMedium = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
- fontSize = 12.sp
+ fontSize = 12.sp,
),
labelSmall = TextStyle(
fontFamily = montserratFontFamily,
fontWeight = FontWeight.Medium,
fontSize = 10.sp,
- letterSpacing = 1.5.sp
- )
+ letterSpacing = 1.5.sp,
+ ),
)
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/util/Image.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/util/Image.kt
index 117aa3cbc..197c04ecf 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/util/Image.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/util/Image.kt
@@ -10,12 +10,7 @@ import coil3.request.crossfade
import coil3.util.DebugLogger
@Composable
-fun DcAsyncImage(
- logTag: String,
- model: Any?,
- contentDescription: String?,
- modifier: Modifier = Modifier,
-) {
+fun DcAsyncImage(logTag: String, model: Any?, contentDescription: String?, modifier: Modifier = Modifier) {
AsyncImage(
modifier = modifier,
model = model,
@@ -24,22 +19,17 @@ fun DcAsyncImage(
Logger.e(
messageString = logTag,
throwable = it.result.throwable,
- tag = "AsyncImage OnError Request = ${it.result.request}\n"
+ tag = "AsyncImage OnError Request = ${it.result.request}\n",
)
},
)
}
-fun dcImageLoader(
- context: PlatformContext,
- debug: Boolean = false,
-): ImageLoader {
- return ImageLoader.Builder(context)
- .crossfade(true)
- .apply {
- if (debug) {
- logger(DebugLogger())
- }
+fun dcImageLoader(context: PlatformContext, debug: Boolean = false): ImageLoader = ImageLoader.Builder(context)
+ .crossfade(true)
+ .apply {
+ if (debug) {
+ logger(DebugLogger())
}
- .build()
-}
+ }
+ .build()
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/venue/VenueView.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/venue/VenueView.kt
index cb2b58967..475b00262 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/venue/VenueView.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/ui/venue/VenueView.kt
@@ -13,7 +13,7 @@ import org.jetbrains.compose.resources.painterResource
fun VenueView() {
Scaffold { paddingValues ->
VenueBodyView(
- modifier = Modifier.padding(paddingValues)
+ modifier = Modifier.padding(paddingValues),
)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/LocalDateTime+startOfMinute.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/LocalDateTime+startOfMinute.kt
index ca0f31916..00317ab1a 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/LocalDateTime+startOfMinute.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/LocalDateTime+startOfMinute.kt
@@ -1,3 +1,5 @@
+@file:Suppress("ktlint:standard:filename")
+
package co.touchlab.droidcon.util
import kotlinx.datetime.LocalDateTime
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/NavigationController.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/NavigationController.kt
index 76f94f926..66eaa4042 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/NavigationController.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/util/NavigationController.kt
@@ -48,16 +48,13 @@ class NavigationController : BaseViewModel() {
internal sealed class NavigationStackItem {
class BackPressHandler(val onBackPressed: BackPressHandlerScope.() -> Unit) : NavigationStackItem() {
- override fun toString(): String {
- return "BackPress@${hashCode().toUInt().toString(16)}"
- }
+ override fun toString(): String = "BackPress@${hashCode().toUInt().toString(16)}"
}
class Push(val item: MutableObservableProperty, val content: @Composable (T) -> Unit) : NavigationStackItem() {
- override fun toString(): String {
- return "Push(${item.value}@${item.hashCode().toUInt().toString(16)})@${hashCode().toUInt().toString(16)}"
- }
+ override fun toString(): String =
+ "Push(${item.value}@${item.hashCode().toUInt().toString(16)})@${hashCode().toUInt().toString(16)}"
}
}
@@ -176,9 +173,7 @@ class NavigationController : BaseViewModel() {
}
}
-internal data class NavigationViewDimensions(
- val constraints: Constraints,
-)
+internal data class NavigationViewDimensions(val constraints: Constraints)
@Composable
internal fun rememberNavigationController(): NavigationController = remember {
@@ -213,7 +208,7 @@ internal fun BackPressHandler(onBackPressed: NavigationController.BackPressHandl
internal interface NavigationStackScope {
- fun NavigationLink(item: MutableObservableProperty, content: @Composable (T) -> Unit)
+ fun navigationLink(item: MutableObservableProperty, content: @Composable (T) -> Unit)
}
internal class NavigationLinkWrapper(
@@ -235,13 +230,11 @@ internal class NavigationLinkWrapper(
}
}
- override fun equals(other: Any?): Boolean {
- return (other as? NavigationLinkWrapper<*>)?.let { it.index == index && it.value == value } ?: false
- }
+ override fun equals(other: Any?): Boolean = (other as? NavigationLinkWrapper<*>)?.let {
+ it.index == index && it.value == value
+ } ?: false
- override fun hashCode(): Int {
- return listOfNotNull(index, value).hashCode()
- }
+ override fun hashCode(): Int = listOfNotNull(index, value).hashCode()
}
@OptIn(ExperimentalAnimationApi::class)
@@ -250,14 +243,11 @@ internal fun NavigationStack(key: Any?, links: NavigationStackScope.() -> Unit,
val activeLinkComposables by remember(key) {
val constructedLinks = mutableListOf>>()
val scope = object : NavigationStackScope {
- override fun NavigationLink(
- item: MutableObservableProperty,
- content: @Composable (T) -> Unit,
- ) {
+ override fun navigationLink(item: MutableObservableProperty, content: @Composable (T) -> Unit) {
constructedLinks.add(
item.map {
NavigationLinkWrapper(index = constructedLinks.size, value = it, reset = { item.value = null }, content)
- }
+ },
)
}
}
@@ -275,7 +265,7 @@ internal fun NavigationStack(key: Any?, links: NavigationStackScope.() -> Unit,
slideInHorizontally(initialOffsetX = { -it }) with slideOutHorizontally(targetOffsetX = { it })
}
},
- contentAlignment = Alignment.BottomCenter
+ contentAlignment = Alignment.BottomCenter,
) { activeComposables ->
SubcomposeLayout(
measurePolicy = { constraints ->
@@ -297,7 +287,7 @@ internal fun NavigationStack(key: Any?, links: NavigationStackScope.() -> Unit,
it.measure(looseConstraints).place(x = 0, y = 0)
}
}
- }
+ },
)
}
}
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 e48a919ce..fdd3ae680 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())
@@ -41,7 +42,7 @@ class ApplicationViewModel(
instanceLock.runExclusively {
settingsGateway.setUseComposeForIos(newValue)
}
- }
+ },
)
var presentedFeedback: FeedbackDialogViewModel? by managed(null)
@@ -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)
@@ -114,6 +115,10 @@ class ApplicationViewModel(
}
enum class Tab {
- Schedule, MyAgenda, Venue, Sponsors, Settings;
+ Schedule,
+ MyAgenda,
+ Venue,
+ Sponsors,
+ Settings,
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/FeedbackDialogViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/FeedbackDialogViewModel.kt
index 6d5503630..4254cc1d6 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/FeedbackDialogViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/FeedbackDialogViewModel.kt
@@ -38,19 +38,21 @@ class FeedbackDialogViewModel(
fun skipTapped() = instanceLock.runExclusively(skip::invoke)
- private fun feedbackRatingToRating(rating: Int): Rating? =
- when (rating) {
- Session.Feedback.Rating.DISSATISFIED -> Rating.Dissatisfied
- Session.Feedback.Rating.NORMAL -> Rating.Normal
- Session.Feedback.Rating.SATISFIED -> Rating.Satisfied
- else -> {
- log.w("Unknown feedback rating $rating.")
- null
- }
+ private fun feedbackRatingToRating(rating: Int): Rating? = when (rating) {
+ Session.Feedback.Rating.DISSATISFIED -> Rating.Dissatisfied
+ Session.Feedback.Rating.NORMAL -> Rating.Normal
+ Session.Feedback.Rating.SATISFIED -> Rating.Satisfied
+ else -> {
+ log.w("Unknown feedback rating $rating.")
+ null
}
+ }
enum class Rating {
- Dissatisfied, Normal, Satisfied;
+ Dissatisfied,
+ Normal,
+ Satisfied,
+ ;
val entityValue: Int
get() = when (this) {
@@ -60,10 +62,7 @@ class FeedbackDialogViewModel(
}
}
- class Factory(
- private val sessionGateway: SessionGateway,
- private val log: Logger,
- ) {
+ class Factory(private val sessionGateway: SessionGateway, private val log: Logger) {
fun create(
session: Session,
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionBlockViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionBlockViewModel.kt
index f97da9c53..79434eb3f 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionBlockViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionBlockViewModel.kt
@@ -19,19 +19,13 @@ class SessionBlockViewModel(
item,
selected = {
onScheduleItemSelected(item)
- }
+ },
)
- }
+ },
)
- class Factory(
- private val sessionListItemFactory: SessionListItemViewModel.Factory,
- private val dateFormatter: DateFormatter,
- ) {
- fun create(
- startsAt: LocalDateTime,
- items: List,
- onScheduleItemSelected: (ScheduleItem) -> Unit,
- ) = SessionBlockViewModel(sessionListItemFactory, dateFormatter, startsAt, items, onScheduleItemSelected)
+ class Factory(private val sessionListItemFactory: SessionListItemViewModel.Factory, private val dateFormatter: DateFormatter) {
+ fun create(startsAt: LocalDateTime, items: List, onScheduleItemSelected: (ScheduleItem) -> Unit) =
+ SessionBlockViewModel(sessionListItemFactory, dateFormatter, startsAt, items, onScheduleItemSelected)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDayViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDayViewModel.kt
index 89ed6833d..7c9ee9fd0 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDayViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDayViewModel.kt
@@ -25,7 +25,7 @@ class SessionDayViewModel(
.groupBy { it.session.startsAt.toConferenceDateTime(dateTimeService).startOfMinute }
.map { (startsAt, items) ->
sessionBlockFactory.create(startsAt, items, onScheduleItemSelected)
- }
+ },
)
var scrollState: ScrollState
@@ -43,20 +43,16 @@ class SessionDayViewModel(
private val sessionDetailScrollStateStorage: SessionDetailScrollStateStorage,
) {
- fun create(
- date: LocalDate,
- attendingOnly: Boolean,
- items: List,
- onScheduleItemSelected: (ScheduleItem) -> Unit,
- ) = SessionDayViewModel(
- sessionBlockFactory,
- dateFormatter,
- dateTimeService,
- date,
- attendingOnly,
- sessionDetailScrollStateStorage,
- items,
- onScheduleItemSelected,
- )
+ fun create(date: LocalDate, attendingOnly: Boolean, items: List, onScheduleItemSelected: (ScheduleItem) -> Unit) =
+ SessionDayViewModel(
+ sessionBlockFactory,
+ dateFormatter,
+ dateTimeService,
+ date,
+ attendingOnly,
+ sessionDetailScrollStateStorage,
+ items,
+ onScheduleItemSelected,
+ )
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailScrollStateStorage.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailScrollStateStorage.kt
index ba1ce1cae..b1c8e3bb7 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailScrollStateStorage.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailScrollStateStorage.kt
@@ -8,12 +8,11 @@ class SessionDetailScrollStateStorage {
val agendaScrollStates: MutableMap = mutableMapOf()
var selectedDay: LocalDate? = null
- fun getScrollState(day: LocalDate, agenda: Boolean): SessionDayViewModel.ScrollState =
- if (agenda) {
- agendaScrollStates[day]
- } else {
- scrollStates[day]
- } ?: SessionDayViewModel.ScrollState(firstVisibleItemIndex = 0, firstVisibleItemScrollOffset = 0)
+ fun getScrollState(day: LocalDate, agenda: Boolean): SessionDayViewModel.ScrollState = if (agenda) {
+ agendaScrollStates[day]
+ } else {
+ scrollStates[day]
+ } ?: SessionDayViewModel.ScrollState(firstVisibleItemIndex = 0, firstVisibleItemScrollOffset = 0)
fun setScrollState(day: LocalDate, agenda: Boolean, scrollState: SessionDayViewModel.ScrollState) {
if (agenda) {
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt
index 6d954abba..10c9e56f9 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionDetailViewModel.kt
@@ -46,7 +46,7 @@ class SessionDetailViewModel(
emit(dateTimeService.now())
delay(10_000)
}
- }
+ },
)
private val observeTime by observe(::time)
@@ -88,10 +88,10 @@ class SessionDetailViewModel(
speaker,
selected = {
presentedSpeakerDetail = speakerDetailFactory.create(speaker)
- }
+ },
)
}
- }
+ },
)
val observeSpeakers by observe(::speakers)
@@ -113,7 +113,7 @@ class SessionDetailViewModel(
.map { it.isFeedbackEnabled }
.combine(observeState.asFlow()) { feedbackEnabled, state ->
feedbackEnabled && state == SessionState.Ended
- }
+ },
)
val observeShowFeedbackOption by observe(::showFeedbackOption)
@@ -146,7 +146,9 @@ class SessionDetailViewModel(
}
enum class SessionState {
- InConflict, InProgress, Ended
+ InConflict,
+ InProgress,
+ Ended,
}
class Factory(
@@ -162,9 +164,7 @@ class SessionDetailViewModel(
private val notificationService: NotificationService,
) {
- fun create(
- item: ScheduleItem,
- ) = SessionDetailViewModel(
+ fun create(item: ScheduleItem) = SessionDetailViewModel(
sessionGateway,
settingsGateway,
speakerListItemFactory,
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionListItemViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionListItemViewModel.kt
index f9b6cf8a5..dd0749753 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionListItemViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SessionListItemViewModel.kt
@@ -6,11 +6,7 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.flow.flow
import org.brightify.hyperdrive.multiplatformx.BaseViewModel
-class SessionListItemViewModel(
- dateTimeService: DateTimeService,
- item: ScheduleItem,
- val selected: () -> Unit,
-) : BaseViewModel() {
+class SessionListItemViewModel(dateTimeService: DateTimeService, item: ScheduleItem, val selected: () -> Unit) : BaseViewModel() {
val title: String = item.session.title
val isServiceSession: Boolean = item.session.isServiceSession
val isAttending: Boolean = item.session.rsvp.isAttending
@@ -26,16 +22,11 @@ class SessionListItemViewModel(
emit(isInPast)
delay(10_000)
}
- }
+ },
)
val observeIsInPast by observe(::isInPast)
- class Factory(
- private val dateTimeService: DateTimeService,
- ) {
- fun create(
- item: ScheduleItem,
- selected: () -> Unit,
- ) = SessionListItemViewModel(dateTimeService, item, selected)
+ class Factory(private val dateTimeService: DateTimeService) {
+ fun create(item: ScheduleItem, selected: () -> Unit) = SessionListItemViewModel(dateTimeService, item, selected)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SpeakerDetailViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SpeakerDetailViewModel.kt
index 75e38d076..e571ddb40 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SpeakerDetailViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/session/SpeakerDetailViewModel.kt
@@ -6,10 +6,7 @@ import co.touchlab.droidcon.dto.WebLink
import co.touchlab.droidcon.service.ParseUrlViewService
import org.brightify.hyperdrive.multiplatformx.BaseViewModel
-class SpeakerDetailViewModel(
- private val parseUrlViewService: ParseUrlViewService,
- profile: Profile,
-) : BaseViewModel() {
+class SpeakerDetailViewModel(private val parseUrlViewService: ParseUrlViewService, profile: Profile) : BaseViewModel() {
val avatarUrl = profile.profilePicture
@@ -25,11 +22,7 @@ class SpeakerDetailViewModel(
val bio = profile.bio
val bioWebLinks: List = bio?.let(parseUrlViewService::parse) ?: emptyList()
- data class Socials(
- val website: Url?,
- val twitter: Url?,
- val linkedIn: Url?,
- ) {
+ data class Socials(val website: Url?, val twitter: Url?, val linkedIn: Url?) {
val isEmpty: Boolean = listOfNotNull(
website,
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutItemViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutItemViewModel.kt
index 01bfc1abb..ede6717c8 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutItemViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/AboutItemViewModel.kt
@@ -3,9 +3,4 @@ package co.touchlab.droidcon.viewmodel.settings
import co.touchlab.droidcon.dto.WebLink
import org.brightify.hyperdrive.multiplatformx.BaseViewModel
-class AboutItemViewModel(
- val title: String,
- val detail: String,
- val webLinks: List,
- val icon: String,
-) : BaseViewModel()
+class AboutItemViewModel(val title: String, val detail: String, val webLinks: List, val icon: String) : BaseViewModel()
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 14c092e08..ffc991025 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-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/SettingsViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/SettingsViewModel.kt
index 0507acaa2..cca11382a 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/SettingsViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/settings/SettingsViewModel.kt
@@ -3,10 +3,7 @@ package co.touchlab.droidcon.viewmodel.settings
import co.touchlab.droidcon.application.gateway.SettingsGateway
import org.brightify.hyperdrive.multiplatformx.BaseViewModel
-class SettingsViewModel(
- settingsGateway: SettingsGateway,
- private val aboutFactory: AboutViewModel.Factory,
-) : BaseViewModel() {
+class SettingsViewModel(settingsGateway: SettingsGateway, private val aboutFactory: AboutViewModel.Factory) : BaseViewModel() {
var isFeedbackEnabled by binding(
settingsGateway.settings(),
@@ -16,7 +13,7 @@ class SettingsViewModel(
instanceLock.runExclusively {
settingsGateway.setFeedbackEnabled(newValue)
}
- }
+ },
)
val observeIsFeedbackEnabled by observe(::isFeedbackEnabled)
@@ -28,7 +25,7 @@ class SettingsViewModel(
instanceLock.runExclusively {
settingsGateway.setRemindersEnabled(newValue)
}
- }
+ },
)
val observeIsRemindersEnabled by observe(::isRemindersEnabled)
@@ -42,14 +39,11 @@ class SettingsViewModel(
instanceLock.runExclusively {
settingsGateway.setUseComposeForIos(newValue)
}
- }
+ },
)
val observeUseCompose by observe(::useCompose)
- class Factory(
- private val settingsGateway: SettingsGateway,
- private val aboutFactory: AboutViewModel.Factory,
- ) {
+ class Factory(private val settingsGateway: SettingsGateway, private val aboutFactory: AboutViewModel.Factory) {
fun create() = SettingsViewModel(settingsGateway, aboutFactory)
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorDetailViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorDetailViewModel.kt
index b313f94cf..334f32d9f 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorDetailViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorDetailViewModel.kt
@@ -32,7 +32,7 @@ class SponsorDetailViewModel(
speaker,
selected = {
presentedSpeakerDetail = speakerDetailFactory.create(speaker)
- }
+ },
)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupItemViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupItemViewModel.kt
index aec1adae7..f5514181d 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupItemViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupItemViewModel.kt
@@ -5,10 +5,7 @@ import io.ktor.http.URLParserException
import io.ktor.http.Url
import org.brightify.hyperdrive.multiplatformx.BaseViewModel
-class SponsorGroupItemViewModel(
- private val sponsor: Sponsor,
- val selected: () -> Unit,
-) : BaseViewModel() {
+class SponsorGroupItemViewModel(private val sponsor: Sponsor, val selected: () -> Unit) : BaseViewModel() {
val name = sponsor.name
val imageUrl = sponsor.icon
@@ -22,7 +19,6 @@ class SponsorGroupItemViewModel(
class Factory {
- fun create(sponsor: Sponsor, selected: () -> Unit) =
- SponsorGroupItemViewModel(sponsor, selected)
+ fun create(sponsor: Sponsor, selected: () -> Unit) = SponsorGroupItemViewModel(sponsor, selected)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupViewModel.kt
index b7740c318..2131db070 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorGroupViewModel.kt
@@ -7,23 +7,19 @@ import org.brightify.hyperdrive.multiplatformx.BaseViewModel
class SponsorGroupViewModel(
sponsorGroupItemFactory: SponsorGroupItemViewModel.Factory,
sponsorGroup: SponsorGroupWithSponsors,
- onSponsorSelected: (Sponsor) -> Unit
+ onSponsorSelected: (Sponsor) -> Unit,
) : BaseViewModel() {
val title = sponsorGroup.group.name
val isProminent = sponsorGroup.group.isProminent
val sponsors by managedList(
sponsorGroup.sponsors.map { sponsor ->
sponsorGroupItemFactory.create(sponsor, selected = { onSponsorSelected(sponsor) })
- }
+ },
)
val observeSponsors by observe(::sponsors)
- class Factory(
- private val sponsorGroupItemFactory: SponsorGroupItemViewModel.Factory,
- ) {
- fun create(
- sponsorGroup: SponsorGroupWithSponsors,
- onSponsorSelected: (Sponsor) -> Unit,
- ) = SponsorGroupViewModel(sponsorGroupItemFactory, sponsorGroup, onSponsorSelected)
+ class Factory(private val sponsorGroupItemFactory: SponsorGroupItemViewModel.Factory) {
+ fun create(sponsorGroup: SponsorGroupWithSponsors, onSponsorSelected: (Sponsor) -> Unit) =
+ SponsorGroupViewModel(sponsorGroupItemFactory, sponsorGroup, onSponsorSelected)
}
}
diff --git a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorListViewModel.kt b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorListViewModel.kt
index 067eda996..46e95145b 100644
--- a/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorListViewModel.kt
+++ b/shared-ui/src/commonMain/kotlin/co.touchlab.droidcon/viewmodel/sponsor/SponsorListViewModel.kt
@@ -26,10 +26,10 @@ class SponsorListViewModel(
// UIApplication.sharedApplication.openURL(NSURL(string = sponsor.url.string))
presentedUrl = sponsor.url
}
- }
+ },
)
}
- }
+ },
)
val observeSponsorGroups by observe(::sponsorGroups)
diff --git a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
index 5cf082a57..f70571d5f 100644
--- a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
+++ b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/settings/PlatformSpecificSettings.kt
@@ -27,7 +27,7 @@ internal actual fun PlatformSwitchApp() {
Button(
onClick = {
openSisterApp()
- }
+ },
) {
Text("Open ${Constants.SisterApp.name}")
}
diff --git a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/NavigationBackPressWrapper.kt b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/NavigationBackPressWrapper.kt
index 0c6649d7b..1dbfb1b97 100644
--- a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/NavigationBackPressWrapper.kt
+++ b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/NavigationBackPressWrapper.kt
@@ -56,7 +56,7 @@ internal actual fun NavigationBackPressWrapper(content: @Composable () -> Unit)
AnimatedVisibility(
visible = dragDistance > triggerBackPressDragDistance,
enter = slideInHorizontally(initialOffsetX = { -it }, animationSpec = tween(durationMillis = 100)),
- exit = slideOutHorizontally(targetOffsetX = { -it })
+ exit = slideOutHorizontally(targetOffsetX = { -it }),
) {
Icon(
imageVector = Icons.Default.KeyboardArrowLeft,
diff --git a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/ToSkiaImage.kt b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/ToSkiaImage.kt
index 8aa2044f1..167c79d6a 100644
--- a/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/ToSkiaImage.kt
+++ b/shared-ui/src/iosMain/kotlin/co/touchlab/droidcon/ui/util/ToSkiaImage.kt
@@ -37,7 +37,9 @@ internal fun UIImage.toSkiaImage(): Image? {
val alphaType = when (alphaInfo) {
CGImageAlphaInfo.kCGImageAlphaPremultipliedFirst, CGImageAlphaInfo.kCGImageAlphaPremultipliedLast -> ColorAlphaType.PREMUL
CGImageAlphaInfo.kCGImageAlphaFirst, CGImageAlphaInfo.kCGImageAlphaLast -> ColorAlphaType.UNPREMUL
- CGImageAlphaInfo.kCGImageAlphaNone, CGImageAlphaInfo.kCGImageAlphaNoneSkipFirst, CGImageAlphaInfo.kCGImageAlphaNoneSkipLast -> ColorAlphaType.OPAQUE
+ CGImageAlphaInfo.kCGImageAlphaNone, CGImageAlphaInfo.kCGImageAlphaNoneSkipFirst, CGImageAlphaInfo.kCGImageAlphaNoneSkipLast,
+ -> ColorAlphaType.OPAQUE
+
else -> ColorAlphaType.UNKNOWN
}
diff --git a/shared/build.gradle.kts b/shared/build.gradle.kts
index 147771f87..bdaf03885 100644
--- a/shared/build.gradle.kts
+++ b/shared/build.gradle.kts
@@ -30,7 +30,7 @@ android {
listOf(
"src/androidMain/resources",
"src/commonMain/resources",
- )
+ ),
)
main.manifest.srcFile("src/androidMain/AndroidManifest.xml")
}
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 6c0d3d7d3..ec752fdd9 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/AndroidNotificationService.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/AndroidNotificationService.kt
index 78b26813e..eb4ac2d13 100644
--- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/AndroidNotificationService.kt
+++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/service/AndroidNotificationService.kt
@@ -96,23 +96,23 @@ class AndroidNotificationService(
}
val typeValue = when (notification) {
- is Notification.Local.Feedback -> Notification.Values.feedbackType
- is Notification.Local.Reminder -> Notification.Values.reminderType
+ is Notification.Local.Feedback -> Notification.Values.FEEDBACK_TYPE
+ is Notification.Local.Reminder -> Notification.Values.REMINDER_TYPE
}
val contentIntent = PendingIntent.getActivity(
context,
requestCode,
Intent(context, entrypointActivity).apply {
- putExtra(Notification.Keys.sessionId, sessionId.value)
- putExtra(Notification.Keys.notificationType, typeValue)
+ putExtra(Notification.Keys.SESSION_ID, sessionId.value)
+ putExtra(Notification.Keys.NOTIFICATION_TYPE, typeValue)
flags = Intent.FLAG_ACTIVITY_CLEAR_TOP
},
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
PendingIntent.FLAG_UPDATE_CURRENT or PendingIntent.FLAG_IMMUTABLE
} else {
PendingIntent.FLAG_UPDATE_CURRENT
- }
+ },
)
builder.setContentIntent(contentIntent)
@@ -141,7 +141,9 @@ class AndroidNotificationService(
}
override suspend fun cancel(sessionIds: List) {
- if (sessionIds.isEmpty()) { return }
+ if (sessionIds.isEmpty()) {
+ return
+ }
log.v { "Cancelling scheduled notifications with IDs: [${sessionIds.joinToString { it.value }}]" }
@@ -178,15 +180,16 @@ class AndroidNotificationService(
log.w { "notificationHandler not registered when received $notification" }
}
}
+
Notification.Remote.RefreshData -> syncService.forceSynchronize()
}
}
private fun Intent.parseNotification(): Notification? =
- when (val typeValue = this.getStringExtra(Notification.Keys.notificationType)) {
- Notification.Values.reminderType -> this.parseReminderNotification()
- Notification.Values.feedbackType -> this.parseFeedbackNotification()
- Notification.Values.refreshDataType -> Notification.Remote.RefreshData
+ when (val typeValue = this.getStringExtra(Notification.Keys.NOTIFICATION_TYPE)) {
+ Notification.Values.REMINDER_TYPE -> this.parseReminderNotification()
+ Notification.Values.FEEDBACK_TYPE -> this.parseFeedbackNotification()
+ Notification.Values.REFRESH_DATA_TYPE -> Notification.Remote.RefreshData
// Expected on Android as this could've been just a regular app open without a notification.
null -> null
else -> {
@@ -196,7 +199,7 @@ class AndroidNotificationService(
}
private fun Intent.parseReminderNotification(): Notification.Local.Reminder? {
- val sessionId = this.getStringExtra(Notification.Keys.sessionId) ?: run {
+ val sessionId = this.getStringExtra(Notification.Keys.SESSION_ID) ?: run {
log.e { "Couldn't parse reminder notification. Session ID doesn't exist or isn't String." }
return null
}
@@ -207,7 +210,7 @@ class AndroidNotificationService(
}
private fun Intent.parseFeedbackNotification(): Notification.Local.Feedback? {
- val sessionId = this.getStringExtra(Notification.Keys.sessionId) ?: run {
+ val sessionId = this.getStringExtra(Notification.Keys.SESSION_ID) ?: run {
log.e { "Couldn't parse feedback notification. Session ID doesn't exist or isn't String." }
return null
}
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 593cb0d5b..ab6cf9f0a 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/androidMain/kotlin/co/touchlab/droidcon/util/AssetResourceReader.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/AssetResourceReader.kt
index 49d0dae39..cd4ed6012 100644
--- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/AssetResourceReader.kt
+++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/AssetResourceReader.kt
@@ -4,9 +4,7 @@ import android.content.Context
import co.touchlab.droidcon.domain.service.impl.ResourceReader
import java.io.InputStreamReader
-class AssetResourceReader(
- private val context: Context
-) : ResourceReader {
+class AssetResourceReader(private val context: Context) : ResourceReader {
override fun readResource(name: String): String {
// TODO: Catch Android-only exceptions and map them to common ones.
return context.assets.open(name).use { stream ->
diff --git a/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/IdentifiableIntent.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/IdentifiableIntent.kt
index 57dd958a1..c730b6b0a 100644
--- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/IdentifiableIntent.kt
+++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/IdentifiableIntent.kt
@@ -3,11 +3,7 @@ package co.touchlab.droidcon.util
import android.content.Context
import android.content.Intent
-class IdentifiableIntent(
- private val id: String,
- packageContext: Context,
- cls: Class<*>,
-) : Intent(packageContext, cls) {
+class IdentifiableIntent(private val id: String, packageContext: Context, cls: Class<*>) : Intent(packageContext, cls) {
override fun filterEquals(other: Intent?): Boolean {
if (this === other) return true
diff --git a/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/formatter/AndroidDateFormatter.kt b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/formatter/AndroidDateFormatter.kt
index 2c095524f..e01a7551c 100644
--- a/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/formatter/AndroidDateFormatter.kt
+++ b/shared/src/androidMain/kotlin/co/touchlab/droidcon/util/formatter/AndroidDateFormatter.kt
@@ -2,13 +2,13 @@ package co.touchlab.droidcon.util.formatter
import co.touchlab.droidcon.Constants.conferenceTimeZone
import co.touchlab.droidcon.domain.service.DateTimeService
-import kotlinx.datetime.LocalDate
-import kotlinx.datetime.LocalDateTime
-import kotlinx.datetime.atTime
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Date
import java.util.Locale
+import kotlinx.datetime.LocalDate
+import kotlinx.datetime.LocalDateTime
+import kotlinx.datetime.atTime
class AndroidDateFormatter(private val dateTimeService: DateTimeService) : DateFormatter {
@@ -18,19 +18,14 @@ class AndroidDateFormatter(private val dateTimeService: DateTimeService) : DateF
private val minuteHourTimeFormat = DateFormat.getTimeInstance(DateFormat.SHORT, Locale.getDefault())
.apply { timeZone = java.util.TimeZone.getTimeZone(conferenceTimeZone.id) }
- override fun monthWithDay(date: LocalDate): String {
- return shortDateFormat.format(
- Date(with(dateTimeService) { date.atTime(0, 0).fromConferenceDateTime() }.toEpochMilliseconds())
- ).uppercase()
- }
+ override fun monthWithDay(date: LocalDate): String = shortDateFormat.format(
+ Date(with(dateTimeService) { date.atTime(0, 0).fromConferenceDateTime() }.toEpochMilliseconds()),
+ ).uppercase()
- override fun timeOnly(dateTime: LocalDateTime): String? {
- return minuteHourTimeFormat.format(
- Date(with(dateTimeService) { dateTime.fromConferenceDateTime() }.toEpochMilliseconds())
- )
- }
+ override fun timeOnly(dateTime: LocalDateTime): String? = minuteHourTimeFormat.format(
+ Date(with(dateTimeService) { dateTime.fromConferenceDateTime() }.toEpochMilliseconds()),
+ )
- override fun timeOnlyInterval(fromDateTime: LocalDateTime, toDateTime: LocalDateTime): String {
- return timeOnly(fromDateTime) + " - " + timeOnly(toDateTime)
- }
+ override fun timeOnlyInterval(fromDateTime: LocalDateTime, toDateTime: LocalDateTime): String =
+ timeOnly(fromDateTime) + " - " + timeOnly(toDateTime)
}
diff --git a/shared/src/androidMain/res/drawable/ic_baseline_insert_invitation_24.xml b/shared/src/androidMain/res/drawable/ic_baseline_insert_invitation_24.xml
index 98cf2e2a9..9087f64a5 100755
--- a/shared/src/androidMain/res/drawable/ic_baseline_insert_invitation_24.xml
+++ b/shared/src/androidMain/res/drawable/ic_baseline_insert_invitation_24.xml
@@ -1,9 +1,9 @@
+ android:width="24dp"
+ android:height="24dp"
+ android:viewportWidth="24.0"
+ android:viewportHeight="24.0">
+ android:pathData="M17,12h-5v5h5v-5zM16,1v2L8,3L8,1L6,1v2L5,3c-1.11,0 -1.99,0.9 -1.99,2L3,19c0,1.1 0.89,2 2,2h14c1.1,0 2,-0.9 2,-2L21,5c0,-1.1 -0.9,-2 -2,-2h-1L18,1h-2zM19,19L5,19L5,8h14v11z" />
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/Constants.kt
index af9b0f667..345a4e623 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/Koin.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/Koin.kt
index eda6e3b09..18f932f07 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/Koin.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/Koin.kt
@@ -59,7 +59,7 @@ fun initKoin(additionalModules: List): KoinApplication {
modules(
additionalModules +
platformModule +
- coreModule
+ coreModule,
)
}
@@ -67,13 +67,9 @@ fun initKoin(additionalModules: List): KoinApplication {
}
val intToLongAdapter = object : ColumnAdapter {
- override fun decode(databaseValue: Long): Int {
- return databaseValue.toInt()
- }
+ override fun decode(databaseValue: Long): Int = databaseValue.toInt()
- override fun encode(value: Int): Long {
- return value.toLong()
- }
+ override fun encode(value: Int): Long = value.toLong()
}
private val coreModule = module {
single {
@@ -82,11 +78,11 @@ private val coreModule = module {
sessionTableAdapter = SessionTable.Adapter(
startsAtAdapter = InstantSqlDelightAdapter,
endsAtAdapter = InstantSqlDelightAdapter,
- feedbackRatingAdapter = intToLongAdapter
+ feedbackRatingAdapter = intToLongAdapter,
),
sponsorGroupTableAdapter = SponsorGroupTable.Adapter(
- intToLongAdapter
- )
+ intToLongAdapter,
+ ),
)
}
single { Clock.System }
@@ -124,7 +120,7 @@ private val coreModule = module {
single {
SqlDelightSessionRepository(
dateTimeService = get(),
- sessionQueries = get().sessionQueries
+ sessionQueries = get().sessionQueries,
)
}
single {
@@ -185,12 +181,12 @@ private val coreModule = module {
}
single {
DefaultSettingsGateway(
- settingsRepository = get()
+ settingsRepository = get(),
)
}
single {
DefaultSettingsRepository(
- observableSettings = get()
+ observableSettings = get(),
)
}
single {
@@ -237,8 +233,6 @@ private val coreModule = module {
}
}
-internal inline fun Scope.getWith(vararg params: Any?): T {
- return get(parameters = { parametersOf(*params) })
-}
+internal inline fun Scope.getWith(vararg params: Any?): T = get(parameters = { parametersOf(*params) })
expect val platformModule: Module
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/AboutItem.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/AboutItem.kt
index 410d404ba..0b4631ff3 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/AboutItem.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/AboutItem.kt
@@ -1,7 +1,3 @@
package co.touchlab.droidcon.application.composite
-data class AboutItem(
- val icon: String,
- val title: String,
- val detail: String,
-)
+data class AboutItem(val icon: String, val title: String, val detail: String)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/Settings.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/Settings.kt
index ad851db9d..4d9bdd7b1 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/Settings.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/composite/Settings.kt
@@ -1,7 +1,3 @@
package co.touchlab.droidcon.application.composite
-data class Settings(
- val isFeedbackEnabled: Boolean,
- val isRemindersEnabled: Boolean,
- val useComposeForIos: Boolean,
-)
+data class Settings(val isFeedbackEnabled: Boolean, val isRemindersEnabled: Boolean, val useComposeForIos: Boolean)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/gateway/impl/DefaultSettingsGateway.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/gateway/impl/DefaultSettingsGateway.kt
index 80e860ec6..2bb3cca7c 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/gateway/impl/DefaultSettingsGateway.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/gateway/impl/DefaultSettingsGateway.kt
@@ -5,9 +5,7 @@ import co.touchlab.droidcon.application.gateway.SettingsGateway
import co.touchlab.droidcon.application.repository.SettingsRepository
import kotlinx.coroutines.flow.StateFlow
-class DefaultSettingsGateway(
- private val settingsRepository: SettingsRepository,
-) : SettingsGateway {
+class DefaultSettingsGateway(private val settingsRepository: SettingsRepository) : SettingsGateway {
override fun settings(): StateFlow = settingsRepository.settings
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultAboutRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultAboutRepository.kt
index 235570a8a..4d85f948d 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultAboutRepository.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultAboutRepository.kt
@@ -4,17 +4,13 @@ import co.touchlab.droidcon.application.composite.AboutItem
import co.touchlab.droidcon.application.repository.AboutRepository
import co.touchlab.droidcon.domain.service.impl.json.AboutJsonResourceDataSource
-class DefaultAboutRepository(
- private val aboutJsonResourceDataSource: AboutJsonResourceDataSource,
-) : AboutRepository {
+class DefaultAboutRepository(private val aboutJsonResourceDataSource: AboutJsonResourceDataSource) : AboutRepository {
- override suspend fun getAboutItems(): List {
- return aboutJsonResourceDataSource.getAboutItems().map {
- AboutItem(
- icon = it.icon,
- title = it.title,
- detail = it.detail,
- )
- }
+ override suspend fun getAboutItems(): List = aboutJsonResourceDataSource.getAboutItems().map {
+ AboutItem(
+ icon = it.icon,
+ title = it.title,
+ detail = it.detail,
+ )
}
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultSettingsRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultSettingsRepository.kt
index 665632975..fae75afc7 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultSettingsRepository.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/repository/impl/DefaultSettingsRepository.kt
@@ -9,9 +9,7 @@ import com.russhwolf.settings.set
import kotlinx.coroutines.flow.MutableStateFlow
@OptIn(ExperimentalSettingsApi::class)
-class DefaultSettingsRepository(
- private val observableSettings: ObservableSettings,
-) : SettingsRepository {
+class DefaultSettingsRepository(private val observableSettings: ObservableSettings) : SettingsRepository {
private companion object {
private const val SETTINGS_FEEDBACK_ENABLED_KEY = "SETTINGS_FEEDBACK_ENABLED"
private const val SETTINGS_REMINDERS_ENABLED_KEY = "SETTINGS_REMINDERS_ENABLED"
@@ -41,7 +39,7 @@ class DefaultSettingsRepository(
isFeedbackEnabled = isFeedbackEnabled,
isRemindersEnabled = isRemindersEnabled,
useComposeForIos = useComposeForIos,
- )
+ ),
)
override suspend fun set(settings: Settings) {
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/Notification.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/Notification.kt
index 4a4cfdb7c..92e463a5e 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/Notification.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/Notification.kt
@@ -6,13 +6,13 @@ sealed interface Notification {
sealed interface DeepLink : Notification
sealed interface Local : Notification {
- data class Reminder(
- val sessionId: Session.Id,
- ) : Local, DeepLink
+ data class Reminder(val sessionId: Session.Id) :
+ Local,
+ DeepLink
- data class Feedback(
- val sessionId: Session.Id,
- ) : Local, DeepLink
+ data class Feedback(val sessionId: Session.Id) :
+ Local,
+ DeepLink
}
sealed interface Remote : Notification {
@@ -20,12 +20,13 @@ sealed interface Notification {
}
object Keys {
- const val notificationType = "notification_type"
- const val sessionId = "session_id"
+ const val NOTIFICATION_TYPE = "notification_type"
+ const val SESSION_ID = "session_id"
}
+
object Values {
- const val reminderType = "reminder"
- const val feedbackType = "feedback"
- const val refreshDataType = "refresh_data"
+ const val REMINDER_TYPE = "reminder"
+ const val FEEDBACK_TYPE = "feedback"
+ const val REFRESH_DATA_TYPE = "refresh_data"
}
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/impl/DefaultNotificationSchedulingService.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/impl/DefaultNotificationSchedulingService.kt
index 2363e53b2..e62d2d206 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/impl/DefaultNotificationSchedulingService.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/application/service/impl/DefaultNotificationSchedulingService.kt
@@ -69,7 +69,7 @@ class DefaultNotificationSchedulingService(
sessionFlow
.combine(
settingsFlow,
- transform = { agenda, settings -> Triple(agenda, settings.isRemindersEnabled, settings.isFeedbackEnabled) }
+ transform = { agenda, settings -> Triple(agenda, settings.isRemindersEnabled, settings.isFeedbackEnabled) },
)
.distinctUntilChanged()
.collect { (agenda, isRemindersEnabled, isFeedbackEnabled) ->
@@ -100,7 +100,7 @@ class DefaultNotificationSchedulingService(
delivery = reminderDelivery,
dismiss = reminderDelivery.plus(
NotificationSchedulingService.REMINDER_DISMISS_OFFSET,
- DateTimeUnit.MINUTE
+ DateTimeUnit.MINUTE,
),
)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/ScheduleItem.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/ScheduleItem.kt
index dfc8ee8a1..8fce0afa1 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/ScheduleItem.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/ScheduleItem.kt
@@ -4,9 +4,4 @@ import co.touchlab.droidcon.domain.entity.Profile
import co.touchlab.droidcon.domain.entity.Room
import co.touchlab.droidcon.domain.entity.Session
-data class ScheduleItem(
- val session: Session,
- val isInConflict: Boolean,
- val room: Room?,
- val speakers: List,
-)
+data class ScheduleItem(val session: Session, val isInConflict: Boolean, val room: Room?, val speakers: List)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/SponsorGroupWithSponsors.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/SponsorGroupWithSponsors.kt
index 51ef710ee..0189f8657 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/SponsorGroupWithSponsors.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/composite/SponsorGroupWithSponsors.kt
@@ -3,7 +3,4 @@ package co.touchlab.droidcon.domain.composite
import co.touchlab.droidcon.domain.entity.Sponsor
import co.touchlab.droidcon.domain.entity.SponsorGroup
-data class SponsorGroupWithSponsors(
- val group: SponsorGroup,
- val sponsors: List,
-)
+data class SponsorGroupWithSponsors(val group: SponsorGroup, val sponsors: List)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Room.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Room.kt
index d3bfa39b7..7716393b1 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Room.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Room.kt
@@ -1,8 +1,5 @@
package co.touchlab.droidcon.domain.entity
-class Room(
- override val id: Id,
- val name: String,
-) : DomainEntity() {
+class Room(override val id: Id, val name: String) : DomainEntity() {
data class Id(val value: Long)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Session.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Session.kt
index 3a58a6c21..726812a05 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Session.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/Session.kt
@@ -21,16 +21,9 @@ class Session(
data class Id(val value: String)
- data class RSVP(
- val isAttending: Boolean,
- val isSent: Boolean,
- )
+ data class RSVP(val isAttending: Boolean, val isSent: Boolean)
- data class Feedback(
- val rating: Int,
- val comment: String,
- val isSent: Boolean,
- ) {
+ data class Feedback(val rating: Int, val comment: String, val isSent: Boolean) {
object Rating {
const val DISSATISFIED = 1
const val NORMAL = 2
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 93ec0485f..1bf0d84f8 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/entity/SponsorGroup.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/SponsorGroup.kt
index cfc107935..6f7991680 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/SponsorGroup.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/entity/SponsorGroup.kt
@@ -1,10 +1,6 @@
package co.touchlab.droidcon.domain.entity
-class SponsorGroup(
- override val id: Id,
- val displayPriority: Int,
- val isProminent: Boolean,
-) : DomainEntity() {
+class SponsorGroup(override val id: Id, val displayPriority: Int, val isProminent: Boolean) : DomainEntity() {
val name: String
get() = id.value
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSessionGateway.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSessionGateway.kt
index 382db92c2..32f0b2adf 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSessionGateway.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSessionGateway.kt
@@ -17,35 +17,28 @@ class DefaultSessionGateway(
private val scheduleService: ScheduleService,
) : SessionGateway {
- override fun observeSchedule(): Flow> {
- return sessionRepository.observeAll().map { sessions ->
- sessions.map { session ->
- scheduleItemForSession(session)
- }
+ override fun observeSchedule(): Flow> = sessionRepository.observeAll().map { sessions ->
+ sessions.map { session ->
+ scheduleItemForSession(session)
}
}
- override fun observeAgenda(): Flow> {
- return sessionRepository.observeAllAttending().map { sessions ->
- sessions.map { session ->
- scheduleItemForSession(session)
- }
+ override fun observeAgenda(): Flow> = sessionRepository.observeAllAttending().map { sessions ->
+ sessions.map { session ->
+ scheduleItemForSession(session)
}
}
- override fun observeScheduleItem(id: Session.Id): Flow {
- return sessionRepository.observe(id).map { session ->
- scheduleItemForSession(session)
- }
+ override fun observeScheduleItem(id: Session.Id): Flow = sessionRepository.observe(id).map { session ->
+ scheduleItemForSession(session)
}
- private suspend fun scheduleItemForSession(session: Session): ScheduleItem =
- ScheduleItem(
- session,
- scheduleService.isInConflict(session),
- session.room?.let { roomRepository.find(it) },
- profileRepository.getSpeakersBySession(session.id),
- )
+ private suspend fun scheduleItemForSession(session: Session): ScheduleItem = ScheduleItem(
+ session,
+ scheduleService.isInConflict(session),
+ session.room?.let { roomRepository.find(it) },
+ profileRepository.getSpeakersBySession(session.id),
+ )
override suspend fun setAttending(session: Session, attending: Boolean) {
sessionRepository.setRsvp(session.id, Session.RSVP(attending, false))
@@ -55,7 +48,5 @@ class DefaultSessionGateway(
sessionRepository.setFeedback(session.id, feedback)
}
- override suspend fun getScheduleItem(id: Session.Id): ScheduleItem? {
- return sessionRepository.find(id)?.let { scheduleItemForSession(it) }
- }
+ override suspend fun getScheduleItem(id: Session.Id): ScheduleItem? = sessionRepository.find(id)?.let { scheduleItemForSession(it) }
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSponsorGateway.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSponsorGateway.kt
index 89d63a5e3..6aeeb2814 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSponsorGateway.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/gateway/impl/DefaultSponsorGateway.kt
@@ -16,19 +16,16 @@ class DefaultSponsorGateway(
private val profileRepository: ProfileRepository,
) : SponsorGateway {
- override fun observeSponsors(): Flow> =
- sponsorGroupRepository.observeAll().map { groups ->
- groups.map { group ->
- SponsorGroupWithSponsors(
- group,
- sponsorRepository.allByGroupName(group.name)
- )
- }
+ override fun observeSponsors(): Flow> = sponsorGroupRepository.observeAll().map { groups ->
+ groups.map { group ->
+ SponsorGroupWithSponsors(
+ group,
+ sponsorRepository.allByGroupName(group.name),
+ )
}
+ }
- override fun observeSponsorById(id: Sponsor.Id): Flow =
- sponsorRepository.observe(id)
+ override fun observeSponsorById(id: Sponsor.Id): Flow = sponsorRepository.observe(id)
- override suspend fun getRepresentatives(sponsorId: Sponsor.Id): List =
- profileRepository.getSponsorRepresentatives(sponsorId)
+ override suspend fun getRepresentatives(sponsorId: Sponsor.Id): List = profileRepository.getSponsorRepresentatives(sponsorId)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/BaseRepository.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/BaseRepository.kt
index 2790bd415..4c76ae719 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/BaseRepository.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/repository/impl/BaseRepository.kt
@@ -6,21 +6,13 @@ import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.first
abstract class BaseRepository> : Repository {
- override suspend fun get(id: ID): ENTITY {
- return observe(id).first()
- }
+ override suspend fun get(id: ID): ENTITY = observe(id).first()
- override suspend fun find(id: ID): ENTITY? {
- return observeOrNull(id).first()
- }
+ override suspend fun find(id: ID): ENTITY? = observeOrNull(id).first()
- override fun observe(entity: ENTITY): Flow {
- return observe(entity.id)
- }
+ override fun observe(entity: ENTITY): Flow = observe(entity.id)
- override suspend fun all(): List {
- return observeAll().first()
- }
+ override suspend fun all(): List = observeAll().first()
override fun add(entity: ENTITY) {
if (!contains(entity.id)) {
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 8a41a7fab..3077042a4 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,11 +19,11 @@ 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 {
- return profileQueries.selectBySession(id.value, ::profileFactory).executeAsList()
- }
+ override suspend fun getSpeakersBySession(id: Session.Id): List =
+ profileQueries.selectBySession(id.value, ::profileFactory).executeAsList()
override fun setSessionSpeakers(session: Session, speakers: List) {
speakerQueries.deleteBySessionId(session.id.value)
@@ -48,26 +48,19 @@ class SqlDelightProfileRepository(
}
}
- override suspend fun getSponsorRepresentatives(sponsorId: Sponsor.Id): List {
- return profileQueries.selectBySponsor(sponsorName = sponsorId.name, sponsorGroupName = sponsorId.group, mapper = ::profileFactory)
+ override suspend fun getSponsorRepresentatives(sponsorId: Sponsor.Id): List =
+ profileQueries.selectBySponsor(sponsorName = sponsorId.name, sponsorGroupName = sponsorId.group, mapper = ::profileFactory)
.executeAsList()
- }
- override fun allSync(): List {
- return profileQueries.selectAll(mapper = ::profileFactory).executeAsList()
- }
+ override fun allSync(): List = profileQueries.selectAll(mapper = ::profileFactory).executeAsList()
- override fun observe(id: Profile.Id): Flow {
- return profileQueries.selectById(id.value, ::profileFactory).asFlow().mapToOne(Dispatchers.Main)
- }
+ override fun observe(id: Profile.Id): Flow =
+ profileQueries.selectById(id.value, ::profileFactory).asFlow().mapToOne(Dispatchers.Main)
- override fun observeOrNull(id: Profile.Id): Flow {
- return profileQueries.selectById(id.value, ::profileFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- }
+ override fun observeOrNull(id: Profile.Id): Flow =
+ profileQueries.selectById(id.value, ::profileFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- override fun observeAll(): Flow> {
- return profileQueries.selectAll(::profileFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAll(): Flow> = profileQueries.selectAll(::profileFactory).asFlow().mapToList(Dispatchers.Main)
override fun doUpsert(entity: Profile) {
profileQueries.upsert(
@@ -86,9 +79,7 @@ class SqlDelightProfileRepository(
profileQueries.delete(id.value)
}
- override fun contains(id: Profile.Id): Boolean {
- return profileQueries.existsById(id.value).executeAsOne().toBoolean()
- }
+ override fun contains(id: Profile.Id): Boolean = profileQueries.existsById(id.value).executeAsOne().toBoolean()
private fun profileFactory(
id: String,
@@ -98,7 +89,7 @@ class SqlDelightProfileRepository(
profilePicture: String?,
twitter: String?,
linkedIn: String?,
- website: String?
+ website: String?,
) = Profile(
id = Profile.Id(id),
fullName = fullName,
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 2c581a2a4..271ef2647 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,23 +10,18 @@ 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()
- override fun observe(id: Room.Id): Flow {
- return roomQueries.selectById(id.value, ::roomFactory).asFlow().mapToOne(Dispatchers.Main)
- }
+ override fun observe(id: Room.Id): Flow = roomQueries.selectById(id.value, ::roomFactory).asFlow().mapToOne(Dispatchers.Main)
- override fun observeOrNull(id: Room.Id): Flow {
- return roomQueries.selectById(id.value, ::roomFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- }
+ override fun observeOrNull(id: Room.Id): Flow =
+ roomQueries.selectById(id.value, ::roomFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- override fun observeAll(): Flow> {
- return roomQueries.selectAll(::roomFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAll(): Flow> = roomQueries.selectAll(::roomFactory).asFlow().mapToList(Dispatchers.Main)
override fun doUpsert(entity: Room) {
roomQueries.upsert(id = entity.id.value, name = entity.name)
@@ -36,9 +31,7 @@ class SqlDelightRoomRepository(
roomQueries.deleteById(id.value)
}
- override fun contains(id: Room.Id): Boolean {
- return roomQueries.existsById(id.value).executeAsOne() != 0L
- }
+ override fun contains(id: Room.Id): Boolean = roomQueries.existsById(id.value).executeAsOne() != 0L
private fun roomFactory(id: Long, name: String) = Room(id = Room.Id(id), name = name)
}
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 42a258885..24d5857b0 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,27 +14,21 @@ 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 {
- override fun observe(id: Session.Id): Flow {
- return sessionQueries.sessionById(id.value, ::sessionFactory).asFlow().mapToOne(Dispatchers.Main)
- }
+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)
fun sessionById(id: Session.Id): Session? = sessionQueries.sessionById(id.value, ::sessionFactory).executeAsOneOrNull()
- override fun observeOrNull(id: Session.Id): Flow {
- return sessionQueries.sessionById(id.value, ::sessionFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- }
+ override fun observeOrNull(id: Session.Id): Flow =
+ sessionQueries.sessionById(id.value, ::sessionFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- override fun observeAllAttending(): Flow> {
- return sessionQueries.attendingSessions(::sessionFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAllAttending(): Flow> =
+ sessionQueries.attendingSessions(::sessionFactory).asFlow().mapToList(Dispatchers.Main)
- override suspend fun allAttending(): List {
- return observeAllAttending().first()
- }
+ override suspend fun allAttending(): List = observeAllAttending().first()
override suspend fun setRsvp(sessionId: Session.Id, rsvp: Session.RSVP) {
sessionQueries.updateRsvp(rsvp.isAttending.toLong(), sessionId.value)
@@ -56,9 +50,7 @@ class SqlDelightSessionRepository(
override fun findSync(id: Session.Id): Session? = sessionQueries.sessionById(id.value, mapper = ::sessionFactory).executeAsOneOrNull()
- override fun observeAll(): Flow> {
- return sessionQueries.allSessions(::sessionFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAll(): Flow> = sessionQueries.allSessions(::sessionFactory).asFlow().mapToList(Dispatchers.Main)
override fun doUpsert(entity: Session) {
sessionQueries.upsert(
@@ -73,17 +65,13 @@ class SqlDelightSessionRepository(
rsvpSent = entity.rsvp.isSent.toLong(),
feedbackRating = entity.feedback?.rating,
feedbackComment = entity.feedback?.comment,
- feedbackSent = entity.feedback?.isSent?.toLong() ?: 0
+ feedbackSent = entity.feedback?.isSent?.toLong() ?: 0,
)
}
- override fun doDelete(id: Session.Id) {
- return sessionQueries.deleteById(id.value)
- }
+ override fun doDelete(id: Session.Id) = sessionQueries.deleteById(id.value)
- override fun contains(id: Session.Id): Boolean {
- return sessionQueries.existsById(id.value).executeAsOne().toBoolean()
- }
+ override fun contains(id: Session.Id): Boolean = sessionQueries.existsById(id.value).executeAsOne().toBoolean()
private fun sessionFactory(
id: String,
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 6b3108600..145bb588b 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,27 +10,22 @@ 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()
- override fun observe(id: SponsorGroup.Id): Flow {
- return sponsorGroupQueries.sponsorGroupByName(id.value, ::sponsorGroupFactory).asFlow().mapToOne(Dispatchers.Main)
- }
+ override fun observe(id: SponsorGroup.Id): Flow =
+ sponsorGroupQueries.sponsorGroupByName(id.value, ::sponsorGroupFactory).asFlow().mapToOne(Dispatchers.Main)
- override fun observeOrNull(id: SponsorGroup.Id): Flow {
- return sponsorGroupQueries.sponsorGroupByName(id.value, ::sponsorGroupFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- }
+ override fun observeOrNull(id: SponsorGroup.Id): Flow =
+ sponsorGroupQueries.sponsorGroupByName(id.value, ::sponsorGroupFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- override fun observeAll(): Flow> {
- return sponsorGroupQueries.selectAll(::sponsorGroupFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAll(): Flow> =
+ sponsorGroupQueries.selectAll(::sponsorGroupFactory).asFlow().mapToList(Dispatchers.Main)
- override fun contains(id: SponsorGroup.Id): Boolean {
- return sponsorGroupQueries.existsByName(id.value).executeAsOne().toBoolean()
- }
+ override fun contains(id: SponsorGroup.Id): Boolean = sponsorGroupQueries.existsByName(id.value).executeAsOne().toBoolean()
override fun doUpsert(entity: SponsorGroup) {
sponsorGroupQueries.upsert(
@@ -44,11 +39,7 @@ class SqlDelightSponsorGroupRepository(
sponsorGroupQueries.deleteByName(id.value)
}
- private fun sponsorGroupFactory(
- name: String,
- displayPriority: Int,
- isProminent: Boolean,
- ) = SponsorGroup(
+ private fun sponsorGroupFactory(name: String, displayPriority: Int, isProminent: Boolean) = SponsorGroup(
id = SponsorGroup.Id(name),
displayPriority = displayPriority,
isProminent = isProminent,
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 5f7986979..9d95d8c1e 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,29 +11,22 @@ 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 {
- return sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOne(Dispatchers.Main)
- }
+ override fun observe(id: Sponsor.Id): Flow =
+ sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOne(Dispatchers.Main)
- override fun observeOrNull(id: Sponsor.Id): Flow {
- return sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- }
+ override fun observeOrNull(id: Sponsor.Id): Flow =
+ sponsorQueries.sponsorById(id.name, id.group, ::sponsorFactory).asFlow().mapToOneOrNull(Dispatchers.Main)
- override fun observeAll(): Flow> {
- return sponsorQueries.selectAll(::sponsorFactory).asFlow().mapToList(Dispatchers.Main)
- }
+ override fun observeAll(): Flow> = sponsorQueries.selectAll(::sponsorFactory).asFlow().mapToList(Dispatchers.Main)
- override fun contains(id: Sponsor.Id): Boolean {
- return sponsorQueries.existsById(id.name, id.group).executeAsOne().toBoolean()
- }
+ override fun contains(id: Sponsor.Id): Boolean = sponsorQueries.existsById(id.name, id.group).executeAsOne().toBoolean()
- override suspend fun allByGroupName(group: String): List {
- return sponsorQueries.sponsorsByGroup(group, ::sponsorFactory).executeAsList()
- }
+ override suspend fun allByGroupName(group: String): List =
+ sponsorQueries.sponsorsByGroup(group, ::sponsorFactory).executeAsList()
override fun allSync(): List = sponsorQueries.selectAll(::sponsorFactory).executeAsList()
@@ -52,18 +45,12 @@ class SqlDelightSponsorRepository(
sponsorQueries.deleteById(id.name, id.group)
}
- private fun sponsorFactory(
- name: String,
- groupName: String,
- hasDetail: Boolean,
- description: String?,
- iconUrl: String,
- url: String,
- ) = Sponsor(
- id = Sponsor.Id(name, groupName),
- hasDetail = hasDetail,
- description = description,
- icon = Url(iconUrl),
- url = Url(url),
- )
+ private fun sponsorFactory(name: String, groupName: String, hasDetail: Boolean, description: String?, iconUrl: String, url: String) =
+ Sponsor(
+ id = Sponsor.Id(name, groupName),
+ hasDetail = hasDetail,
+ description = description,
+ icon = Url(iconUrl),
+ url = Url(url),
+ )
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultApiDataSource.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultApiDataSource.kt
index 1197e3be6..20c269b1c 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultApiDataSource.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultApiDataSource.kt
@@ -14,10 +14,7 @@ import io.ktor.http.takeFrom
import kotlinx.serialization.builtins.ListSerializer
import kotlinx.serialization.json.Json
-class DefaultApiDataSource(
- private val client: HttpClient,
- private val json: Json,
-) : DefaultSyncService.DataSource {
+class DefaultApiDataSource(private val client: HttpClient, private val json: Json) : DefaultSyncService.DataSource {
override suspend fun getSpeakers(): List {
val jsonString = client.get {
// We want to use the `sponsorsId` to get "speakers" for the sponsors as well as speakers for real sessions.
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultDateTimeService.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultDateTimeService.kt
index 5575bd9e4..52e05fd21 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultDateTimeService.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultDateTimeService.kt
@@ -8,20 +8,13 @@ import kotlinx.datetime.TimeZone
import kotlinx.datetime.toInstant
import kotlinx.datetime.toLocalDateTime
-class DefaultDateTimeService(
- private val clock: Clock,
- private val conferenceTimeZone: TimeZone,
-) : DateTimeService {
+class DefaultDateTimeService(private val clock: Clock, private val conferenceTimeZone: TimeZone) : DateTimeService {
override fun now(): Instant = clock.now()
override fun conferenceNow(): LocalDateTime = now().toConferenceDateTime()
- override fun Instant.toConferenceDateTime(): LocalDateTime {
- return toLocalDateTime(conferenceTimeZone)
- }
+ override fun Instant.toConferenceDateTime(): LocalDateTime = toLocalDateTime(conferenceTimeZone)
- override fun LocalDateTime.fromConferenceDateTime(): Instant {
- return toInstant(conferenceTimeZone)
- }
+ override fun LocalDateTime.fromConferenceDateTime(): Instant = toInstant(conferenceTimeZone)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultFeedbackService.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultFeedbackService.kt
index 14d280bc4..e9e169a58 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultFeedbackService.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultFeedbackService.kt
@@ -26,11 +26,9 @@ class DefaultFeedbackService(
json.decodeFromString(it)
} ?: emptySet()
- override suspend fun next(): Session? {
- return sessionGateway.observeAgenda().first()
- .firstOrNull { it.session.endsAt < clock.now() && !completedSessionIds.contains(it.session.id.value) }
- ?.session
- }
+ override suspend fun next(): Session? = sessionGateway.observeAgenda().first()
+ .firstOrNull { it.session.endsAt < clock.now() && !completedSessionIds.contains(it.session.id.value) }
+ ?.session
override suspend fun submit(session: Session, feedback: Session.Feedback) {
sessionGateway.setFeedback(session, feedback)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultScheduleService.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultScheduleService.kt
index 2e468e1f8..a98128399 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultScheduleService.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultScheduleService.kt
@@ -5,9 +5,7 @@ import co.touchlab.droidcon.domain.repository.SessionRepository
import co.touchlab.droidcon.domain.service.ScheduleService
import kotlinx.datetime.Instant
-class DefaultScheduleService(
- private val sessionRepository: SessionRepository,
-) : ScheduleService {
+class DefaultScheduleService(private val sessionRepository: SessionRepository) : ScheduleService {
override suspend fun isInConflict(session: Session): Boolean {
if (!session.rsvp.isAttending) {
@@ -19,8 +17,7 @@ class DefaultScheduleService(
}
}
- private fun ClosedRange.intersects(otherRange: ClosedRange): Boolean {
- return start.epochSeconds < otherRange.endInclusive.epochSeconds &&
+ private fun ClosedRange.intersects(otherRange: ClosedRange): Boolean =
+ start.epochSeconds < otherRange.endInclusive.epochSeconds &&
endInclusive.epochSeconds > otherRange.start.epochSeconds
- }
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultServerApi.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultServerApi.kt
index 3bbfa1d1e..116d4712c 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultServerApi.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultServerApi.kt
@@ -13,11 +13,7 @@ import io.ktor.http.isSuccess
import io.ktor.http.takeFrom
import kotlinx.serialization.json.Json
-class DefaultServerApi(
- private val userIdProvider: UserIdProvider,
- private val client: HttpClient,
- private val json: Json,
-) : ServerApi {
+class DefaultServerApi(private val userIdProvider: UserIdProvider, private val client: HttpClient, private val json: Json) : ServerApi {
override suspend fun setRsvp(sessionId: Session.Id, isAttending: Boolean): Boolean {
val methodName = if (isAttending) {
"sessionizeRsvpEvent"
@@ -31,16 +27,14 @@ class DefaultServerApi(
}.status.isSuccess()
}
- override suspend fun setFeedback(sessionId: Session.Id, rating: Int, comment: String): Boolean {
- return client.submitForm(
- formParameters = Parameters.build {
- append("rating", rating.toString())
- append("comment", comment)
- }
- ) {
- droidcon("/dataTest/sessionizeFeedbackEvent/${sessionId.value}/${userIdProvider.getId()}")
- }.status.isSuccess()
- }
+ override suspend fun setFeedback(sessionId: Session.Id, rating: Int, comment: String): Boolean = client.submitForm(
+ formParameters = Parameters.build {
+ append("rating", rating.toString())
+ append("comment", comment)
+ },
+ ) {
+ droidcon("/dataTest/sessionizeFeedbackEvent/${sessionId.value}/${userIdProvider.getId()}")
+ }.status.isSuccess()
private fun HttpRequestBuilder.droidcon(path: String) {
url {
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultSyncService.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultSyncService.kt
index 4e72b7f3a..2ecd5d1ea 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultSyncService.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultSyncService.kt
@@ -60,8 +60,10 @@ class DefaultSyncService(
private const val SESSIONIZE_SYNC_SINCE_LAST_MINUTES = 15
private const val SESSIONIZE_SYNC_NEXT_DELAY: Long = 1L * 60L * 60L * 1000L
+
// 5 minutes
private const val RSVP_SYNC_DELAY: Long = 5L * 60L * 1000L
+
// 5 minutes
private const val FEEDBACK_SYNC_DELAY: Long = 5L * 60L * 1000L
}
@@ -86,7 +88,10 @@ class DefaultSyncService(
while (isActive) {
val lastSessionizeSync = lastSessionizeSync
// If this is the first Sessionize sync or if the last sync occurred more than 2 hours ago.
- if (lastSessionizeSync == null || lastSessionizeSync <= dateTimeService.now().minus(SESSIONIZE_SYNC_SINCE_LAST_MINUTES, DateTimeUnit.MINUTE)) {
+ if (
+ lastSessionizeSync == null ||
+ lastSessionizeSync <= dateTimeService.now().minus(SESSIONIZE_SYNC_SINCE_LAST_MINUTES, DateTimeUnit.MINUTE)
+ ) {
try {
runApiDataSourcesSynchronization()
} catch (e: Exception) {
@@ -163,14 +168,12 @@ class DefaultSyncService(
}
}
- override suspend fun forceSynchronize(): Boolean {
- return try {
- runApiDataSourcesSynchronization()
- true
- } catch (e: Exception) {
- log.e(e) { "Failed to update repositories from API data source." }
- false
- }
+ override suspend fun forceSynchronize(): Boolean = try {
+ runApiDataSourcesSynchronization()
+ true
+ } catch (e: Exception) {
+ log.e(e) { "Failed to update repositories from API data source." }
+ false
}
private suspend fun seedLocalRepositoriesIfNeeded() {
@@ -280,7 +283,10 @@ class DefaultSyncService(
}
}
- private fun updateSponsorsFromDataSource(sponsorSessionsGroups: List, sponsors: SponsorsDto.SponsorCollectionDto) {
+ private fun updateSponsorsFromDataSource(
+ sponsorSessionsGroups: List,
+ sponsors: SponsorsDto.SponsorCollectionDto,
+ ): String {
val sponsorSessions = sponsorSessionsGroups.flatMap { it.sessions }.associateBy { it.id }
val sponsorGroupsToSponsorDtos = sponsors.groups.map { group ->
val groupName = (group.name.split('/').lastOrNull() ?: group.name)
@@ -291,7 +297,7 @@ class DefaultSyncService(
SponsorGroup(
id = SponsorGroup.Id(groupName),
displayPriority = group.fields.displayOrder.integerValue.toInt(),
- isProminent = group.fields.prominent?.booleanValue ?: false
+ isProminent = group.fields.prominent?.booleanValue ?: false,
) to group.fields.sponsors.arrayValue.values.map { it.mapValue.fields }
}
@@ -327,6 +333,7 @@ class DefaultSyncService(
profileRepository.setSponsorRepresentatives(sponsor, representativeIds)
}
+ return ""
}
private fun profileFactory(speakerDto: SpeakersDto.SpeakerDto): Profile {
@@ -347,7 +354,8 @@ class DefaultSyncService(
interface DataSource {
enum class Kind {
- Seed, Api
+ Seed,
+ Api,
}
suspend fun getSpeakers(): List
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultUserIdProvider.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultUserIdProvider.kt
index 53959911e..570341a90 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultUserIdProvider.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/DefaultUserIdProvider.kt
@@ -8,9 +8,7 @@ import com.russhwolf.settings.get
import com.russhwolf.settings.set
@OptIn(ExperimentalSettingsApi::class)
-class DefaultUserIdProvider(
- private val observableSettings: ObservableSettings,
-) : UserIdProvider {
+class DefaultUserIdProvider(private val observableSettings: ObservableSettings) : UserIdProvider {
companion object {
const val USER_ID_KEY = "USER_ID_KEY"
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/AboutDto.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/AboutDto.kt
index 5326ab829..c69ae7b7e 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/AboutDto.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/AboutDto.kt
@@ -5,9 +5,5 @@ import kotlinx.serialization.Serializable
object AboutDto {
@Serializable
- data class AboutItemDto(
- val icon: String,
- val title: String,
- val detail: String,
- )
+ data class AboutItemDto(val icon: String, val title: String, val detail: String)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/ScheduleDto.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/ScheduleDto.kt
index ae4de1ff9..e3d264c10 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/ScheduleDto.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/ScheduleDto.kt
@@ -7,17 +7,10 @@ import kotlinx.serialization.json.JsonArray
object ScheduleDto {
@Serializable
- data class DayDto(
- val date: String,
- val rooms: List,
- )
+ data class DayDto(val date: String, val rooms: List)
@Serializable
- data class RoomDto(
- val id: Long,
- val name: String,
- val sessions: List,
- )
+ data class RoomDto(val id: Long, val name: String, val sessions: List)
@Serializable
data class SessionDto(
@@ -39,10 +32,7 @@ object ScheduleDto {
)
@Serializable
- data class SpeakerDto(
- val id: String,
- val name: String,
- )
+ data class SpeakerDto(val id: String, val name: String)
fun List.sessions(): List = flatMap { day ->
day.rooms.flatMap { room ->
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SpeakersDto.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SpeakersDto.kt
index 3aa16801f..741eda486 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SpeakersDto.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SpeakersDto.kt
@@ -28,11 +28,7 @@ object SpeakersDto {
)
@Serializable
- data class LinkDto(
- val title: String,
- val url: String,
- val linkType: LinkType
- )
+ data class LinkDto(val title: String, val url: String, val linkType: LinkType)
@Serializable(with = LinkType.Companion::class)
data class LinkType(val value: String) {
@@ -67,8 +63,5 @@ object SpeakersDto {
}
@Serializable
- data class SessionDto(
- val id: Long,
- val name: String
- )
+ data class SessionDto(val id: Long, val name: String)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorSessionsDto.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorSessionsDto.kt
index 3aa253fcf..06abfbc48 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorSessionsDto.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorSessionsDto.kt
@@ -5,21 +5,11 @@ import kotlinx.serialization.Serializable
object SponsorSessionsDto {
@Serializable
- data class SessionGroupDto(
- val sessions: List
- )
+ data class SessionGroupDto(val sessions: List)
@Serializable
- data class SessionDto(
- val id: String,
- val title: String,
- val description: String?,
- val speakers: List,
- )
+ data class SessionDto(val id: String, val title: String, val description: String?, val speakers: List)
@Serializable
- data class SpeakerReferenceDto(
- val id: String,
- val name: String,
- )
+ data class SpeakerReferenceDto(val id: String, val name: String)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorsDto.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorsDto.kt
index 40c4e136c..a48ba4885 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorsDto.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/dto/SponsorsDto.kt
@@ -12,60 +12,32 @@ object SponsorsDto {
)
@Serializable
- data class SponsorGroupDto(
- val name: String,
- val fields: DocumentFields,
- val createTime: String,
- val updateTime: String,
- )
+ data class SponsorGroupDto(val name: String, val fields: DocumentFields, val createTime: String, val updateTime: String)
@Serializable
- data class DocumentFields(
- val displayOrder: DisplayOrder,
- val sponsors: Sponsors,
- val prominent: BooleanValue? = null,
- )
+ data class DocumentFields(val displayOrder: DisplayOrder, val sponsors: Sponsors, val prominent: BooleanValue? = null)
@Serializable
- data class DisplayOrder(
- val integerValue: String,
- )
+ data class DisplayOrder(val integerValue: String)
@Serializable
- data class Sponsors(
- val arrayValue: ArrayValue,
- )
+ data class Sponsors(val arrayValue: ArrayValue)
@Serializable
- data class ArrayValue(
- val values: List,
- )
+ data class ArrayValue(val values: List)
@Serializable
- data class Value(
- val mapValue: MapValue,
- )
+ data class Value(val mapValue: MapValue)
@Serializable
- data class MapValue(
- val fields: MapValueFields,
- )
+ data class MapValue(val fields: MapValueFields)
@Serializable
- data class MapValueFields(
- val sponsorId: StringValue? = null,
- val name: StringValue,
- val icon: StringValue,
- val url: StringValue,
- )
+ data class MapValueFields(val sponsorId: StringValue? = null, val name: StringValue, val icon: StringValue, val url: StringValue)
@Serializable
- data class StringValue(
- val stringValue: String,
- )
+ data class StringValue(val stringValue: String)
@Serializable
- data class BooleanValue(
- val booleanValue: Boolean,
- )
+ data class BooleanValue(val booleanValue: Boolean)
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/AboutJsonResourceDataSource.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/AboutJsonResourceDataSource.kt
index 7d9e7419b..140e090fa 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/AboutJsonResourceDataSource.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/AboutJsonResourceDataSource.kt
@@ -5,7 +5,6 @@ import kotlinx.serialization.builtins.ListSerializer
class AboutJsonResourceDataSource(private val jsonResourceReader: JsonResourceReader) {
- fun getAboutItems(): List {
- return jsonResourceReader.readAndDecodeResource("about.json", ListSerializer(AboutDto.AboutItemDto.serializer()))
- }
+ fun getAboutItems(): List =
+ jsonResourceReader.readAndDecodeResource("about.json", ListSerializer(AboutDto.AboutItemDto.serializer()))
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonResourceReader.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonResourceReader.kt
index adba7ad66..dab005b62 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonResourceReader.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonResourceReader.kt
@@ -4,10 +4,7 @@ import co.touchlab.droidcon.domain.service.impl.ResourceReader
import kotlinx.serialization.DeserializationStrategy
import kotlinx.serialization.json.Json
-class JsonResourceReader(
- private val resourceReader: ResourceReader,
- private val json: Json,
-) {
+class JsonResourceReader(private val resourceReader: ResourceReader, private val json: Json) {
internal fun readAndDecodeResource(name: String, strategy: DeserializationStrategy): T {
val text = resourceReader.readResource(name)
return json.decodeFromString(strategy, text)
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonSeedResourceDataSource.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonSeedResourceDataSource.kt
index fdb4c7143..9ceee8e30 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonSeedResourceDataSource.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/domain/service/impl/json/JsonSeedResourceDataSource.kt
@@ -7,29 +7,21 @@ import co.touchlab.droidcon.domain.service.impl.dto.SponsorSessionsDto
import co.touchlab.droidcon.domain.service.impl.dto.SponsorsDto
import kotlinx.serialization.builtins.ListSerializer
-class JsonSeedResourceDataSource(
- private val jsonResourceReader: JsonResourceReader
-) : DefaultSyncService.DataSource {
+class JsonSeedResourceDataSource(private val jsonResourceReader: JsonResourceReader) : DefaultSyncService.DataSource {
- override suspend fun getSpeakers(): List {
- return jsonResourceReader.readAndDecodeResource("speakers.json", ListSerializer(SpeakersDto.SpeakerDto.serializer()))
- }
+ override suspend fun getSpeakers(): List =
+ jsonResourceReader.readAndDecodeResource("speakers.json", ListSerializer(SpeakersDto.SpeakerDto.serializer()))
- override suspend fun getSchedule(): List {
- return jsonResourceReader.readAndDecodeResource("schedule.json", ListSerializer(ScheduleDto.DayDto.serializer()))
- }
+ override suspend fun getSchedule(): List =
+ jsonResourceReader.readAndDecodeResource("schedule.json", ListSerializer(ScheduleDto.DayDto.serializer()))
- override suspend fun getSponsorSessions(): List {
- return jsonResourceReader.readAndDecodeResource(
- "sponsor_sessions.json",
- ListSerializer(SponsorSessionsDto.SessionGroupDto.serializer())
- )
- }
+ override suspend fun getSponsorSessions(): List = jsonResourceReader.readAndDecodeResource(
+ "sponsor_sessions.json",
+ ListSerializer(SponsorSessionsDto.SessionGroupDto.serializer()),
+ )
- override suspend fun getSponsors(): SponsorsDto.SponsorCollectionDto {
- return jsonResourceReader.readAndDecodeResource(
- "sponsors.json",
- SponsorsDto.SponsorCollectionDto.serializer(),
- )
- }
+ override suspend fun getSponsors(): SponsorsDto.SponsorCollectionDto = jsonResourceReader.readAndDecodeResource(
+ "sponsors.json",
+ SponsorsDto.SponsorCollectionDto.serializer(),
+ )
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/dto/WebLink.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/dto/WebLink.kt
index 4e73642a6..08eaa1965 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/dto/WebLink.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/dto/WebLink.kt
@@ -6,7 +6,6 @@ data class WebLink(val range: IntRange, val link: String) {
companion object {
- fun fromUrl(url: Url): WebLink =
- WebLink(IntRange(0, url.string.length - 1), url.string)
+ fun fromUrl(url: Url): WebLink = WebLink(IntRange(0, url.string.length - 1), url.string)
}
}
diff --git a/shared/src/commonMain/kotlin/co/touchlab/droidcon/util/AppChecker.kt b/shared/src/commonMain/kotlin/co/touchlab/droidcon/util/AppChecker.kt
index 472a47671..a8e44aea4 100644
--- a/shared/src/commonMain/kotlin/co/touchlab/droidcon/util/AppChecker.kt
+++ b/shared/src/commonMain/kotlin/co/touchlab/droidcon/util/AppChecker.kt
@@ -15,7 +15,5 @@ object AppChecker {
}
}
- private fun toMD5(text: String): String {
- return text.encodeToByteArray().md5().hex
- }
+ private fun toMD5(text: String): String = text.encodeToByteArray().md5().hex
}
diff --git a/shared/src/iosMain/kotlin/co/touchlab/droidcon/MainScope.kt b/shared/src/iosMain/kotlin/co/touchlab/droidcon/MainScope.kt
index e36ec8769..782d5ef11 100644
--- a/shared/src/iosMain/kotlin/co/touchlab/droidcon/MainScope.kt
+++ b/shared/src/iosMain/kotlin/co/touchlab/droidcon/MainScope.kt
@@ -2,10 +2,10 @@ package co.touchlab.droidcon
import co.touchlab.droidcon.util.printThrowable
import co.touchlab.kermit.Logger
+import kotlin.coroutines.CoroutineContext
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.SupervisorJob
-import kotlin.coroutines.CoroutineContext
class MainScope(private val mainContext: CoroutineContext, private val log: Logger) : CoroutineScope {
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 e9976814d..01c4a01c6 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")
}
diff --git a/shared/src/iosMain/kotlin/co/touchlab/droidcon/service/IOSNotificationService.kt b/shared/src/iosMain/kotlin/co/touchlab/droidcon/service/IOSNotificationService.kt
index f47f9a2fa..92058b876 100644
--- a/shared/src/iosMain/kotlin/co/touchlab/droidcon/service/IOSNotificationService.kt
+++ b/shared/src/iosMain/kotlin/co/touchlab/droidcon/service/IOSNotificationService.kt
@@ -28,10 +28,7 @@ import platform.UserNotifications.UNNotificationRequest
import platform.UserNotifications.UNNotificationSound
import platform.UserNotifications.UNUserNotificationCenter
-class IOSNotificationService(
- private val log: Logger,
- private val syncService: SyncService,
-) : NotificationService {
+class IOSNotificationService(private val log: Logger, private val syncService: SyncService) : NotificationService {
private val notificationCenter = UNUserNotificationCenter.currentNotificationCenter()
private var notificationHandler: DeepLinkNotificationHandler? = null
@@ -50,20 +47,25 @@ class IOSNotificationService(
when (notificationSettings.authorizationStatus) {
UNAuthorizationStatusNotDetermined -> {
val requestOptions = UNAuthorizationOptionAlert or UNAuthorizationOptionSound
- val (isAuthorized, error) = wrapMultiThreadCallback { notificationCenter.requestAuthorizationWithOptions(requestOptions, it) }
+ val (isAuthorized, error) = wrapMultiThreadCallback {
+ notificationCenter.requestAuthorizationWithOptions(requestOptions, it)
+ }
if (error != null) {
log.i { "Notifications authorization request failed with '$error'." }
}
return isAuthorized
}
+
UNAuthorizationStatusDenied -> {
log.i { "Notifications not authorized." }
return false
}
+
UNAuthorizationStatusAuthorized -> {
log.i { "Notifications authorized." }
return true
}
+
else -> return false
}
}
@@ -87,14 +89,14 @@ class IOSNotificationService(
content.setBody(body)
content.setSound(UNNotificationSound.defaultSound)
val (typeValue, sessionId) = when (notification) {
- is Notification.Local.Feedback -> Notification.Values.feedbackType to notification.sessionId
- is Notification.Local.Reminder -> Notification.Values.reminderType to notification.sessionId
+ is Notification.Local.Feedback -> Notification.Values.FEEDBACK_TYPE to notification.sessionId
+ is Notification.Local.Reminder -> Notification.Values.REMINDER_TYPE to notification.sessionId
}
content.setUserInfo(
mapOf(
- Notification.Keys.notificationType to typeValue,
- Notification.Keys.sessionId to sessionId.value,
- )
+ Notification.Keys.NOTIFICATION_TYPE to typeValue,
+ Notification.Keys.SESSION_ID to sessionId.value,
+ ),
)
val request = UNNotificationRequest.requestWithIdentifier("${sessionId.value}-$typeValue", content, trigger)
@@ -108,7 +110,9 @@ class IOSNotificationService(
}
override suspend fun cancel(sessionIds: List) {
- if (sessionIds.isEmpty()) { return }
+ if (sessionIds.isEmpty()) {
+ return
+ }
log.v { "Cancelling scheduled notifications with IDs: [${sessionIds.joinToString { it.value }}]" }
notificationCenter.removePendingNotificationRequestsWithIdentifiers(sessionIds.map { it.value })
}
@@ -138,24 +142,24 @@ class IOSNotificationService(
log.w { "notificationHandler not registered when received $notification" }
}
}
+
Notification.Remote.RefreshData -> syncService.forceSynchronize()
}
}
- private fun Map.parseNotification(): Notification? {
- return when (val typeValue = this[Notification.Keys.notificationType] as? String) {
- Notification.Values.reminderType -> this.parseReminderNotification()
- Notification.Values.feedbackType -> this.parseFeedbackNotification()
- Notification.Values.refreshDataType -> Notification.Remote.RefreshData
+ private fun Map.parseNotification(): Notification? =
+ when (val typeValue = this[Notification.Keys.NOTIFICATION_TYPE] as? String) {
+ Notification.Values.REMINDER_TYPE -> this.parseReminderNotification()
+ Notification.Values.FEEDBACK_TYPE -> this.parseFeedbackNotification()
+ Notification.Values.REFRESH_DATA_TYPE -> Notification.Remote.RefreshData
else -> {
log.e { "Unknown notification type <$typeValue>, ignoring." }
null
}
}
- }
private fun Map.parseReminderNotification(): Notification.Local.Reminder? {
- val sessionId = this[Notification.Keys.sessionId] as? String ?: run {
+ val sessionId = this[Notification.Keys.SESSION_ID] as? String ?: run {
log.e { "Couldn't parse reminder notification. Session ID doesn't exist or isn't String." }
return null
}
@@ -166,7 +170,7 @@ class IOSNotificationService(
}
private fun Map.parseFeedbackNotification(): Notification.Local.Feedback? {
- val sessionId = this[Notification.Keys.sessionId] as? String ?: run {
+ val sessionId = this[Notification.Keys.SESSION_ID] as? String ?: run {
log.e { "Couldn't parse feedback notification. Session ID doesn't exist or isn't String." }
return null
}
diff --git a/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/BundleResourceReader.kt b/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/BundleResourceReader.kt
index bbff7c727..2b94136a8 100644
--- a/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/BundleResourceReader.kt
+++ b/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/BundleResourceReader.kt
@@ -17,23 +17,25 @@ import platform.darwin.NSObjectMeta
@OptIn(kotlinx.cinterop.ExperimentalForeignApi::class)
@BetaInteropApi
-class BundleResourceReader(
- private val bundle: NSBundle = NSBundle.bundleForClass(BundleMarker)
-) : ResourceReader {
+class BundleResourceReader(private val bundle: NSBundle = NSBundle.bundleForClass(BundleMarker)) : ResourceReader {
override fun readResource(name: String): String {
// TODO: Catch iOS-only exceptions and map them to common ones.
val (filename, type) = when (val lastPeriodIndex = name.lastIndexOf('.')) {
0 -> {
null to name.drop(1)
}
+
in 1..Int.MAX_VALUE -> {
name.take(lastPeriodIndex) to name.drop(lastPeriodIndex + 1)
}
+
else -> {
name to null
}
}
- val path = bundle.pathForResource(filename, type) ?: error("Couldn't get path of $name (parsed as: ${listOfNotNull(filename, type).joinToString(".")})")
+ val path = bundle.pathForResource(filename, type) ?: error(
+ "Couldn't get path of $name (parsed as: ${listOfNotNull(filename, type).joinToString(".")})",
+ )
return memScoped {
val errorPtr = alloc>()
diff --git a/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/wrapMultiThreadCallback.kt b/shared/src/iosMain/kotlin/co/touchlab/droidcon/util/WrapMultiThreadCallback.kt
similarity index 100%
rename from shared/src/iosMain/kotlin/co/touchlab/droidcon/util/wrapMultiThreadCallback.kt
rename to shared/src/iosMain/kotlin/co/touchlab/droidcon/util/WrapMultiThreadCallback.kt