diff --git a/core/model/build.gradle.kts b/core/model/build.gradle.kts index fc770724a..5c609d405 100644 --- a/core/model/build.gradle.kts +++ b/core/model/build.gradle.kts @@ -10,6 +10,7 @@ android.namespace = "io.github.droidkaigi.confsched2023.core.model" @Suppress("UnusedPrivateProperty") kotlin { + explicitApi() sourceSets { commonMain { dependencies { diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/data/contributors/StampRepository.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/data/contributors/StampRepository.kt index a5d2c3125..285afa200 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/data/contributors/StampRepository.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/data/contributors/StampRepository.kt @@ -2,7 +2,7 @@ package io.github.droidkaigi.confsched2023.data.contributors import kotlinx.coroutines.flow.Flow -interface StampRepository { +public interface StampRepository { - fun getStampEnabledStream(): Flow + public fun getStampEnabledStream(): Flow } diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/AboutItem.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/AboutItem.kt index 62c0b8329..ab7a2e60b 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/AboutItem.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/AboutItem.kt @@ -1,13 +1,13 @@ package io.github.droidkaigi.confsched2023.model -sealed class AboutItem { - data object Sponsors : AboutItem() - data object Contributors : AboutItem() - data object Staff : AboutItem() - data object CodeOfConduct : AboutItem() - data object License : AboutItem() - data object PrivacyPolicy : AboutItem() - data object YouTube : AboutItem() - data object X : AboutItem() - data object Medium : AboutItem() +public sealed class AboutItem { + public data object Sponsors : AboutItem() + public data object Contributors : AboutItem() + public data object Staff : AboutItem() + public data object CodeOfConduct : AboutItem() + public data object License : AboutItem() + public data object PrivacyPolicy : AboutItem() + public data object YouTube : AboutItem() + public data object X : AboutItem() + public data object Medium : AboutItem() } diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/ContributorsRepository.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/ContributorsRepository.kt index ef0c669de..dc13b2a67 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/ContributorsRepository.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/ContributorsRepository.kt @@ -3,8 +3,8 @@ package io.github.droidkaigi.confsched2023.model import kotlinx.collections.immutable.PersistentList import kotlinx.coroutines.flow.Flow -interface ContributorsRepository { +public interface ContributorsRepository { - fun contributors(): Flow> - suspend fun refresh() + public fun contributors(): Flow> + public suspend fun refresh() } diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/DroidKaigi2023Day.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/DroidKaigi2023Day.kt index 655dc0a2f..d54c5aef8 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/DroidKaigi2023Day.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/DroidKaigi2023Day.kt @@ -45,7 +45,7 @@ public enum class DroidKaigi2023Day( ), ; - fun getDropDownText(language: String): String { + public fun getDropDownText(language: String): String { val japanese = "ja" val date = this.start.toLocalDateTime(TimeZone.currentSystemDefault()) @@ -85,7 +85,7 @@ public enum class DroidKaigi2023Day( /** * @return appropriate initial day for now */ - fun initialSelectedDay(): DroidKaigi2023Day { + public fun initialSelectedDay(): DroidKaigi2023Day { val reversedEntries = entries.sortedByDescending { it.day } var selectedDay = reversedEntries.last() for (entry in reversedEntries) { diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/FloorLevel.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/FloorLevel.kt index 8963a7a73..7a746bd5c 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/FloorLevel.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/FloorLevel.kt @@ -1,7 +1,7 @@ package io.github.droidkaigi.confsched2023.model public enum class FloorLevel( - val floorName: String, + public val floorName: String, ) { Basement("B1F"), Ground("1F"), diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/RoomType.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/RoomType.kt index 7edffad9a..e5032ab5e 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/RoomType.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/RoomType.kt @@ -3,7 +3,7 @@ package io.github.droidkaigi.confsched2023.model /** * Please use [TimetableRoom] to get room information. */ -enum class RoomType { +public enum class RoomType { RoomA, RoomB, RoomC, diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SessionsRepository.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SessionsRepository.kt index 425372681..e8eee9c97 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SessionsRepository.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SessionsRepository.kt @@ -2,8 +2,8 @@ package io.github.droidkaigi.confsched2023.model import kotlinx.coroutines.flow.Flow -interface SessionsRepository { - fun getTimetableStream(): Flow - fun getTimetableItemWithBookmarkStream(id: TimetableItemId): Flow> - suspend fun toggleBookmark(id: TimetableItemId) +public interface SessionsRepository { + public fun getTimetableStream(): Flow + public fun getTimetableItemWithBookmarkStream(id: TimetableItemId): Flow> + public suspend fun toggleBookmark(id: TimetableItemId) } diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SideEvent.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SideEvent.kt index 4f7c9862f..48e36993b 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SideEvent.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/SideEvent.kt @@ -4,6 +4,7 @@ import io.github.droidkaigi.confsched2023.model.FloorLevel.Basement import io.github.droidkaigi.confsched2023.model.FloorLevel.Ground import io.github.droidkaigi.confsched2023.model.SideEvent.Mark.Favorite import io.github.droidkaigi.confsched2023.model.SideEvent.MarkColor.Pink +import kotlinx.collections.immutable.PersistentList import kotlinx.collections.immutable.persistentListOf public data class SideEvent( @@ -16,18 +17,18 @@ public data class SideEvent( val imageLink: String?, ) { - enum class Mark(val color: MarkColor) { + public enum class Mark(public val color: MarkColor) { Favorite(Pink), } - enum class MarkColor { + public enum class MarkColor { Pink, Orange, Blue, Red, Purple } public companion object } -val SideEvents = persistentListOf( +public val SideEvents: PersistentList = persistentListOf( SideEvent( title = MultiLangText( jaTitle = "アプリFiresideチャット(これは仮で後で消えます)", diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Staff.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Staff.kt index b0d776961..e883d1cfa 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Staff.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Staff.kt @@ -9,11 +9,11 @@ public data class Staff( val profileUrl: String, val iconUrl: String, ) { - companion object + public companion object } // create fakes -fun Staff.Companion.fakes(): PersistentList { +public fun Staff.Companion.fakes(): PersistentList { return (1..20).map { Staff( id = it.toLong(), diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/StaffRepository.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/StaffRepository.kt index f8da281ce..d05b0f3a0 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/StaffRepository.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/StaffRepository.kt @@ -4,7 +4,7 @@ import kotlinx.collections.immutable.PersistentList import kotlinx.coroutines.flow.Flow import kotlin.coroutines.cancellation.CancellationException -interface StaffRepository { +public interface StaffRepository { public fun staffs(): Flow> diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Stamp.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Stamp.kt index bb20d522b..538672f4d 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Stamp.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/Stamp.kt @@ -1,11 +1,11 @@ package io.github.droidkaigi.confsched2023.model -data class Stamp( +public data class Stamp( val hasDrawableResId: Int, val lottieRawId: Int, val notHasDrawableResId: Int, val hasStamp: Boolean = false, val contentDescription: String, ) { - fun getDrawableResId() = if (hasStamp) hasDrawableResId else notHasDrawableResId + public fun getDrawableResId(): Int = if (hasStamp) hasDrawableResId else notHasDrawableResId } diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableCategory.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableCategory.kt index 2607d8f92..58e7631ee 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableCategory.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableCategory.kt @@ -7,7 +7,7 @@ public data class TimetableCategory( public companion object } -fun TimetableCategory.Companion.fakes(): List { +public fun TimetableCategory.Companion.fakes(): List { return listOf( TimetableCategory( id = 1, diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableItem.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableItem.kt index b1c44241f..229f6f74c 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableItem.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableItem.kt @@ -92,7 +92,7 @@ public sealed class TimetableItem { speakers.joinToString(", ") { it.name } } - fun getSupportedLangString(isJapaneseLocale: Boolean): String { + public fun getSupportedLangString(isJapaneseLocale: Boolean): String { val japanese = if (isJapaneseLocale) "日本語" else "Japanese" val english = if (isJapaneseLocale) "英語" else "English" val japaneseWithInterpretation = diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableLanguage.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableLanguage.kt index 7645a9241..b43cb7b9e 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableLanguage.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableLanguage.kt @@ -4,7 +4,7 @@ public data class TimetableLanguage( val langOfSpeaker: String, val isInterpretationTarget: Boolean, ) { - val labels = if (langOfSpeaker == Lang.MIXED.tagName) { + val labels: List = if (langOfSpeaker == Lang.MIXED.tagName) { listOf(Lang.MIXED.tagName) } else if (isInterpretationTarget) { listOf(Lang.ENGLISH.tagName, Lang.JAPANESE.tagName) @@ -12,7 +12,7 @@ public data class TimetableLanguage( listOf(langOfSpeaker.take(2)) } - fun toLang() = if (isInterpretationTarget) { + public fun toLang(): Lang = if (isInterpretationTarget) { Lang.MIXED } else { Lang.values().firstOrNull { it.tagName == langOfSpeaker.take(2) } ?: Lang.MIXED diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableRoom.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableRoom.kt index 207490028..28e78a900 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableRoom.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableRoom.kt @@ -6,7 +6,7 @@ public data class TimetableRoom( val type: RoomType, ) -val TimetableRoom.nameAndFloor: String +public val TimetableRoom.nameAndFloor: String get() { val basementFloorString = MultiLangText(jaTitle = "地下1階", enTitle = "B1F") val floor = when (type) { diff --git a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableSessionType.kt b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableSessionType.kt index c216fd565..afb70f5c1 100644 --- a/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableSessionType.kt +++ b/core/model/src/commonMain/kotlin/io/github/droidkaigi/confsched2023/model/TimetableSessionType.kt @@ -1,8 +1,8 @@ package io.github.droidkaigi.confsched2023.model -enum class TimetableSessionType( - val key: String, - val label: MultiLangText, +public enum class TimetableSessionType( + public val key: String, + public val label: MultiLangText, ) { WELCOME_TALK( key = "WELCOME_TALK", @@ -34,8 +34,8 @@ enum class TimetableSessionType( ), ; - companion object { - fun ofOrNull(key: String): TimetableSessionType? { + public companion object { + public fun ofOrNull(key: String): TimetableSessionType? { return values().firstOrNull { it.key == key }