From b931d0f71b129aeddad00c0dd735b2517dd2e83e Mon Sep 17 00:00:00 2001 From: Syer10 Date: Fri, 1 Dec 2023 22:46:54 -0500 Subject: [PATCH] Data object --- .../jui/domain/updates/interactor/UpdateChecker.kt | 2 +- .../jui/ui/library/LibraryScreenViewModel.kt | 4 ++-- .../ca/gosyer/jui/ui/reader/loader/PageLoader.kt | 4 ++-- .../ca/gosyer/jui/ui/reader/model/Navigation.kt | 14 +++++++------- .../ca/gosyer/jui/ui/reader/model/ReaderChapter.kt | 4 ++-- .../ca/gosyer/jui/ui/reader/model/ReaderPage.kt | 4 ++-- .../gosyer/jui/ui/settings/SettingsBackupScreen.kt | 6 +++--- .../browse/filter/model/SourceFiltersView.kt | 1 - .../jui/ui/sources/components/SourcesNavigator.kt | 4 ++-- .../sources/globalsearch/GlobalSearchViewModel.kt | 2 +- 10 files changed, 22 insertions(+), 23 deletions(-) diff --git a/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdateChecker.kt b/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdateChecker.kt index 48a15d22d8..5525afdf81 100644 --- a/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdateChecker.kt +++ b/domain/src/commonMain/kotlin/ca/gosyer/jui/domain/updates/interactor/UpdateChecker.kt @@ -56,7 +56,7 @@ class UpdateChecker val release: GithubRelease, ) : Update() - object NoUpdatesFound : Update() + data object NoUpdatesFound : Update() } // Thanks to Tachiyomi for inspiration diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt index b87383c67f..e53103776e 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/library/LibraryScreenViewModel.kt @@ -54,7 +54,7 @@ import org.lighthousegames.logging.logging @Stable sealed class LibraryState { @Stable - object Loading : LibraryState() + data object Loading : LibraryState() @Stable data class Failed( @@ -70,7 +70,7 @@ sealed class LibraryState { @Stable sealed class CategoryState { @Stable - object Loading : CategoryState() + data object Loading : CategoryState() @Stable data class Failed( diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/loader/PageLoader.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/loader/PageLoader.kt index 602f2906fd..1f5aab4551 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/loader/PageLoader.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/loader/PageLoader.kt @@ -47,11 +47,11 @@ abstract class PageLoader { } sealed class PagesState { - object Loading : PagesState() + data object Loading : PagesState() data class Success( val pages: List, ) : PagesState() - object Empty : PagesState() + data object Empty : PagesState() } diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/Navigation.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/Navigation.kt index 032d380d75..70c4955481 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/Navigation.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/Navigation.kt @@ -9,17 +9,17 @@ package ca.gosyer.jui.ui.reader.model sealed class Navigation( val name: String, ) { - object MENU : Navigation("Menu") + data object MENU : Navigation("Menu") - object PREV : Navigation("Prev") + data object PREV : Navigation("Prev") - object NEXT : Navigation("Next") + data object NEXT : Navigation("Next") - object LEFT : Navigation("Left") + data object LEFT : Navigation("Left") - object RIGHT : Navigation("Right") + data object RIGHT : Navigation("Right") - object UP : Navigation("Up") + data object UP : Navigation("Up") - object DOWN : Navigation("Down") + data object DOWN : Navigation("Down") } diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderChapter.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderChapter.kt index bc78c66b40..cee0890e32 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderChapter.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderChapter.kt @@ -58,9 +58,9 @@ data class ReaderChapter( } sealed class State { - object Wait : State() + data object Wait : State() - object Loading : State() + data object Loading : State() class Error( val error: Throwable, diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderPage.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderPage.kt index 67acb176ef..107fa287ae 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderPage.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/reader/model/ReaderPage.kt @@ -42,10 +42,10 @@ data class ReaderPage( ) : ImageDecodeState() @Immutable - object UnknownDecoder : ImageDecodeState() + data object UnknownDecoder : ImageDecodeState() @Immutable - object FailedToGetSnapShot : ImageDecodeState() + data object FailedToGetSnapShot : ImageDecodeState() @Immutable data class FailedToDecode( diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/settings/SettingsBackupScreen.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/settings/SettingsBackupScreen.kt index bcf4c5ff7d..e35f4e7317 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/settings/SettingsBackupScreen.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/settings/SettingsBackupScreen.kt @@ -268,15 +268,15 @@ class SettingsBackupViewModel } sealed class Status { - object Nothing : Status() + data object Nothing : Status() data class InProgress( val progress: Float?, ) : Status() - object Success : Status() + data object Success : Status() - object Error : Status() + data object Error : Status() } @Composable diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/model/SourceFiltersView.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/model/SourceFiltersView.kt index 743d902b2a..5805d31b64 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/model/SourceFiltersView.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/browse/filter/model/SourceFiltersView.kt @@ -174,7 +174,6 @@ sealed class SourceFiltersView { } } -@Suppress("FunctionName") fun SourceFiltersView( index: Int, sourceFilter: SourceFilter, diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/components/SourcesNavigator.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/components/SourcesNavigator.kt index e29478854a..5924c2e812 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/components/SourcesNavigator.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/components/SourcesNavigator.kt @@ -111,9 +111,9 @@ private fun SourceNavigatorDisposableEffect(navigator: SourcesNavigator) { } sealed class SourceNavigatorScreen { - object HomeScreen : SourceNavigatorScreen() + data object HomeScreen : SourceNavigatorScreen() - object SearchScreen : SourceNavigatorScreen() + data object SearchScreen : SourceNavigatorScreen() data class SourceScreen( val source: Source, diff --git a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt index a5a19b0fb6..447d8580fd 100644 --- a/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt +++ b/presentation/src/commonMain/kotlin/ca/gosyer/jui/ui/sources/globalsearch/GlobalSearchViewModel.kt @@ -152,7 +152,7 @@ class GlobalSearchViewModel ) sealed class Search { - object Searching : Search() + data object Searching : Search() data class Success( val mangaList: ImmutableList,