diff --git a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/EmotionAnalyzer.kt b/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/EmotionAnalyzer.kt deleted file mode 100644 index 06be275c..00000000 --- a/core/common/src/main/kotlin/com/ninecraft/booket/core/common/utils/EmotionAnalyzer.kt +++ /dev/null @@ -1,34 +0,0 @@ -package com.ninecraft.booket.core.common.utils - -import com.ninecraft.booket.core.model.EmotionModel - -data class EmotionAnalysisResult( - val topEmotions: List, - val displayType: EmotionDisplayType, -) - -enum class EmotionDisplayType { - NONE, // 모든 감정의 count가 0 - SINGLE, // 1개 감정이 1위 - DUAL, // 2개 감정이 공동 1위 - BALANCED, // 3개 이상 감정이 공동 1위 -} - -fun analyzeEmotions(emotions: List): EmotionAnalysisResult { - val maxCount = emotions.maxOf { it.count } - - // 모든 감정의 count가 0인 경우 - if (maxCount == 0) { - return EmotionAnalysisResult(emptyList(), EmotionDisplayType.NONE) - } - - val topEmotions = emotions.filter { it.count == maxCount } - - val displayType = when (topEmotions.size) { - 1 -> EmotionDisplayType.SINGLE - 2 -> EmotionDisplayType.DUAL - else -> EmotionDisplayType.BALANCED - } - - return EmotionAnalysisResult(topEmotions, displayType) -} diff --git a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt index c8943668..c1ca3cb5 100644 --- a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt +++ b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/AuthRepository.kt @@ -1,7 +1,7 @@ package com.ninecraft.booket.core.data.api.repository -import com.ninecraft.booket.core.model.AutoLoginState -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.model.state.AutoLoginState +import com.ninecraft.booket.core.model.state.UserState import kotlinx.coroutines.flow.Flow interface AuthRepository { diff --git a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/RecordRepository.kt b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/RecordRepository.kt index 2c13ec33..37064766 100644 --- a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/RecordRepository.kt +++ b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/RecordRepository.kt @@ -1,6 +1,6 @@ package com.ninecraft.booket.core.data.api.repository -import com.ninecraft.booket.core.model.ReadingRecordModelV2 +import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.core.model.ReadingRecordsModel interface RecordRepository { @@ -11,18 +11,18 @@ interface RecordRepository { review: String, primaryEmotion: String, detailEmotionTagIds: List, - ): Result + ): Result suspend fun getReadingRecords( userBookId: String, sort: String, page: Int, size: Int, - ): Result // TODO: V2로 변경 필요 + ): Result suspend fun getRecordDetail( readingRecordId: String, - ): Result + ): Result suspend fun editRecord( readingRecordId: String, @@ -31,7 +31,7 @@ interface RecordRepository { review: String, primaryEmotion: String, detailEmotionTagIds: List, - ): Result + ): Result suspend fun deleteRecord( readingRecordId: String, diff --git a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt index 20618cc1..9ea1524c 100644 --- a/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt +++ b/core/data/api/src/main/kotlin/com/ninecraft/booket/core/data/api/repository/UserRepository.kt @@ -1,6 +1,6 @@ package com.ninecraft.booket.core.data.api.repository -import com.ninecraft.booket.core.model.OnboardingState +import com.ninecraft.booket.core.model.state.OnboardingState import com.ninecraft.booket.core.model.TermsAgreementModel import com.ninecraft.booket.core.model.UserProfileModel import kotlinx.coroutines.flow.Flow diff --git a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt index 822eb87e..d3ffa85e 100644 --- a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt +++ b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/mapper/ResponseToModel.kt @@ -6,7 +6,6 @@ import com.ninecraft.booket.core.model.BookSearchModel import com.ninecraft.booket.core.model.BookSummaryModel import com.ninecraft.booket.core.model.BookUpsertModel import com.ninecraft.booket.core.model.DetailEmotionModel -import com.ninecraft.booket.core.model.Emotion import com.ninecraft.booket.core.model.EmotionCode import com.ninecraft.booket.core.model.EmotionGroupModel import com.ninecraft.booket.core.model.EmotionGroupsModel @@ -18,10 +17,8 @@ import com.ninecraft.booket.core.model.LibraryModel import com.ninecraft.booket.core.model.PageInfoModel import com.ninecraft.booket.core.model.PrimaryEmotionModel import com.ninecraft.booket.core.model.ReadingRecordModel -import com.ninecraft.booket.core.model.ReadingRecordModelV2 import com.ninecraft.booket.core.model.ReadingRecordsModel import com.ninecraft.booket.core.model.RecentBookModel -import com.ninecraft.booket.core.model.RecordRegisterModel import com.ninecraft.booket.core.model.SeedModel import com.ninecraft.booket.core.model.TermsAgreementModel import com.ninecraft.booket.core.model.UserProfileModel @@ -42,10 +39,8 @@ import com.ninecraft.booket.core.network.response.LibraryResponse import com.ninecraft.booket.core.network.response.PageInfo import com.ninecraft.booket.core.network.response.PrimaryEmotion import com.ninecraft.booket.core.network.response.ReadingRecord -import com.ninecraft.booket.core.network.response.ReadingRecordV2 import com.ninecraft.booket.core.network.response.ReadingRecordsResponse import com.ninecraft.booket.core.network.response.RecentBook -import com.ninecraft.booket.core.network.response.RecordRegisterResponse import com.ninecraft.booket.core.network.response.SeedResponse import com.ninecraft.booket.core.network.response.TermsAgreementResponse import com.ninecraft.booket.core.network.response.UserProfileResponse @@ -217,21 +212,9 @@ internal fun DetailEmotion.toModel(): DetailEmotionModel { ) } -internal fun RecordRegisterResponse.toModel(): RecordRegisterModel { - return RecordRegisterModel( - id = id, - userBookId = userBookId, - pageNumber = pageNumber, - quote = quote, - emotionTags = emotionTags, - review = review ?: "", - createdAt = createdAt, - updatedAt = updatedAt, - ) -} - internal fun ReadingRecordsResponse.toModel(): ReadingRecordsModel { return ReadingRecordsModel( + representativeEmotion = representativeEmotion?.toModel(), lastPage = lastPage, totalResults = totalResults, startIndex = startIndex, @@ -242,23 +225,6 @@ internal fun ReadingRecordsResponse.toModel(): ReadingRecordsModel { internal fun ReadingRecord.toModel(): ReadingRecordModel { return ReadingRecordModel( - id = id, - userBookId = userBookId, - pageNumber = pageNumber, - quote = quote, - review = review ?: "", - emotionTags = emotionTags, - createdAt = createdAt, - updatedAt = updatedAt, - bookTitle = bookTitle ?: "", - bookPublisher = bookPublisher ?: "", - bookCoverImageUrl = bookCoverImageUrl ?: "", - author = author ?: "", - ) -} - -internal fun ReadingRecordV2.toModel(): ReadingRecordModelV2 { - return ReadingRecordModelV2( id = id, userBookId = userBookId, pageNumber = pageNumber, @@ -309,9 +275,8 @@ internal fun SeedResponse.toModel(): SeedModel { } internal fun Category.toEmotionModel(): EmotionModel? { - val emotion = Emotion.fromDisplayName(name) ?: return null return EmotionModel( - name = emotion, + code = EmotionCode.fromDisplayName(name) ?: return null, count = count, ) } diff --git a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt index 4172d9e0..9f8fe63b 100644 --- a/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt +++ b/core/data/impl/src/main/kotlin/com/ninecraft/booket/core/data/impl/repository/DefaultAuthRepository.kt @@ -3,12 +3,12 @@ package com.ninecraft.booket.core.data.impl.repository import com.ninecraft.booket.core.common.utils.runSuspendCatching import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.datastore.api.datasource.TokenDataSource -import com.ninecraft.booket.core.model.AutoLoginState -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.di.DataScope +import com.ninecraft.booket.core.model.state.AutoLoginState +import com.ninecraft.booket.core.model.state.UserState import com.ninecraft.booket.core.network.request.LoginRequest import com.ninecraft.booket.core.network.service.ReedService import dev.zacsweers.metro.Inject -import com.ninecraft.booket.core.di.DataScope import dev.zacsweers.metro.SingleIn import kotlinx.coroutines.flow.map diff --git a/core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/OnboardingDataSource.kt b/core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/OnboardingDataSource.kt index e43f92c7..dfff6f75 100644 --- a/core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/OnboardingDataSource.kt +++ b/core/datastore/api/src/main/kotlin/com/ninecraft/booket/core/datastore/api/datasource/OnboardingDataSource.kt @@ -1,6 +1,6 @@ package com.ninecraft.booket.core.datastore.api.datasource -import com.ninecraft.booket.core.model.OnboardingState +import com.ninecraft.booket.core.model.state.OnboardingState import kotlinx.coroutines.flow.Flow interface OnboardingDataSource { diff --git a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultOnboardingDataSource.kt b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultOnboardingDataSource.kt index c4c4dfd2..1c0521bd 100644 --- a/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultOnboardingDataSource.kt +++ b/core/datastore/impl/src/main/kotlin/com/ninecraft/booket/core/datastore/impl/datasource/DefaultOnboardingDataSource.kt @@ -5,11 +5,11 @@ import androidx.datastore.preferences.core.Preferences import androidx.datastore.preferences.core.booleanPreferencesKey import androidx.datastore.preferences.core.edit import com.ninecraft.booket.core.datastore.api.datasource.OnboardingDataSource -import com.ninecraft.booket.core.model.OnboardingState import com.ninecraft.booket.core.datastore.impl.di.OnboardingDataStore import com.ninecraft.booket.core.datastore.impl.util.handleIOException -import dev.zacsweers.metro.Inject import com.ninecraft.booket.core.di.DataScope +import com.ninecraft.booket.core.model.state.OnboardingState +import dev.zacsweers.metro.Inject import dev.zacsweers.metro.SingleIn import kotlinx.coroutines.flow.Flow import kotlinx.coroutines.flow.map diff --git a/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/Emotion.kt b/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionCode.kt similarity index 71% rename from core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/Emotion.kt rename to core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionCode.kt index ef46f7c1..d071f8da 100644 --- a/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/Emotion.kt +++ b/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/EmotionCode.kt @@ -2,8 +2,8 @@ package com.ninecraft.booket.core.designsystem import androidx.compose.ui.graphics.Color import com.ninecraft.booket.core.designsystem.theme.Blue300 -import com.ninecraft.booket.core.designsystem.theme.EtcBgColor -import com.ninecraft.booket.core.designsystem.theme.EtcTextColor +import com.ninecraft.booket.core.designsystem.theme.OtherBgColor +import com.ninecraft.booket.core.designsystem.theme.OtherTextColor import com.ninecraft.booket.core.designsystem.theme.InsightBgColor import com.ninecraft.booket.core.designsystem.theme.InsightTextColor import com.ninecraft.booket.core.designsystem.theme.JoyBgColor @@ -16,34 +16,33 @@ import com.ninecraft.booket.core.designsystem.theme.Violet300 import com.ninecraft.booket.core.designsystem.theme.WarmthBgColor import com.ninecraft.booket.core.designsystem.theme.WarmthTextColor import com.ninecraft.booket.core.designsystem.theme.Yellow300 -import com.ninecraft.booket.core.model.Emotion import com.ninecraft.booket.core.model.EmotionCode -val Emotion.bgColor: Color +val EmotionCode.bgColor: Color get() = when (this) { - Emotion.WARM -> WarmthBgColor - Emotion.JOY -> JoyBgColor - Emotion.SAD -> SadnessBgColor - Emotion.INSIGHT -> InsightBgColor - Emotion.ETC -> EtcBgColor + EmotionCode.WARMTH -> WarmthBgColor + EmotionCode.JOY -> JoyBgColor + EmotionCode.SADNESS -> SadnessBgColor + EmotionCode.INSIGHT -> InsightBgColor + EmotionCode.OTHER -> OtherBgColor } -val Emotion.textColor: Color +val EmotionCode.textColor: Color get() = when (this) { - Emotion.WARM -> WarmthTextColor - Emotion.JOY -> JoyTextColor - Emotion.SAD -> SadnessTextColor - Emotion.INSIGHT -> InsightTextColor - Emotion.ETC -> EtcTextColor + EmotionCode.WARMTH -> WarmthTextColor + EmotionCode.JOY -> JoyTextColor + EmotionCode.SADNESS -> SadnessTextColor + EmotionCode.INSIGHT -> InsightTextColor + EmotionCode.OTHER -> OtherTextColor } -val Emotion.ratioBarColor: Color +val EmotionCode.ratioBarColor: Color get() = when (this) { - Emotion.WARM -> Yellow300 - Emotion.JOY -> Orange300 - Emotion.SAD -> Blue300 - Emotion.INSIGHT -> Violet300 - Emotion.ETC -> Neutral300 + EmotionCode.WARMTH -> Yellow300 + EmotionCode.JOY -> Orange300 + EmotionCode.SADNESS -> Blue300 + EmotionCode.INSIGHT -> Violet300 + EmotionCode.OTHER -> Neutral300 } val EmotionCode.graphicRes: Int diff --git a/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt b/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt index e3b2588f..e3ee5e09 100644 --- a/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt +++ b/core/designsystem/src/main/kotlin/com/ninecraft/booket/core/designsystem/theme/Color.kt @@ -98,8 +98,8 @@ val InsightTextColor = Color(0xFF9A55E4) val InsightBgColor = Color(0xFFF3E8FF) val SadnessTextColor = Color(0xFF2872E9) val SadnessBgColor = Color(0xFFE1ECFF) -val EtcTextColor = Color(0xFF737373) -val EtcBgColor = Color(0xFFF5F5F5) +val OtherTextColor = Color(0xFF737373) +val OtherBgColor = Color(0xFFF5F5F5) @Immutable data class ReedColorScheme( diff --git a/core/designsystem/stability/designsystem.stability b/core/designsystem/stability/designsystem.stability index 7a2aa49f..a44f1681 100644 --- a/core/designsystem/stability/designsystem.stability +++ b/core/designsystem/stability/designsystem.stability @@ -232,40 +232,3 @@ public fun com.ninecraft.booket.core.designsystem.component.textfield.ReedTextFi - borderStroke: STABLE (marked @Stable or @Immutable) - searchIconTint: STABLE (marked @Stable or @Immutable) -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme(content: @[Composable] androidx.compose.runtime.internal.ComposableFunction0): kotlin.Unit - skippable: true - restartable: true - params: - - content: STABLE (composable function type) - -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme.border(): com.ninecraft.booket.core.designsystem.theme.ReedBorder - skippable: true - restartable: true - params: - -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme.colors(): com.ninecraft.booket.core.designsystem.theme.ReedColorScheme - skippable: true - restartable: true - params: - -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme.radius(): com.ninecraft.booket.core.designsystem.theme.ReedRadius - skippable: true - restartable: true - params: - -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme.spacing(): com.ninecraft.booket.core.designsystem.theme.ReedSpacing - skippable: true - restartable: true - params: - -@Composable -public fun com.ninecraft.booket.core.designsystem.theme.ReedTheme.typography(): com.ninecraft.booket.core.designsystem.theme.ReedTypography - skippable: true - restartable: true - params: - diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt deleted file mode 100644 index fead4e57..00000000 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/AutoLoginState.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.ninecraft.booket.core.model - -enum class AutoLoginState { - IDLE, - LOGGED_IN, - NOT_LOGGED_IN, -} diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookDetailModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookDetailModel.kt index c398445a..0fd424a2 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookDetailModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookDetailModel.kt @@ -1,8 +1,8 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class BookDetailModel( val version: String = "", val title: String = "", diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt index f1c8b05c..9e25a219 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/BookSearchModel.kt @@ -1,8 +1,8 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class BookSearchModel( val version: String = "", val title: String = "", @@ -17,7 +17,7 @@ data class BookSearchModel( val books: List = emptyList(), ) -@Stable +@Immutable data class BookSummaryModel( val isbn13: String = "", val title: String = "", diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt index 762852e3..a0c084c8 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/EmotionModel.kt @@ -1,31 +1,42 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class EmotionGroupsModel( val emotions: List, ) -@Stable +@Immutable data class EmotionGroupModel( val code: EmotionCode, val displayName: String, val detailEmotions: List, ) -@Stable +@Immutable data class DetailEmotionModel( val id: String, val name: String, ) -enum class EmotionCode { - WARMTH, JOY, SADNESS, INSIGHT, OTHER; +enum class EmotionCode( + val displayName: String, +) { + WARMTH("따뜻함"), + JOY("즐거움"), + SADNESS("슬픔"), + INSIGHT("깨달음"), + OTHER("기타"), + ; companion object { fun fromCode(code: String): EmotionCode? { return EmotionCode.entries.find { it.name == code } } + + fun fromDisplayName(displayName: String): EmotionCode? { + return entries.find { it.displayName == displayName } + } } } diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt index 7d55b27b..2970d4a3 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/HomeModel.kt @@ -1,13 +1,13 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class HomeModel( val recentBooks: List = emptyList(), ) -@Stable +@Immutable data class RecentBookModel( val userBookId: String = "", val isbn13: String = "", diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/LibraryModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/LibraryModel.kt index 39dad91a..9bb4b94b 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/LibraryModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/LibraryModel.kt @@ -1,8 +1,8 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class LibraryModel( val books: LibraryBooksModel = LibraryBooksModel(), val totalCount: Int = 0, @@ -11,13 +11,13 @@ data class LibraryModel( val completedCount: Int = 0, ) -@Stable +@Immutable data class LibraryBooksModel( val content: List = emptyList(), val page: PageInfoModel = PageInfoModel(), ) -@Stable +@Immutable data class LibraryBookSummaryModel( val userBookId: String = "", val userId: String = "", @@ -32,7 +32,7 @@ data class LibraryBookSummaryModel( val updatedAt: String = "", ) -@Stable +@Immutable data class PageInfoModel( val size: Int = 0, val number: Int = 0, diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/OnboardingState.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/OnboardingState.kt deleted file mode 100644 index 1d478929..00000000 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/OnboardingState.kt +++ /dev/null @@ -1,7 +0,0 @@ -package com.ninecraft.booket.core.model - -enum class OnboardingState { - IDLE, - NOT_COMPLETED, - COMPLETED, -} diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt index 8d6f7140..912091c0 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/ReadingRecordsModel.kt @@ -1,9 +1,10 @@ package com.ninecraft.booket.core.model import androidx.compose.runtime.Immutable -import androidx.compose.runtime.Stable +@Immutable data class ReadingRecordsModel( + val representativeEmotion: PrimaryEmotionModel? = null, val lastPage: Boolean = true, val totalResults: Int = 0, val startIndex: Int = 0, @@ -13,22 +14,6 @@ data class ReadingRecordsModel( @Immutable data class ReadingRecordModel( - val id: String = "", - val userBookId: String = "", - val pageNumber: Int = 0, - val quote: String = "", - val review: String = "", - val emotionTags: List = emptyList(), - val createdAt: String = "", - val updatedAt: String = "", - val bookTitle: String = "", - val bookPublisher: String = "", - val bookCoverImageUrl: String = "", - val author: String = "", -) - -@Stable -data class ReadingRecordModelV2( val id: String = "", val userBookId: String = "", val pageNumber: Int? = null, @@ -44,7 +29,7 @@ data class ReadingRecordModelV2( val author: String = "", ) -@Stable +@Immutable data class PrimaryEmotionModel( val code: EmotionCode = EmotionCode.OTHER, val displayName: String = "기타", diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordDetailModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordDetailModel.kt deleted file mode 100644 index 19e49633..00000000 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordDetailModel.kt +++ /dev/null @@ -1,19 +0,0 @@ -package com.ninecraft.booket.core.model - -import androidx.compose.runtime.Stable - -@Stable -data class RecordDetailModel( - val id: String = "", - val userBookId: String = "", - val pageNumber: Int = 0, - val quote: String = "", - val review: String = "", - val emotionTags: List = emptyList(), - val createdAt: String = "", - val updatedAt: String = "", - val bookTitle: String = "", - val bookPublisher: String = "", - val bookCoverImageUrl: String = "", - val author: String = "", -) diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordRegisterModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordRegisterModel.kt deleted file mode 100644 index c60ac203..00000000 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/RecordRegisterModel.kt +++ /dev/null @@ -1,12 +0,0 @@ -package com.ninecraft.booket.core.model - -data class RecordRegisterModel( - val id: String = "", - val userBookId: String = "", - val pageNumber: Int = 0, - val quote: String = "", - val emotionTags: List = emptyList(), - val review: String = "", - val createdAt: String = "", - val updatedAt: String = "", -) diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/SeedModel.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/SeedModel.kt index 24ee2845..db102d40 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/SeedModel.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/SeedModel.kt @@ -1,31 +1,14 @@ package com.ninecraft.booket.core.model -import androidx.compose.runtime.Stable +import androidx.compose.runtime.Immutable -@Stable +@Immutable data class SeedModel( val categories: List = emptyList(), ) -@Stable +@Immutable data class EmotionModel( - val name: Emotion, + val code: EmotionCode, val count: Int, ) - -enum class Emotion( - val displayName: String, -) { - WARM("따뜻함"), - JOY("즐거움"), - SAD("슬픔"), - INSIGHT("깨달음"), - ETC("기타"), - ; - - companion object { - fun fromDisplayName(displayName: String): Emotion? { - return entries.find { it.displayName == displayName } - } - } -} diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/AutoLoginState.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/AutoLoginState.kt new file mode 100644 index 00000000..e1816d2b --- /dev/null +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/AutoLoginState.kt @@ -0,0 +1,10 @@ +package com.ninecraft.booket.core.model.state + +import androidx.compose.runtime.Stable + +@Stable +enum class AutoLoginState { + IDLE, + LOGGED_IN, + NOT_LOGGED_IN, +} diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/OnboardingState.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/OnboardingState.kt new file mode 100644 index 00000000..8b4c332a --- /dev/null +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/OnboardingState.kt @@ -0,0 +1,10 @@ +package com.ninecraft.booket.core.model.state + +import androidx.compose.runtime.Stable + +@Stable +enum class OnboardingState { + IDLE, + NOT_COMPLETED, + COMPLETED, +} diff --git a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/UserState.kt b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/UserState.kt similarity index 52% rename from core/model/src/main/kotlin/com/ninecraft/booket/core/model/UserState.kt rename to core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/UserState.kt index 43ec0824..777c5efb 100644 --- a/core/model/src/main/kotlin/com/ninecraft/booket/core/model/UserState.kt +++ b/core/model/src/main/kotlin/com/ninecraft/booket/core/model/state/UserState.kt @@ -1,5 +1,8 @@ -package com.ninecraft.booket.core.model +package com.ninecraft.booket.core.model.state +import androidx.compose.runtime.Stable + +@Stable sealed interface UserState { data object Guest : UserState data object LoggedIn : UserState diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt index d17c3c90..67f85469 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/ReadingRecordsResponse.kt @@ -5,6 +5,8 @@ import kotlinx.serialization.Serializable @Serializable data class ReadingRecordsResponse( + @SerialName("representativeEmotion") + val representativeEmotion: PrimaryEmotion?, @SerialName("lastPage") val lastPage: Boolean, @SerialName("totalResults") @@ -19,34 +21,6 @@ data class ReadingRecordsResponse( @Serializable data class ReadingRecord( - @SerialName("id") - val id: String, - @SerialName("userBookId") - val userBookId: String, - @SerialName("pageNumber") - val pageNumber: Int, - @SerialName("quote") - val quote: String, - @SerialName("review") - val review: String?, - @SerialName("emotionTags") - val emotionTags: List, - @SerialName("createdAt") - val createdAt: String, - @SerialName("updatedAt") - val updatedAt: String, - @SerialName("bookTitle") - val bookTitle: String?, - @SerialName("bookPublisher") - val bookPublisher: String?, - @SerialName("bookCoverImageUrl") - val bookCoverImageUrl: String?, - @SerialName("author") - val author: String?, -) - -@Serializable -data class ReadingRecordV2( @SerialName("id") val id: String, @SerialName("userBookId") diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt deleted file mode 100644 index c78a219b..00000000 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordDetailResponse.kt +++ /dev/null @@ -1,32 +0,0 @@ -package com.ninecraft.booket.core.network.response - -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -@Serializable -data class RecordDetailResponse( - @SerialName("id") - val id: String, - @SerialName("userBookId") - val userBookId: String, - @SerialName("pageNumber") - val pageNumber: Int, - @SerialName("quote") - val quote: String, - @SerialName("review") - val review: String?, - @SerialName("emotionTags") - val emotionTags: List, - @SerialName("createdAt") - val createdAt: String, - @SerialName("updatedAt") - val updatedAt: String, - @SerialName("bookTitle") - val bookTitle: String, - @SerialName("bookPublisher") - val bookPublisher: String, - @SerialName("bookCoverImageUrl") - val bookCoverImageUrl: String, - @SerialName("author") - val author: String, -) diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt deleted file mode 100644 index a6a4c2b5..00000000 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/response/RecordRegisterResponse.kt +++ /dev/null @@ -1,24 +0,0 @@ -package com.ninecraft.booket.core.network.response - -import kotlinx.serialization.SerialName -import kotlinx.serialization.Serializable - -@Serializable -data class RecordRegisterResponse( - @SerialName("id") - val id: String, - @SerialName("userBookId") - val userBookId: String, - @SerialName("pageNumber") - val pageNumber: Int, - @SerialName("quote") - val quote: String, - @SerialName("emotionTags") - val emotionTags: List, - @SerialName("review") - val review: String?, - @SerialName("createdAt") - val createdAt: String, - @SerialName("updatedAt") - val updatedAt: String, -) diff --git a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt index 8b8e6261..4d06ede2 100644 --- a/core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt +++ b/core/network/src/main/kotlin/com/ninecraft/booket/core/network/service/ReedService.kt @@ -15,7 +15,7 @@ import com.ninecraft.booket.core.network.response.GuestBookSearchResponse import com.ninecraft.booket.core.network.response.HomeResponse import com.ninecraft.booket.core.network.response.LibraryResponse import com.ninecraft.booket.core.network.response.LoginResponse -import com.ninecraft.booket.core.network.response.ReadingRecordV2 +import com.ninecraft.booket.core.network.response.ReadingRecord import com.ninecraft.booket.core.network.response.ReadingRecordsResponse import com.ninecraft.booket.core.network.response.RefreshTokenResponse import com.ninecraft.booket.core.network.response.SeedResponse @@ -114,9 +114,9 @@ interface ReedService { suspend fun postRecord( @Path("userBookId") userBookId: String, @Body recordRegisterRequest: RecordRegisterRequest, - ): ReadingRecordV2 + ): ReadingRecord - @GET("api/v1/reading-records/{userBookId}") + @GET("api/v2/reading-records/{userBookId}") suspend fun getReadingRecords( @Path("userBookId") userBookId: String, @Query("sort") sort: String = "CREATED_DATE_DESC", @@ -132,13 +132,13 @@ interface ReedService { @GET("api/v2/reading-records/detail/{readingRecordId}") suspend fun getRecordDetail( @Path("readingRecordId") readingRecordId: String, - ): ReadingRecordV2 + ): ReadingRecord @PUT("api/v2/reading-records/{readingRecordId}") suspend fun editRecord( @Path("readingRecordId") readingRecordId: String, @Body recordRegisterRequest: RecordRegisterRequest, - ): ReadingRecordV2 + ): ReadingRecord @DELETE("api/v2/reading-records/{readingRecordId}") suspend fun deleteRecord( diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt index 25d44ccb..2a457532 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailPresenter.kt @@ -12,8 +12,8 @@ import com.ninecraft.booket.core.common.utils.handleException import com.ninecraft.booket.core.data.api.repository.BookRepository import com.ninecraft.booket.core.data.api.repository.RecordRepository import com.ninecraft.booket.core.model.BookDetailModel -import com.ninecraft.booket.core.model.EmotionCode import com.ninecraft.booket.core.model.EmotionModel +import com.ninecraft.booket.core.model.PrimaryEmotionModel import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.core.ui.component.FooterState import com.ninecraft.booket.feature.screens.BookDetailScreen @@ -70,7 +70,7 @@ class BookDetailPresenter( private fun getRecordComparator(sortType: RecordSort): Comparator { return when (sortType) { - RecordSort.PAGE_NUMBER_ASC -> compareBy { it.pageNumber } + RecordSort.PAGE_NUMBER_ASC -> compareBy(nullsLast()) { it.pageNumber } RecordSort.CREATED_DATE_DESC -> compareByDescending { LocalDateTime.parse(it.createdAt) } } } @@ -81,6 +81,7 @@ class BookDetailPresenter( var uiState by rememberRetained { mutableStateOf(UiState.Idle) } var footerState by rememberRetained { mutableStateOf(FooterState.Idle) } var bookDetail by rememberRetained { mutableStateOf(BookDetailModel()) } + var representativeEmotion by rememberRetained { mutableStateOf(null) } var seedsStates by rememberRetained { mutableStateOf>(persistentListOf()) } var isStatsExpanded by rememberRetained { mutableStateOf(false) } var readingRecords by rememberRetained { mutableStateOf(persistentListOf()) } @@ -122,6 +123,7 @@ class BookDetailPresenter( bookDetail = detail currentBookStatus = BookStatus.fromValue(detail.userBookStatus) ?: BookStatus.BEFORE_READING selectedBookStatus = currentBookStatus + representativeEmotion = records.representativeEmotion seedsStates = seeds.categories.toImmutableList() readingRecords = records.readingRecords.toPersistentList() readingRecordsTotalCount = records.totalResults @@ -318,7 +320,7 @@ class BookDetailPresenter( RecordCardScreen( quote = selectedRecordInfo.quote, bookTitle = selectedRecordInfo.bookTitle, - emotionCode = EmotionCode.OTHER, // TODO: 고정값 임시 조치 + emotionCode = selectedRecordInfo.primaryEmotion.code, ), ) } @@ -333,14 +335,16 @@ class BookDetailPresenter( quote = selectedRecordInfo.quote, review = selectedRecordInfo.review, primaryEmotion = PrimaryEmotionArg( - code = EmotionCode.OTHER, - displayName = "기타", - ), // TODO: 고정값 임시 조치 - detailEmotions = listOf(DetailEmotionArg("", "")), // TODO: 고정값 임시 조치 - bookTitle = selectedRecordInfo.bookTitle, - bookPublisher = selectedRecordInfo.bookPublisher, - bookCoverImageUrl = selectedRecordInfo.bookCoverImageUrl, - author = selectedRecordInfo.author, + code = selectedRecordInfo.primaryEmotion.code, + displayName = selectedRecordInfo.primaryEmotion.displayName, + ), + detailEmotions = selectedRecordInfo.detailEmotions.map { + DetailEmotionArg(id = it.id, name = it.name) + }, + bookTitle = selectedRecordInfo.bookTitle.ifEmpty { bookDetail.title }, + bookPublisher = selectedRecordInfo.bookPublisher.ifEmpty { bookDetail.publisher }, + bookCoverImageUrl = selectedRecordInfo.bookCoverImageUrl.ifEmpty { bookDetail.coverImageUrl }, + author = selectedRecordInfo.author.ifEmpty { bookDetail.author }, ), ), ) @@ -421,6 +425,7 @@ class BookDetailPresenter( uiState = uiState, footerState = footerState, bookDetail = bookDetail, + representativeEmotion = representativeEmotion, seedsStats = seedsStates, isStatsExpanded = isStatsExpanded, readingRecords = readingRecords, diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt index 83c7e25c..1e0ebee1 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUi.kt @@ -36,8 +36,9 @@ import com.ninecraft.booket.core.designsystem.component.button.ReedButtonColorSt import com.ninecraft.booket.core.designsystem.component.button.mediumButtonStyle import com.ninecraft.booket.core.designsystem.theme.ReedTheme import com.ninecraft.booket.core.model.BookDetailModel -import com.ninecraft.booket.core.model.Emotion +import com.ninecraft.booket.core.model.EmotionCode import com.ninecraft.booket.core.model.EmotionModel +import com.ninecraft.booket.core.model.PrimaryEmotionModel import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.core.ui.ReedScaffold import com.ninecraft.booket.core.ui.component.InfinityLazyColumn @@ -285,6 +286,7 @@ internal fun BookDetailContent( if (state.hasEmotionData()) { CollectedSeeds( seedsStats = state.seedsStats, + representativeEmotion = state.representativeEmotion!!, isStatsExpanded = state.isStatsExpanded, onToggleClick = { state.eventSink(BookDetailUiEvent.OnStatsToggleClick(!state.isStatsExpanded)) @@ -407,10 +409,10 @@ private fun BookDetailSeedStatsPreview() { coverImageUrl = "", ), seedsStats = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 5), - EmotionModel(name = Emotion.JOY, count = 3), - EmotionModel(name = Emotion.SAD, count = 2), - EmotionModel(name = Emotion.INSIGHT, count = 7), + EmotionModel(code = EmotionCode.WARMTH, count = 5), + EmotionModel(code = EmotionCode.JOY, count = 3), + EmotionModel(code = EmotionCode.SADNESS, count = 2), + EmotionModel(code = EmotionCode.INSIGHT, count = 7), ), readingRecords = persistentListOf( ReadingRecordModel( @@ -418,7 +420,7 @@ private fun BookDetailSeedStatsPreview() { pageNumber = 42, quote = "새는 알에서 나오려고 투쟁한다. 알은 세계이다.", review = "정말 인상 깊은 구절이었다.", - emotionTags = listOf("깨달음", "따뜻함"), + primaryEmotion = PrimaryEmotionModel(displayName = "깨달음"), createdAt = "2024-01-15T10:30:00.000000", ), ReadingRecordModel( @@ -426,7 +428,7 @@ private fun BookDetailSeedStatsPreview() { pageNumber = 78, quote = "나는 더 이상 꿈을 꾸지 않으려 했다.", review = "성장통을 느끼는 부분", - emotionTags = listOf("슬픔"), + primaryEmotion = PrimaryEmotionModel(displayName = "슬픔"), createdAt = "2024-01-20T14:20:00.000000", ), ReadingRecordModel( @@ -434,7 +436,7 @@ private fun BookDetailSeedStatsPreview() { pageNumber = 156, quote = "운명과 성향은 같은 개념의 두 이름이다.", review = "내 삶을 돌아보게 되었다.", - emotionTags = listOf("깨달음", "즐거움"), + primaryEmotion = PrimaryEmotionModel(displayName = "깨달음"), createdAt = "2024-01-25T09:15:00.000000", ), ), @@ -460,10 +462,10 @@ private fun BookDetailSeedsStatsExpandedPreview() { coverImageUrl = "", ), seedsStats = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 5), - EmotionModel(name = Emotion.JOY, count = 3), - EmotionModel(name = Emotion.SAD, count = 2), - EmotionModel(name = Emotion.INSIGHT, count = 7), + EmotionModel(code = EmotionCode.WARMTH, count = 5), + EmotionModel(code = EmotionCode.JOY, count = 3), + EmotionModel(code = EmotionCode.SADNESS, count = 2), + EmotionModel(code = EmotionCode.INSIGHT, count = 7), ), isStatsExpanded = true, readingRecords = persistentListOf( @@ -472,7 +474,7 @@ private fun BookDetailSeedsStatsExpandedPreview() { pageNumber = 42, quote = "새는 알에서 나오려고 투쟁한다. 알은 세계이다.", review = "정말 인상 깊은 구절이었다.", - emotionTags = listOf("깨달음", "따뜻함"), + primaryEmotion = PrimaryEmotionModel(displayName = "깨달음"), createdAt = "2024-01-15T10:30:00.000000", ), ReadingRecordModel( @@ -480,7 +482,7 @@ private fun BookDetailSeedsStatsExpandedPreview() { pageNumber = 78, quote = "나는 더 이상 꿈을 꾸지 않으려 했다.", review = "성장통을 느끼는 부분", - emotionTags = listOf("슬픔"), + primaryEmotion = PrimaryEmotionModel(displayName = "슬픔"), createdAt = "2024-01-20T14:20:00.000000", ), ReadingRecordModel( @@ -488,7 +490,7 @@ private fun BookDetailSeedsStatsExpandedPreview() { pageNumber = 156, quote = "운명과 성향은 같은 개념의 두 이름이다.", review = "내 삶을 돌아보게 되었다.", - emotionTags = listOf("깨달음", "즐거움"), + primaryEmotion = PrimaryEmotionModel(displayName = "깨달음"), createdAt = "2024-01-25T09:15:00.000000", ), ), diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt index 2d0246ce..1f65bed8 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/BookDetailUiState.kt @@ -5,6 +5,7 @@ import com.ninecraft.booket.core.common.R import com.ninecraft.booket.core.common.constants.BookStatus import com.ninecraft.booket.core.model.BookDetailModel import com.ninecraft.booket.core.model.EmotionModel +import com.ninecraft.booket.core.model.PrimaryEmotionModel import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.core.ui.component.FooterState import com.slack.circuit.runtime.CircuitUiEvent @@ -26,6 +27,7 @@ data class BookDetailUiState( val footerState: FooterState = FooterState.Idle, val isLoading: Boolean = false, val bookDetail: BookDetailModel = BookDetailModel(), + val representativeEmotion: PrimaryEmotionModel? = null, val seedsStats: ImmutableList = persistentListOf(), val isStatsExpanded: Boolean = false, val readingRecords: ImmutableList = persistentListOf(), diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt index 67e6ac94..53bed2b9 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/CollectedSeeds.kt @@ -22,7 +22,6 @@ import androidx.compose.material3.HorizontalDivider import androidx.compose.material3.Icon import androidx.compose.material3.Text import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.draw.clip @@ -30,13 +29,14 @@ import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.vectorResource import androidx.compose.ui.unit.dp -import com.ninecraft.booket.core.common.utils.analyzeEmotions import com.ninecraft.booket.core.designsystem.ComponentPreview +import com.ninecraft.booket.core.designsystem.graphicRes import com.ninecraft.booket.core.designsystem.ratioBarColor import com.ninecraft.booket.core.designsystem.theme.ReedTheme import com.ninecraft.booket.core.designsystem.theme.Yellow700 -import com.ninecraft.booket.core.model.Emotion +import com.ninecraft.booket.core.model.EmotionCode import com.ninecraft.booket.core.model.EmotionModel +import com.ninecraft.booket.core.model.PrimaryEmotionModel import kotlinx.collections.immutable.ImmutableList import kotlinx.collections.immutable.persistentListOf import com.ninecraft.booket.core.designsystem.R as designR @@ -44,13 +44,11 @@ import com.ninecraft.booket.core.designsystem.R as designR @Composable internal fun CollectedSeeds( seedsStats: ImmutableList, + representativeEmotion: PrimaryEmotionModel, isStatsExpanded: Boolean, onToggleClick: () -> Unit, modifier: Modifier = Modifier, ) { - val analysisResult = remember(seedsStats) { analyzeEmotions(seedsStats) } - val topEmotion = analysisResult.topEmotions.firstOrNull() - Column( modifier = modifier .fillMaxWidth() @@ -65,7 +63,7 @@ internal fun CollectedSeeds( .padding(ReedTheme.spacing.spacing4), ) { CollectedSeedsHeader( - topEmotion = topEmotion, + primaryEmotion = representativeEmotion, isStatsExpanded = isStatsExpanded, onToggleClick = onToggleClick, ) @@ -91,9 +89,9 @@ internal fun CollectedSeeds( modifier = Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(ReedTheme.spacing.spacing1), ) { - Emotion.entries.forEach { emotion -> - val emotionModel = seedsStats.find { it.name == emotion } - ?: EmotionModel(emotion, 0) + EmotionCode.entries.forEach { emotionCode -> + val emotionModel = seedsStats.find { it.code == emotionCode } + ?: EmotionModel(emotionCode, 0) EmotionStatCard( emotion = emotionModel, modifier = Modifier.weight(1f), @@ -107,7 +105,7 @@ internal fun CollectedSeeds( @Composable private fun CollectedSeedsHeader( - topEmotion: EmotionModel?, + primaryEmotion: PrimaryEmotionModel, isStatsExpanded: Boolean, onToggleClick: () -> Unit, modifier: Modifier = Modifier, @@ -122,9 +120,9 @@ private fun CollectedSeedsHeader( Row( verticalAlignment = Alignment.CenterVertically, ) { - topEmotion?.let { emotion -> + primaryEmotion.let { emotion -> Image( - painter = painterResource(id = getEmotionImageResourceByDisplayName(emotion.name.displayName)), + painter = painterResource(id = emotion.code.graphicRes), contentDescription = "Seed Image", modifier = Modifier .size(36.dp) @@ -136,7 +134,7 @@ private fun CollectedSeedsHeader( Row { Text( - text = "'${topEmotion?.name?.displayName ?: ""}'", + text = "'${primaryEmotion.code.displayName}'", color = Yellow700, style = ReedTheme.typography.label1SemiBold, ) @@ -173,8 +171,8 @@ private fun EmotionRatioBar( .height(12.dp) .clip(RoundedCornerShape(ReedTheme.radius.full)), ) { - Emotion.entries.forEach { emotion -> - val emotionModel = seedsStats.find { it.name == emotion } + EmotionCode.entries.forEach { emotionCode -> + val emotionModel = seedsStats.find { it.code == emotionCode } val count = emotionModel?.count ?: 0 if (count > 0) { val weight = count.toFloat() / totalCount @@ -182,7 +180,7 @@ private fun EmotionRatioBar( modifier = Modifier .weight(weight) .height(12.dp) - .background(emotion.ratioBarColor), + .background(emotionCode.ratioBarColor), ) } } @@ -208,13 +206,13 @@ private fun EmotionStatCard( modifier = Modifier .size(10.dp) .clip(RoundedCornerShape(ReedTheme.radius.xs)) - .background(emotion.name.ratioBarColor), + .background(emotion.code.ratioBarColor), ) Spacer(modifier = Modifier.height(ReedTheme.spacing.spacing2)) Text( - text = emotion.name.displayName, + text = emotion.code.displayName, color = ReedTheme.colors.contentSecondary, style = ReedTheme.typography.label2Regular, ) @@ -233,12 +231,13 @@ private fun CollectedSeedsCollapsedPreview() { ReedTheme { CollectedSeeds( seedsStats = persistentListOf( - EmotionModel(Emotion.WARM, 4), - EmotionModel(Emotion.JOY, 2), - EmotionModel(Emotion.SAD, 2), - EmotionModel(Emotion.INSIGHT, 2), - EmotionModel(Emotion.ETC, 2), + EmotionModel(EmotionCode.WARMTH, 4), + EmotionModel(EmotionCode.JOY, 2), + EmotionModel(EmotionCode.SADNESS, 2), + EmotionModel(EmotionCode.INSIGHT, 2), + EmotionModel(EmotionCode.OTHER, 2), ), + representativeEmotion = PrimaryEmotionModel(EmotionCode.WARMTH, "기쁨"), isStatsExpanded = false, onToggleClick = {}, ) @@ -251,12 +250,13 @@ private fun CollectedSeedsExpandedPreview() { ReedTheme { CollectedSeeds( seedsStats = persistentListOf( - EmotionModel(Emotion.WARM, 4), - EmotionModel(Emotion.JOY, 2), - EmotionModel(Emotion.SAD, 2), - EmotionModel(Emotion.INSIGHT, 2), - EmotionModel(Emotion.ETC, 2), + EmotionModel(EmotionCode.WARMTH, 4), + EmotionModel(EmotionCode.JOY, 2), + EmotionModel(EmotionCode.SADNESS, 2), + EmotionModel(EmotionCode.INSIGHT, 2), + EmotionModel(EmotionCode.OTHER, 2), ), + representativeEmotion = PrimaryEmotionModel(EmotionCode.WARMTH, "기쁨"), isStatsExpanded = true, onToggleClick = {}, ) @@ -269,12 +269,13 @@ private fun CollectedSeedsExpandedDuplicatedPreview() { ReedTheme { CollectedSeeds( seedsStats = persistentListOf( - EmotionModel(Emotion.WARM, 4), - EmotionModel(Emotion.JOY, 4), - EmotionModel(Emotion.SAD, 2), - EmotionModel(Emotion.INSIGHT, 2), - EmotionModel(Emotion.ETC, 2), + EmotionModel(EmotionCode.WARMTH, 4), + EmotionModel(EmotionCode.JOY, 4), + EmotionModel(EmotionCode.SADNESS, 2), + EmotionModel(EmotionCode.INSIGHT, 2), + EmotionModel(EmotionCode.OTHER, 2), ), + representativeEmotion = PrimaryEmotionModel(EmotionCode.WARMTH, "기쁨"), isStatsExpanded = true, onToggleClick = {}, ) diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/EmotionAnalysisResultText.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/EmotionAnalysisResultText.kt deleted file mode 100644 index a0cd832b..00000000 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/EmotionAnalysisResultText.kt +++ /dev/null @@ -1,172 +0,0 @@ -package com.ninecraft.booket.feature.detail.book.component - -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.remember -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.text.AnnotatedString -import androidx.compose.ui.text.SpanStyle -import androidx.compose.ui.text.TextStyle -import androidx.compose.ui.text.buildAnnotatedString -import androidx.compose.ui.text.withStyle -import androidx.compose.ui.unit.dp -import com.ninecraft.booket.core.common.utils.EmotionDisplayType -import com.ninecraft.booket.core.common.utils.analyzeEmotions -import com.ninecraft.booket.core.designsystem.ComponentPreview -import com.ninecraft.booket.core.designsystem.theme.ReedTheme -import com.ninecraft.booket.core.model.Emotion -import com.ninecraft.booket.core.model.EmotionModel -import kotlinx.collections.immutable.ImmutableList -import kotlinx.collections.immutable.persistentListOf - -@Composable -internal fun EmotionAnalysisResultText( - emotions: ImmutableList, - brandColor: Color, - secondaryColor: Color, - emotionTextStyle: TextStyle, - regularTextStyle: TextStyle, -): AnnotatedString? { - val analysisResult = remember(emotions) { analyzeEmotions(emotions) } - - return when (analysisResult.displayType) { - EmotionDisplayType.NONE -> null - - EmotionDisplayType.SINGLE -> { - val emotion = analysisResult.topEmotions.first() - buildAnnotatedString { - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append("이 책에서 ") - } - withStyle(SpanStyle(color = brandColor, fontSize = emotionTextStyle.fontSize, fontWeight = emotionTextStyle.fontWeight)) { - append(emotion.name.displayName) - } - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append(" 감정을 많이 느꼈어요") - } - } - } - - EmotionDisplayType.DUAL -> { - val emotions = analysisResult.topEmotions - buildAnnotatedString { - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append("이 책에서 ") - } - emotions.forEachIndexed { index, emotion -> - if (index > 0) { - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append(", ") - } - } - withStyle(SpanStyle(color = brandColor, fontSize = emotionTextStyle.fontSize, fontWeight = emotionTextStyle.fontWeight)) { - append(emotion.name.displayName) - } - } - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append(" 감정을 많이 느꼈어요") - } - } - } - - EmotionDisplayType.BALANCED -> { - buildAnnotatedString { - withStyle(SpanStyle(color = secondaryColor, fontSize = regularTextStyle.fontSize, fontWeight = regularTextStyle.fontWeight)) { - append("이 책에서 ") - } - withStyle(SpanStyle(color = brandColor, fontSize = emotionTextStyle.fontSize, fontWeight = emotionTextStyle.fontWeight)) { - append("여러 감정이 고르게 담겼어요") - } - } - } - } -} - -@ComponentPreview -@Composable -private fun EmotionTextAllCasesPreview() { - ReedTheme { - Column(modifier = Modifier.padding(16.dp)) { - Text(text = "1개의 감정이 1위인 경우:") - EmotionAnalysisResultText( - emotions = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 5), - EmotionModel(name = Emotion.JOY, count = 2), - ), - brandColor = ReedTheme.colors.contentBrand, - secondaryColor = ReedTheme.colors.contentSecondary, - emotionTextStyle = ReedTheme.typography.label2SemiBold, - regularTextStyle = ReedTheme.typography.label2Regular, - )?.let { annotatedString -> - Text( - text = annotatedString, - modifier = Modifier.padding(vertical = 8.dp), - ) - } - Spacer(modifier = Modifier.height(16.dp)) - Text(text = "2개의 감정이 공동 1위인 경우:") - EmotionAnalysisResultText( - emotions = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 5), - EmotionModel(name = Emotion.JOY, count = 5), - EmotionModel(name = Emotion.SAD, count = 2), - ), - brandColor = ReedTheme.colors.contentBrand, - secondaryColor = ReedTheme.colors.contentSecondary, - emotionTextStyle = ReedTheme.typography.label2SemiBold, - regularTextStyle = ReedTheme.typography.label2Regular, - )?.let { annotatedString -> - Text( - text = annotatedString, - modifier = Modifier.padding(vertical = 8.dp), - ) - } - Spacer(modifier = Modifier.height(16.dp)) - Text(text = "3~4개의 감정이 공동 1위인 경우:") - EmotionAnalysisResultText( - emotions = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 3), - EmotionModel(name = Emotion.JOY, count = 3), - EmotionModel(name = Emotion.SAD, count = 3), - EmotionModel(name = Emotion.INSIGHT, count = 3), - ), - brandColor = ReedTheme.colors.contentBrand, - secondaryColor = ReedTheme.colors.contentSecondary, - emotionTextStyle = ReedTheme.typography.label2SemiBold, - regularTextStyle = ReedTheme.typography.label2Regular, - )?.let { annotatedString -> - Text( - text = annotatedString, - modifier = Modifier.padding(vertical = 8.dp), - ) - } - Spacer(modifier = Modifier.height(16.dp)) - Text(text = "모든 감정의 count가 0인 경우:") - EmotionAnalysisResultText( - emotions = persistentListOf( - EmotionModel(name = Emotion.WARM, count = 0), - EmotionModel(name = Emotion.JOY, count = 0), - EmotionModel(name = Emotion.SAD, count = 0), - ), - brandColor = ReedTheme.colors.contentBrand, - secondaryColor = ReedTheme.colors.contentSecondary, - emotionTextStyle = ReedTheme.typography.label2SemiBold, - regularTextStyle = ReedTheme.typography.label2Regular, - )?.let { annotatedString -> - Text( - text = annotatedString, - modifier = Modifier.padding(vertical = 8.dp), - ) - } ?: Text( - text = "null 반환 - 표시되지 않음", - modifier = Modifier.padding(vertical = 8.dp), - color = ReedTheme.colors.contentSecondary, - ) - } - } -} diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt index a5f8f05e..04a90ee4 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/RecordItem.kt @@ -24,9 +24,8 @@ import androidx.compose.ui.text.style.TextOverflow import com.ninecraft.booket.core.common.extensions.toFormattedDate import com.ninecraft.booket.core.designsystem.ComponentPreview import com.ninecraft.booket.core.designsystem.theme.ReedTheme +import com.ninecraft.booket.core.model.PrimaryEmotionModel import com.ninecraft.booket.core.model.ReadingRecordModel -import com.ninecraft.booket.feature.detail.R -import kotlinx.collections.immutable.persistentListOf import com.ninecraft.booket.core.designsystem.R as designR @Composable @@ -54,7 +53,7 @@ internal fun RecordItem( verticalAlignment = Alignment.CenterVertically, ) { Text( - text = if (recordInfo.pageNumber != 0) "${recordInfo.pageNumber}p" + text = if (recordInfo.pageNumber != null) "${recordInfo.pageNumber}p" else "-p", color = ReedTheme.colors.contentBrand, style = ReedTheme.typography.label1Medium, @@ -86,7 +85,7 @@ internal fun RecordItem( verticalAlignment = Alignment.CenterVertically, ) { Text( - text = "#${recordInfo.emotionTags[0]}", + text = "#${recordInfo.primaryEmotion.displayName}", color = ReedTheme.colors.contentTertiary, style = ReedTheme.typography.label1Medium, ) @@ -100,17 +99,6 @@ internal fun RecordItem( } } -fun getEmotionImageResourceByDisplayName(displayName: String): Int { - return when (displayName) { - "따뜻함" -> R.drawable.img_warm - "즐거움" -> R.drawable.img_joy - "슬픔" -> R.drawable.img_sad - "깨달음" -> R.drawable.img_insight - "기타" -> R.drawable.img_etc - else -> R.drawable.img_warm - } -} - @ComponentPreview @Composable private fun RecordItemPreview() { @@ -118,7 +106,7 @@ private fun RecordItemPreview() { RecordItem( recordInfo = ReadingRecordModel( quote = "소설가들은 늘 소재를 찾아 떠도는 존재 같지만, 실은 그 반대인 경우가 더 잦다.", - emotionTags = persistentListOf("따뜻함"), + primaryEmotion = PrimaryEmotionModel(displayName = "따뜻함"), pageNumber = 12, createdAt = "2025-06-25T10:30:00.000000", ), diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/SeedItem.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/SeedItem.kt index b35e4965..3f422be1 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/SeedItem.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/book/component/SeedItem.kt @@ -18,11 +18,11 @@ import androidx.compose.ui.res.painterResource import androidx.compose.ui.unit.dp import com.ninecraft.booket.core.designsystem.ComponentPreview import com.ninecraft.booket.core.designsystem.bgColor +import com.ninecraft.booket.core.designsystem.graphicRes import com.ninecraft.booket.core.designsystem.textColor import com.ninecraft.booket.core.designsystem.theme.ReedTheme -import com.ninecraft.booket.core.model.Emotion +import com.ninecraft.booket.core.model.EmotionCode import com.ninecraft.booket.core.model.EmotionModel -import com.ninecraft.booket.feature.detail.R @Composable internal fun SeedItem( @@ -34,7 +34,7 @@ internal fun SeedItem( horizontalAlignment = Alignment.CenterHorizontally, ) { Image( - painter = painterResource(id = getEmotionImageResource(emotion.name)), + painter = painterResource(id = emotion.code.graphicRes), contentDescription = "Seed Graphic Image", modifier = Modifier.size(50.dp), ) @@ -42,7 +42,7 @@ internal fun SeedItem( Box( modifier = Modifier .clip(RoundedCornerShape(ReedTheme.radius.full)) - .background(emotion.name.bgColor) + .background(emotion.code.bgColor) .padding( horizontal = ReedTheme.spacing.spacing2, vertical = ReedTheme.spacing.spacing1, @@ -50,8 +50,8 @@ internal fun SeedItem( contentAlignment = Alignment.Center, ) { Text( - text = emotion.name.displayName, - color = emotion.name.textColor, + text = emotion.code.displayName, + color = emotion.code.textColor, style = ReedTheme.typography.label2SemiBold, ) } @@ -64,23 +64,13 @@ internal fun SeedItem( } } -private fun getEmotionImageResource(emotion: Emotion): Int { - return when (emotion) { - Emotion.WARM -> R.drawable.img_warm - Emotion.JOY -> R.drawable.img_joy - Emotion.SAD -> R.drawable.img_sad - Emotion.INSIGHT -> R.drawable.img_insight - Emotion.ETC -> R.drawable.img_etc - } -} - @ComponentPreview @Composable private fun SeedItemPreview() { ReedTheme { SeedItem( emotion = EmotionModel( - name = Emotion.WARM, + code = EmotionCode.WARMTH, count = 3, ), ) diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt index 3b64a480..82303602 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/card/component/RecordCard.kt @@ -76,9 +76,9 @@ internal fun RecordCard( private fun getEmotionCardImage(emotionCode: EmotionCode): Int { return when (emotionCode) { - EmotionCode.WARMTH -> R.drawable.img_record_card_warm + EmotionCode.WARMTH -> R.drawable.img_record_card_warmth EmotionCode.JOY -> R.drawable.img_record_card_joy - EmotionCode.SADNESS -> R.drawable.img_record_card_sad + EmotionCode.SADNESS -> R.drawable.img_record_card_sadness EmotionCode.INSIGHT -> R.drawable.img_record_card_insight EmotionCode.OTHER -> R.drawable.img_record_card_other } diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt index 1c0d3157..20e11826 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailPresenter.kt @@ -8,7 +8,7 @@ import androidx.compose.runtime.setValue import com.ninecraft.booket.core.common.analytics.AnalyticsHelper import com.ninecraft.booket.core.common.utils.handleException import com.ninecraft.booket.core.data.api.repository.RecordRepository -import com.ninecraft.booket.core.model.ReadingRecordModelV2 +import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.feature.screens.LoginScreen import com.ninecraft.booket.feature.screens.RecordCardScreen import com.ninecraft.booket.feature.screens.RecordDetailScreen @@ -52,7 +52,7 @@ class RecordDetailPresenter( override fun present(): RecordDetailUiState { val scope = rememberCoroutineScope() var uiState by rememberRetained { mutableStateOf(UiState.Idle) } - var recordDetailInfo by rememberRetained { mutableStateOf(ReadingRecordModelV2()) } + var recordDetailInfo by rememberRetained { mutableStateOf(ReadingRecordModel()) } var isRecordMenuBottomSheetVisible by rememberRetained { mutableStateOf(false) } var isRecordDeleteDialogVisible by rememberRetained { mutableStateOf(false) } var sideEffect by rememberRetained { mutableStateOf(null) } diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUi.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUi.kt index e73ba02a..d3330310 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUi.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUi.kt @@ -19,7 +19,7 @@ import com.ninecraft.booket.core.designsystem.ComponentPreview import com.ninecraft.booket.core.designsystem.component.ReedDivider import com.ninecraft.booket.core.designsystem.theme.ReedTheme import com.ninecraft.booket.core.designsystem.theme.White -import com.ninecraft.booket.core.model.ReadingRecordModelV2 +import com.ninecraft.booket.core.model.ReadingRecordModel import com.ninecraft.booket.core.ui.ReedScaffold import com.ninecraft.booket.core.ui.component.ReedDialog import com.ninecraft.booket.core.ui.component.ReedErrorUi @@ -189,7 +189,7 @@ private fun ReviewDetailPreview() { RecordDetailUi( state = RecordDetailUiState( uiState = UiState.Success, - recordDetailInfo = ReadingRecordModelV2( + recordDetailInfo = ReadingRecordModel( id = "", userBookId = "", pageNumber = 90, @@ -215,7 +215,7 @@ private fun ReviewDetailEmptyPreview() { RecordDetailUi( state = RecordDetailUiState( uiState = UiState.Success, - recordDetailInfo = ReadingRecordModelV2( + recordDetailInfo = ReadingRecordModel( id = "", userBookId = "", pageNumber = 90, diff --git a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUiState.kt b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUiState.kt index 6a228b51..4d845ea2 100644 --- a/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUiState.kt +++ b/feature/detail/src/main/kotlin/com/ninecraft/booket/feature/detail/record/RecordDetailUiState.kt @@ -1,7 +1,7 @@ package com.ninecraft.booket.feature.detail.record import androidx.compose.runtime.Immutable -import com.ninecraft.booket.core.model.ReadingRecordModelV2 +import com.ninecraft.booket.core.model.ReadingRecordModel import com.slack.circuit.runtime.CircuitUiEvent import com.slack.circuit.runtime.CircuitUiState import java.util.UUID @@ -16,7 +16,7 @@ sealed interface UiState { data class RecordDetailUiState( val uiState: UiState = UiState.Idle, - val recordDetailInfo: ReadingRecordModelV2 = ReadingRecordModelV2(), + val recordDetailInfo: ReadingRecordModel = ReadingRecordModel(), val isRecordMenuBottomSheetVisible: Boolean = false, val isRecordDeleteDialogVisible: Boolean = false, val sideEffect: RecordDetailSideEffect? = null, diff --git a/feature/detail/src/main/res/drawable/img_etc.webp b/feature/detail/src/main/res/drawable/img_etc.webp deleted file mode 100644 index 0672c243..00000000 Binary files a/feature/detail/src/main/res/drawable/img_etc.webp and /dev/null differ diff --git a/feature/detail/src/main/res/drawable/img_insight.webp b/feature/detail/src/main/res/drawable/img_insight.webp deleted file mode 100644 index b86a8441..00000000 Binary files a/feature/detail/src/main/res/drawable/img_insight.webp and /dev/null differ diff --git a/feature/detail/src/main/res/drawable/img_joy.webp b/feature/detail/src/main/res/drawable/img_joy.webp deleted file mode 100644 index ab3c1684..00000000 Binary files a/feature/detail/src/main/res/drawable/img_joy.webp and /dev/null differ diff --git a/feature/detail/src/main/res/drawable/img_record_card_sad.webp b/feature/detail/src/main/res/drawable/img_record_card_sadness.webp similarity index 100% rename from feature/detail/src/main/res/drawable/img_record_card_sad.webp rename to feature/detail/src/main/res/drawable/img_record_card_sadness.webp diff --git a/feature/detail/src/main/res/drawable/img_record_card_warm.webp b/feature/detail/src/main/res/drawable/img_record_card_warmth.webp similarity index 100% rename from feature/detail/src/main/res/drawable/img_record_card_warm.webp rename to feature/detail/src/main/res/drawable/img_record_card_warmth.webp diff --git a/feature/detail/src/main/res/drawable/img_sad.webp b/feature/detail/src/main/res/drawable/img_sad.webp deleted file mode 100644 index 72e11cf4..00000000 Binary files a/feature/detail/src/main/res/drawable/img_sad.webp and /dev/null differ diff --git a/feature/detail/src/main/res/drawable/img_warm.webp b/feature/detail/src/main/res/drawable/img_warm.webp deleted file mode 100644 index 636b5a41..00000000 Binary files a/feature/detail/src/main/res/drawable/img_warm.webp and /dev/null differ diff --git a/feature/detail/stability/detail.stability b/feature/detail/stability/detail.stability index 1722293b..3d59a3b1 100644 --- a/feature/detail/stability/detail.stability +++ b/feature/detail/stability/detail.stability @@ -70,21 +70,22 @@ internal fun com.ninecraft.booket.feature.detail.book.component.BookUpdateBottom - modifier: STABLE (marked @Stable or @Immutable) @Composable -internal fun com.ninecraft.booket.feature.detail.book.component.CollectedSeeds(seedsStats: kotlinx.collections.immutable.ImmutableList, isStatsExpanded: kotlin.Boolean, onToggleClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit +internal fun com.ninecraft.booket.feature.detail.book.component.CollectedSeeds(seedsStats: kotlinx.collections.immutable.ImmutableList, representativeEmotion: com.ninecraft.booket.core.model.PrimaryEmotionModel, isStatsExpanded: kotlin.Boolean, onToggleClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit skippable: true restartable: true params: - seedsStats: STABLE (known stable type) + - representativeEmotion: STABLE (marked @Stable or @Immutable) - isStatsExpanded: STABLE (primitive type) - onToggleClick: STABLE (function type) - modifier: STABLE (marked @Stable or @Immutable) @Composable -private fun com.ninecraft.booket.feature.detail.book.component.CollectedSeedsHeader(topEmotion: com.ninecraft.booket.core.model.EmotionModel?, isStatsExpanded: kotlin.Boolean, onToggleClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit +private fun com.ninecraft.booket.feature.detail.book.component.CollectedSeedsHeader(primaryEmotion: com.ninecraft.booket.core.model.PrimaryEmotionModel, isStatsExpanded: kotlin.Boolean, onToggleClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit skippable: true restartable: true params: - - topEmotion: STABLE (marked @Stable or @Immutable) + - primaryEmotion: STABLE (marked @Stable or @Immutable) - isStatsExpanded: STABLE (primitive type) - onToggleClick: STABLE (function type) - modifier: STABLE (marked @Stable or @Immutable) @@ -111,17 +112,6 @@ private fun com.ninecraft.booket.feature.detail.book.component.DetailMenuItem(ic - onClick: STABLE (function type) - modifier: STABLE (marked @Stable or @Immutable) -@Composable -internal fun com.ninecraft.booket.feature.detail.book.component.EmotionAnalysisResultText(emotions: kotlinx.collections.immutable.ImmutableList, brandColor: androidx.compose.ui.graphics.Color, secondaryColor: androidx.compose.ui.graphics.Color, emotionTextStyle: androidx.compose.ui.text.TextStyle, regularTextStyle: androidx.compose.ui.text.TextStyle): androidx.compose.ui.text.AnnotatedString? - skippable: true - restartable: true - params: - - emotions: STABLE (known stable type) - - brandColor: STABLE (marked @Stable or @Immutable) - - secondaryColor: STABLE (marked @Stable or @Immutable) - - emotionTextStyle: STABLE (marked @Stable or @Immutable) - - regularTextStyle: STABLE (marked @Stable or @Immutable) - @Composable private fun com.ninecraft.booket.feature.detail.book.component.EmotionRatioBar(seedsStats: kotlinx.collections.immutable.ImmutableList, modifier: androidx.compose.ui.Modifier): kotlin.Unit skippable: true diff --git a/feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt b/feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt index 9b65a95f..8f9ddbab 100644 --- a/feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt +++ b/feature/home/src/main/kotlin/com/ninecraft/booket/feature/home/HomePresenter.kt @@ -12,7 +12,7 @@ import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.data.api.repository.BookRepository import com.ninecraft.booket.core.data.api.repository.UserRepository import com.ninecraft.booket.core.model.RecentBookModel -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.model.state.UserState import com.ninecraft.booket.feature.screens.BookDetailScreen import com.ninecraft.booket.feature.screens.BookSearchScreen import com.ninecraft.booket.feature.screens.HomeScreen diff --git a/feature/home/stability/home.stability b/feature/home/stability/home.stability index 7c83f45e..3df12376 100644 --- a/feature/home/stability/home.stability +++ b/feature/home/stability/home.stability @@ -4,66 +4,9 @@ // Do not edit this file directly. To update it, run: // ./gradlew :home:stabilityDump -@Composable -internal fun com.ninecraft.booket.feature.home.HandleHomeSideEffects(state: com.ninecraft.booket.feature.home.HomeUiState): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - -@Composable -internal fun com.ninecraft.booket.feature.home.HomeContent(state: com.ninecraft.booket.feature.home.HomeUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - @Composable public fun com.ninecraft.booket.feature.home.HomePresenter.present(): com.ninecraft.booket.feature.home.HomeUiState skippable: true restartable: true params: -@Composable -internal fun com.ninecraft.booket.feature.home.HomeUi(state: com.ninecraft.booket.feature.home.HomeUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.home.component.BookCard(recentBookInfo: com.ninecraft.booket.core.model.RecentBookModel, onBookDetailClick: kotlin.Function0, onRecordButtonClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - recentBookInfo: STABLE (marked @Stable or @Immutable) - - onBookDetailClick: STABLE (function type) - - onRecordButtonClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.home.component.EmptyBookCard(onBookRegisterClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onBookRegisterClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.home.component.HomeBanner(onBookRegisterClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onBookRegisterClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.home.component.HomeHeader(onSettingsClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onSettingsClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - diff --git a/feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt b/feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt index 54aebc08..80df03e5 100644 --- a/feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt +++ b/feature/library/src/main/kotlin/com/ninecraft/booket/feature/library/LibraryPresenter.kt @@ -12,7 +12,7 @@ import com.ninecraft.booket.core.common.utils.handleException import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.data.api.repository.BookRepository import com.ninecraft.booket.core.model.LibraryBookSummaryModel -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.model.state.UserState import com.ninecraft.booket.core.ui.component.FooterState import com.ninecraft.booket.feature.screens.BookDetailScreen import com.ninecraft.booket.feature.screens.LibraryScreen diff --git a/feature/library/stability/library.stability b/feature/library/stability/library.stability index 1138df11..e3d809a3 100644 --- a/feature/library/stability/library.stability +++ b/feature/library/stability/library.stability @@ -4,78 +4,9 @@ // Do not edit this file directly. To update it, run: // ./gradlew :library:stabilityDump -@Composable -private fun com.ninecraft.booket.feature.library.EmptyResult(): kotlin.Unit - skippable: true - restartable: true - params: - -@Composable -internal fun com.ninecraft.booket.feature.library.HandleLibrarySideEffects(state: com.ninecraft.booket.feature.library.LibraryUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - eventSink: STABLE (function type) - -@Composable -internal fun com.ninecraft.booket.feature.library.LibraryContent(state: com.ninecraft.booket.feature.library.LibraryUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - @Composable public fun com.ninecraft.booket.feature.library.LibraryPresenter.present(): com.ninecraft.booket.feature.library.LibraryUiState skippable: true restartable: true params: -@Composable -internal fun com.ninecraft.booket.feature.library.LibraryUi(state: com.ninecraft.booket.feature.library.LibraryUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.library.component.FilterChip(option: com.ninecraft.booket.feature.library.LibraryFilterOption, count: kotlin.Int, isSelected: kotlin.Boolean, onChipClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - option: STABLE (class with no mutable properties) - - count: STABLE (primitive type) - - isSelected: STABLE (primitive type) - - onChipClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.library.component.FilterChipGroup(filterList: kotlinx.collections.immutable.ImmutableList, selectedChipOption: com.ninecraft.booket.feature.library.LibraryFilterOption, onChipClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - filterList: STABLE (known stable type) - - selectedChipOption: STABLE (class with no mutable properties) - - onChipClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.library.component.LibraryBookItem(book: com.ninecraft.booket.core.model.LibraryBookSummaryModel, onBookClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - book: STABLE (marked @Stable or @Immutable) - - onBookClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.library.component.LibraryHeader(onSearchClick: kotlin.Function0, onSettingClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onSearchClick: STABLE (function type) - - onSettingClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - diff --git a/feature/login/stability/login.stability b/feature/login/stability/login.stability index 005d619f..58cad8b4 100644 --- a/feature/login/stability/login.stability +++ b/feature/login/stability/login.stability @@ -6,45 +6,33 @@ @Composable internal fun com.ninecraft.booket.feature.login.HandleLoginSideEffects(state: com.ninecraft.booket.feature.login.LoginUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - eventSink: STABLE (function type) -@Composable -public fun com.ninecraft.booket.feature.login.LoginPresenter.present(): com.ninecraft.booket.feature.login.LoginUiState - skippable: true - restartable: true - params: - @Composable internal fun com.ninecraft.booket.feature.login.LoginUi(state: com.ninecraft.booket.feature.login.LoginUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable) @Composable internal fun com.ninecraft.booket.feature.termsagreement.HandleTermsAgreementSideEffects(state: com.ninecraft.booket.feature.termsagreement.TermsAgreementUiState): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - -@Composable -public fun com.ninecraft.booket.feature.termsagreement.TermsAgreementPresenter.present(): com.ninecraft.booket.feature.termsagreement.TermsAgreementUiState - skippable: true + skippable: false restartable: true params: + - state: UNSTABLE (has mutable properties or unstable members) @Composable internal fun com.ninecraft.booket.feature.termsagreement.TermsAgreementUi(state: com.ninecraft.booket.feature.termsagreement.TermsAgreementUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable) @Composable diff --git a/feature/record/stability/record.stability b/feature/record/stability/record.stability index 498b04db..953962fc 100644 --- a/feature/record/stability/record.stability +++ b/feature/record/stability/record.stability @@ -6,39 +6,33 @@ @Composable private fun com.ninecraft.booket.feature.record.ocr.CameraPreview(state: com.ninecraft.booket.feature.record.ocr.OcrUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable) @Composable internal fun com.ninecraft.booket.feature.record.ocr.HandleOcrSideEffects(state: com.ninecraft.booket.feature.record.ocr.OcrUiState): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - -@Composable -public fun com.ninecraft.booket.feature.record.ocr.OcrPresenter.present(): com.ninecraft.booket.feature.record.ocr.OcrUiState - skippable: true + skippable: false restartable: true params: + - state: UNSTABLE (has mutable properties or unstable members) @Composable internal fun com.ninecraft.booket.feature.record.ocr.OcrUi(state: com.ninecraft.booket.feature.record.ocr.OcrUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable) @Composable private fun com.ninecraft.booket.feature.record.ocr.TextScanResult(state: com.ninecraft.booket.feature.record.ocr.OcrUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable) @Composable diff --git a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt index 3d6b29d2..01aa176d 100644 --- a/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt +++ b/feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book/BookSearchPresenter.kt @@ -17,7 +17,7 @@ import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.data.api.repository.BookRepository import com.ninecraft.booket.core.model.BookSearchModel import com.ninecraft.booket.core.model.BookSummaryModel -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.model.state.UserState import com.ninecraft.booket.core.ui.component.FooterState import com.ninecraft.booket.feature.screens.BookSearchScreen import com.ninecraft.booket.feature.screens.LoginScreen diff --git a/feature/search/stability/search.stability b/feature/search/stability/search.stability index 89be1232..1eff2c36 100644 --- a/feature/search/stability/search.stability +++ b/feature/search/stability/search.stability @@ -4,135 +4,9 @@ // Do not edit this file directly. To update it, run: // ./gradlew :search:stabilityDump -@Composable -internal fun com.ninecraft.booket.feature.search.book.BookSearchContent(state: com.ninecraft.booket.feature.search.book.BookSearchUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - @Composable public fun com.ninecraft.booket.feature.search.book.BookSearchPresenter.present(): com.ninecraft.booket.feature.search.book.BookSearchUiState skippable: true restartable: true params: -@Composable -internal fun com.ninecraft.booket.feature.search.book.BookSearchUi(state: com.ninecraft.booket.feature.search.book.BookSearchUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.search.book.HandleBookSearchSideEffects(state: com.ninecraft.booket.feature.search.book.BookSearchUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - eventSink: STABLE (function type) - -@Composable -public fun com.ninecraft.booket.feature.search.book.component.BookItem(book: com.ninecraft.booket.core.model.BookSummaryModel, onBookClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier, enabled: kotlin.Boolean): kotlin.Unit - skippable: true - restartable: true - params: - - book: STABLE (marked @Stable or @Immutable) - - onBookClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - - enabled: STABLE (primitive type) - -@Composable -public fun com.ninecraft.booket.feature.search.book.component.BookRegisterBottomSheet(onDismissRequest: kotlin.Function0, sheetState: androidx.compose.material3.SheetState, onCloseButtonClick: kotlin.Function0, bookStatuses: kotlinx.collections.immutable.ImmutableList, currentBookStatus: com.ninecraft.booket.core.common.constants.BookStatus?, onItemSelected: kotlin.Function1, onBookRegisterButtonClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onDismissRequest: STABLE (function type) - - sheetState: STABLE (marked @Stable or @Immutable) - - onCloseButtonClick: STABLE (function type) - - bookStatuses: STABLE (known stable type) - - currentBookStatus: STABLE (class with no mutable properties) - - onItemSelected: STABLE (function type) - - onBookRegisterButtonClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.search.book.component.BookRegisterSuccessBottomSheet(onDismissRequest: kotlin.Function0, sheetState: androidx.compose.material3.SheetState, upsertedBookStatus: com.ninecraft.booket.core.common.constants.BookStatus, onCancelButtonClick: kotlin.Function0, onOKButtonClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onDismissRequest: STABLE (function type) - - sheetState: STABLE (marked @Stable or @Immutable) - - upsertedBookStatus: STABLE (class with no mutable properties) - - onCancelButtonClick: STABLE (function type) - - onOKButtonClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.search.book.component.BookStatusItem(item: com.ninecraft.booket.core.common.constants.BookStatus, selected: kotlin.Boolean, onClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - item: STABLE (class with no mutable properties) - - selected: STABLE (primitive type) - - onClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.search.common.component.RecentSearchTitle(modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.search.common.component.SearchItem(query: kotlin.String, onQueryClick: kotlin.Function1, onDeleteIconClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - query: STABLE (String is immutable) - - onQueryClick: STABLE (function type) - - onDeleteIconClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.search.library.HandlingLibrarySearchSideEffect(state: com.ninecraft.booket.feature.search.library.LibrarySearchUiState): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - -@Composable -internal fun com.ninecraft.booket.feature.search.library.LibrarySearchContent(state: com.ninecraft.booket.feature.search.library.LibrarySearchUiState, innerPadding: androidx.compose.foundation.layout.PaddingValues, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - innerPadding: STABLE (marked @Stable or @Immutable) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.search.library.LibrarySearchPresenter.present(): com.ninecraft.booket.feature.search.library.LibrarySearchUiState - skippable: true - restartable: true - params: - -@Composable -internal fun com.ninecraft.booket.feature.search.library.LibrarySearchUi(state: com.ninecraft.booket.feature.search.library.LibrarySearchUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.search.library.component.LibraryBookItem(book: com.ninecraft.booket.core.model.LibraryBookSummaryModel, onBookClick: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - book: STABLE (marked @Stable or @Immutable) - - onBookClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - diff --git a/feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt b/feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt index 613c2d6a..47de5d50 100644 --- a/feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt +++ b/feature/settings/src/main/kotlin/com/ninecraft/booket/feature/settings/SettingsPresenter.kt @@ -11,7 +11,7 @@ import com.ninecraft.booket.core.common.utils.handleException import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.data.api.repository.RemoteConfigRepository import com.ninecraft.booket.core.data.api.repository.UserRepository -import com.ninecraft.booket.core.model.UserState +import com.ninecraft.booket.core.model.state.UserState import com.ninecraft.booket.feature.screens.LoginScreen import com.ninecraft.booket.feature.screens.NotificationScreen import com.ninecraft.booket.feature.screens.OssLicensesScreen diff --git a/feature/settings/stability/settings.stability b/feature/settings/stability/settings.stability index 8fdafda6..849b8b18 100644 --- a/feature/settings/stability/settings.stability +++ b/feature/settings/stability/settings.stability @@ -4,123 +4,9 @@ // Do not edit this file directly. To update it, run: // ./gradlew :settings:stabilityDump -@Composable -internal fun com.ninecraft.booket.feature.settings.HandleSettingsSideEffects(state: com.ninecraft.booket.feature.settings.SettingsUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - eventSink: STABLE (function type) - @Composable public fun com.ninecraft.booket.feature.settings.SettingsPresenter.present(): com.ninecraft.booket.feature.settings.SettingsUiState skippable: true restartable: true params: -@Composable -internal fun com.ninecraft.booket.feature.settings.SettingsUi(state: com.ninecraft.booket.feature.settings.SettingsUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.settings.component.ReedSwitch(checked: kotlin.Boolean, onCheckedChange: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - checked: STABLE (primitive type) - - onCheckedChange: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.settings.component.SettingItem(title: kotlin.String, modifier: androidx.compose.ui.Modifier, isClickable: kotlin.Boolean, onItemClick: kotlin.Function0, action: @[Composable] androidx.compose.runtime.internal.ComposableFunction0, description: @[Composable] androidx.compose.runtime.internal.ComposableFunction0): kotlin.Unit - skippable: true - restartable: true - params: - - title: STABLE (String is immutable) - - modifier: STABLE (marked @Stable or @Immutable) - - isClickable: STABLE (primitive type) - - onItemClick: STABLE (function type) - - action: STABLE (composable function type) - - description: STABLE (composable function type) - -@Composable -internal fun com.ninecraft.booket.feature.settings.component.ToggleItem(title: kotlin.String, description: kotlin.String, isChecked: kotlin.Boolean, onCheckedChange: kotlin.Function1, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - title: STABLE (String is immutable) - - description: STABLE (String is immutable) - - isChecked: STABLE (primitive type) - - onCheckedChange: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.settings.component.WithdrawConfirmationBottomSheet(onDismissRequest: kotlin.Function0, sheetState: androidx.compose.material3.SheetState, isCheckBoxChecked: kotlin.Boolean, onCheckBoxCheckedChange: kotlin.Function0, onCancelButtonClick: kotlin.Function0, onWithdrawButtonClick: kotlin.Function0): kotlin.Unit - skippable: true - restartable: true - params: - - onDismissRequest: STABLE (function type) - - sheetState: STABLE (marked @Stable or @Immutable) - - isCheckBoxChecked: STABLE (primitive type) - - onCheckBoxCheckedChange: STABLE (function type) - - onCancelButtonClick: STABLE (function type) - - onWithdrawButtonClick: STABLE (function type) - -@Composable -internal fun com.ninecraft.booket.feature.settings.notification.HandleNotificationSideEffects(state: com.ninecraft.booket.feature.settings.notification.NotificationUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - eventSink: STABLE (function type) - -@Composable -internal fun com.ninecraft.booket.feature.settings.notification.NotificationGuideItem(onClick: kotlin.Function0, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - onClick: STABLE (function type) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.settings.notification.NotificationPresenter.present(): com.ninecraft.booket.feature.settings.notification.NotificationUiState - skippable: true - restartable: true - params: - -@Composable -internal fun com.ninecraft.booket.feature.settings.notification.NotificationUi(state: com.ninecraft.booket.feature.settings.notification.NotificationUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -private fun com.ninecraft.booket.feature.settings.osslicenses.OssLicenseItem(name: kotlin.String, license: kotlin.String, url: kotlin.String, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - name: STABLE (String is immutable) - - license: STABLE (String is immutable) - - url: STABLE (String is immutable) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -internal fun com.ninecraft.booket.feature.settings.osslicenses.OssLicenses(state: com.ninecraft.booket.feature.settings.osslicenses.OssLicensesUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - -@Composable -public fun com.ninecraft.booket.feature.settings.osslicenses.OssLicensesPresenter.present(): com.ninecraft.booket.feature.settings.osslicenses.OssLicensesUiState - skippable: true - restartable: true - params: - diff --git a/feature/splash/src/main/kotlin/com/ninecraft/booket/splash/SplashPresenter.kt b/feature/splash/src/main/kotlin/com/ninecraft/booket/splash/SplashPresenter.kt index 398affca..b1cb8ae1 100644 --- a/feature/splash/src/main/kotlin/com/ninecraft/booket/splash/SplashPresenter.kt +++ b/feature/splash/src/main/kotlin/com/ninecraft/booket/splash/SplashPresenter.kt @@ -12,8 +12,8 @@ import com.ninecraft.booket.core.common.event.postErrorDialog import com.ninecraft.booket.core.data.api.repository.AuthRepository import com.ninecraft.booket.core.data.api.repository.RemoteConfigRepository import com.ninecraft.booket.core.data.api.repository.UserRepository -import com.ninecraft.booket.core.model.AutoLoginState -import com.ninecraft.booket.core.model.OnboardingState +import com.ninecraft.booket.core.model.state.AutoLoginState +import com.ninecraft.booket.core.model.state.OnboardingState import com.ninecraft.booket.feature.screens.HomeScreen import com.ninecraft.booket.feature.screens.LoginScreen import com.ninecraft.booket.feature.screens.OnboardingScreen diff --git a/feature/splash/stability/splash.stability b/feature/splash/stability/splash.stability index 0791787f..c82c8721 100644 --- a/feature/splash/stability/splash.stability +++ b/feature/splash/stability/splash.stability @@ -4,25 +4,9 @@ // Do not edit this file directly. To update it, run: // ./gradlew :splash:stabilityDump -@Composable -internal fun com.ninecraft.booket.splash.HandleSplashSideEffects(state: com.ninecraft.booket.splash.SplashUiState, eventSink: kotlin.Function1): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - eventSink: STABLE (function type) - @Composable public fun com.ninecraft.booket.splash.SplashPresenter.present(): com.ninecraft.booket.splash.SplashUiState skippable: true restartable: true params: -@Composable -public fun com.ninecraft.booket.splash.SplashUi(state: com.ninecraft.booket.splash.SplashUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true - restartable: true - params: - - state: STABLE (class with no mutable properties) - - modifier: STABLE (marked @Stable or @Immutable) - diff --git a/feature/webview/stability/webview.stability b/feature/webview/stability/webview.stability index 5a8b8867..dbfdc6b0 100644 --- a/feature/webview/stability/webview.stability +++ b/feature/webview/stability/webview.stability @@ -6,24 +6,18 @@ @Composable internal fun com.ninecraft.booket.feature.webview.WebViewContent(state: com.ninecraft.booket.feature.webview.WebViewUiState, innerPadding: androidx.compose.foundation.layout.PaddingValues, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - innerPadding: STABLE (marked @Stable or @Immutable) - modifier: STABLE (marked @Stable or @Immutable) -@Composable -public fun com.ninecraft.booket.feature.webview.WebViewPresenter.present(): com.ninecraft.booket.feature.webview.WebViewUiState - skippable: true - restartable: true - params: - @Composable internal fun com.ninecraft.booket.feature.webview.WebViewUi(state: com.ninecraft.booket.feature.webview.WebViewUiState, modifier: androidx.compose.ui.Modifier): kotlin.Unit - skippable: true + skippable: false restartable: true params: - - state: STABLE (class with no mutable properties) + - state: UNSTABLE (has mutable properties or unstable members) - modifier: STABLE (marked @Stable or @Immutable)