From ac306547a0ccd28f45882cba8e3b0138f6d6aedc Mon Sep 17 00:00:00 2001 From: arkon Date: Tue, 18 Jul 2023 19:12:04 -0400 Subject: [PATCH] Bump dependencies --- .../base/ExtensionInstallerPreference.kt | 2 +- .../chapter/interactor/SetReadStatus.kt | 4 ++-- .../browse/components/BrowseIcons.kt | 4 ++-- .../browse/components/GlobalSearchToolbar.kt | 2 +- .../manga/components/MangaBottomActionMenu.kt | 4 ++-- .../screen/SettingsAppearanceScreen.kt | 4 ++-- .../settings/screen/SettingsReaderScreen.kt | 4 ++-- .../settings/screen/SettingsSecurityScreen.kt | 2 +- .../screen/advanced/ClearDatabaseScreen.kt | 2 +- .../widget/AppThemePreferenceWidget.kt | 2 +- .../more/stats/StatsScreenState.kt | 2 +- .../reader/settings/ReadingModePage.kt | 6 +++--- .../main/java/eu/kanade/tachiyomi/AppInfo.kt | 2 +- .../kanade/tachiyomi/data/saver/ImageSaver.kt | 2 +- .../data/track/bangumi/BangumiInterceptor.kt | 2 +- .../tachiyomi/extension/model/LoadResult.kt | 6 +++--- .../extension/ExtensionFilterScreenModel.kt | 4 ++-- .../details/ExtensionDetailsScreenModel.kt | 2 +- .../manga/MigrationMangaScreenModel.kt | 2 +- .../sources/MigrateSourceScreenModel.kt | 2 +- .../browse/source/SourcesFilterScreenModel.kt | 2 +- .../ui/browse/source/SourcesScreenModel.kt | 2 +- .../source/browse/BrowseSourceScreenModel.kt | 6 +++--- .../source/globalsearch/SearchScreenModel.kt | 2 +- .../ui/category/CategoryScreenModel.kt | 6 +++--- .../ui/history/HistoryScreenModel.kt | 6 +++--- .../eu/kanade/tachiyomi/ui/home/HomeScreen.kt | 4 ++-- .../ui/library/LibraryScreenModel.kt | 2 +- .../tachiyomi/ui/manga/MangaScreenModel.kt | 10 +++++----- .../eu/kanade/tachiyomi/ui/more/MoreTab.kt | 2 +- .../tachiyomi/ui/reader/ReaderActivity.kt | 4 ++-- .../tachiyomi/ui/reader/ReaderViewModel.kt | 6 +++--- .../ui/reader/model/ReaderChapter.kt | 8 ++++---- .../ui/reader/setting/OrientationType.kt | 2 +- .../ui/reader/setting/ReadingModeType.kt | 2 +- .../ui/reader/viewer/ViewerNavigation.kt | 10 +++++----- .../ui/updates/UpdatesScreenModel.kt | 6 +++--- .../eu/kanade/tachiyomi/util/system/GLUtil.kt | 2 +- .../core/metadata/comicinfo/ComicInfo.kt | 4 ++-- .../tachiyomi/core/util/system/ImageUtil.kt | 4 ++-- .../java/tachiyomi/data/DatabaseAdapter.kt | 4 +--- .../interactor/CreateCategoryWithName.kt | 2 +- .../category/interactor/DeleteCategory.kt | 2 +- .../category/interactor/RenameCategory.kt | 2 +- .../category/interactor/ReorderCategory.kt | 4 ++-- .../category/interactor/UpdateCategory.kt | 2 +- .../library/model/LibraryDisplayMode.kt | 8 ++++---- .../domain/library/model/LibrarySortMode.kt | 20 +++++++++---------- .../interactor/GetApplicationRelease.kt | 6 +++--- .../java/tachiyomi/domain/source/model/Pin.kt | 6 +++--- gradle/compose.versions.toml | 2 +- gradle/kotlinx.versions.toml | 2 +- gradle/libs.versions.toml | 4 ++-- .../core/components/VerticalFastScroller.kt | 2 +- .../widget/components/UpdatesWidget.kt | 4 ++-- 55 files changed, 109 insertions(+), 111 deletions(-) diff --git a/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt b/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt index 03c63dd2b..33f148e95 100644 --- a/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt +++ b/app/src/main/java/eu/kanade/domain/base/ExtensionInstallerPreference.kt @@ -18,7 +18,7 @@ class ExtensionInstallerPreference( override fun key() = "extension_installer" - val entries get() = ExtensionInstaller.values().run { + val entries get() = ExtensionInstaller.entries.run { if (context.hasMiuiPackageInstaller) { filter { it != ExtensionInstaller.PACKAGEINSTALLER } } else { diff --git a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt index 2d3608680..49a718b51 100644 --- a/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt +++ b/app/src/main/java/eu/kanade/domain/chapter/interactor/SetReadStatus.kt @@ -73,8 +73,8 @@ class SetReadStatus( await(manga.id, read) sealed class Result { - object Success : Result() - object NoChapters : Result() + data object Success : Result() + data object NoChapters : Result() data class InternalError(val error: Throwable) : Result() } } diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt index 08cb517e5..1d71e9a90 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/BrowseIcons.kt @@ -142,7 +142,7 @@ private fun Extension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT): St } sealed class Result { - object Loading : Result() - object Error : Result() + data object Loading : Result() + data object Error : Result() data class Success(val value: T) : Result() } diff --git a/app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchToolbar.kt b/app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchToolbar.kt index bdcb38d52..26c4ca8b2 100644 --- a/app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchToolbar.kt +++ b/app/src/main/java/eu/kanade/presentation/browse/components/GlobalSearchToolbar.kt @@ -56,7 +56,7 @@ fun GlobalSearchToolbar( navigateUp = navigateUp, scrollBehavior = scrollBehavior, ) - if (progress in 1 until total) { + if (progress in 1.. Unit = { toConfirmIndex -> haptic.performHapticFeedback(HapticFeedbackType.LongPress) - (0 until 7).forEach { i -> confirm[i] = i == toConfirmIndex } + (0..<7).forEach { i -> confirm[i] = i == toConfirmIndex } resetJob?.cancel() resetJob = scope.launch { delay(1.seconds) @@ -241,7 +241,7 @@ fun LibraryBottomActionMenu( var resetJob: Job? = remember { null } val onLongClickItem: (Int) -> Unit = { toConfirmIndex -> haptic.performHapticFeedback(HapticFeedbackType.LongPress) - (0 until 5).forEach { i -> confirm[i] = i == toConfirmIndex } + (0..<5).forEach { i -> confirm[i] = i == toConfirmIndex } resetJob?.cancel() resetJob = scope.launch { delay(1.seconds) diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt index 7011bc500..699304f75 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/screen/SettingsAppearanceScreen.kt @@ -136,7 +136,7 @@ object SettingsAppearanceScreen : SearchableSettings { Preference.PreferenceItem.ListPreference( pref = uiPreferences.tabletUiMode(), title = stringResource(R.string.pref_tablet_ui_mode), - entries = TabletUiMode.values().associateWith { stringResource(it.titleResId) }, + entries = TabletUiMode.entries.associateWith { stringResource(it.titleResId) }, onValueChanged = { context.toast(R.string.requires_app_restart) true @@ -180,7 +180,7 @@ object SettingsAppearanceScreen : SearchableSettings { var eventType = parser.eventType while (eventType != XmlPullParser.END_DOCUMENT) { if (eventType == XmlPullParser.START_TAG && parser.name == "locale") { - for (i in 0 until parser.attributeCount) { + for (i in 0.., val selection: List = emptyList(), diff --git a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt index 8b76552f0..e295f3281 100644 --- a/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt +++ b/app/src/main/java/eu/kanade/presentation/more/settings/widget/AppThemePreferenceWidget.kt @@ -75,7 +75,7 @@ private fun AppThemesList( onItemClick: (AppTheme) -> Unit, ) { val appThemes = remember { - AppTheme.values() + AppTheme.entries .filterNot { it.titleResId == null || (it == AppTheme.MONET && !DeviceUtil.isDynamicColorAvailable) } } LazyRow( diff --git a/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenState.kt b/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenState.kt index ffc770589..aaa535194 100644 --- a/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenState.kt +++ b/app/src/main/java/eu/kanade/presentation/more/stats/StatsScreenState.kt @@ -5,7 +5,7 @@ import eu.kanade.presentation.more.stats.data.StatsData sealed class StatsScreenState { @Immutable - object Loading : StatsScreenState() + data object Loading : StatsScreenState() @Immutable data class Success( diff --git a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt index f802b95b3..883d61bd2 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/settings/ReadingModePage.kt @@ -24,9 +24,9 @@ import tachiyomi.presentation.core.components.SettingsChipRow import tachiyomi.presentation.core.components.SliderItem import java.text.NumberFormat -private val readingModeOptions = ReadingModeType.values().map { it.stringRes to it } -private val orientationTypeOptions = OrientationType.values().map { it.stringRes to it } -private val tappingInvertModeOptions = ReaderPreferences.TappingInvertMode.values().map { it.titleResId to it } +private val readingModeOptions = ReadingModeType.entries.map { it.stringRes to it } +private val orientationTypeOptions = OrientationType.entries.map { it.stringRes to it } +private val tappingInvertModeOptions = ReaderPreferences.TappingInvertMode.entries.map { it.titleResId to it } @Composable internal fun ColumnScope.ReadingModePage(screenModel: ReaderSettingsScreenModel) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt b/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt index 8eeda9ef0..322983606 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/AppInfo.kt @@ -29,5 +29,5 @@ object AppInfo { * * @since extension-lib 1.5 */ - fun getSupportedImageMimeTypes(): List = ImageUtil.ImageType.values().map { it.mime } + fun getSupportedImageMimeTypes(): List = ImageUtil.ImageType.entries.map { it.mime } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt index 2610db565..b0ce4e3f8 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/saver/ImageSaver.kt @@ -161,7 +161,7 @@ sealed class Location { } } - object Cache : Location() + data object Cache : Location() fun directory(context: Context): File { return when (this) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt index a5cd014ec..7507ba3ef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/track/bangumi/BangumiInterceptor.kt @@ -66,7 +66,7 @@ class BangumiInterceptor(val bangumi: Bangumi) : Interceptor { private fun addToken(token: String, oidFormBody: FormBody): FormBody { val newFormBody = FormBody.Builder() - for (i in 0 until oidFormBody.size) { + for (i in 0.., val initialSelection: List>) : Dialog() data class DeleteManga(val manga: List) : Dialog() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt index 34c69a717..cb8a6e527 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/manga/MangaScreenModel.kt @@ -854,10 +854,10 @@ class MangaInfoScreenModel( // Try to select the items in-between when possible val range: IntRange if (selectedIndex < selectedPositions[0]) { - range = selectedIndex + 1 until selectedPositions[0] + range = selectedIndex + 1.. selectedPositions[1]) { - range = (selectedPositions[1] + 1) until selectedIndex + range = (selectedPositions[1] + 1)..>) : Dialog() data class DeleteChapters(val chapters: List) : Dialog() data class DuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog() - object SettingsSheet : Dialog() - object TrackSheet : Dialog() - object FullCover : Dialog() + data object SettingsSheet : Dialog() + data object TrackSheet : Dialog() + data object FullCover : Dialog() } fun dismissDialog() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt index 1e2ede273..d587334ce 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/more/MoreTab.kt @@ -109,7 +109,7 @@ private class MoreScreenModel( } sealed class DownloadQueueState { - object Stopped : DownloadQueueState() + data object Stopped : DownloadQueueState() data class Paused(val pending: Int) : DownloadQueueState() data class Downloading(val pending: Int) : DownloadQueueState() } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index f7afede9e..eb5c81c06 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -485,7 +485,7 @@ class ReaderActivity : BaseActivity() { setOnClickListener { popupMenu( - items = ReadingModeType.values().map { it.flagValue to it.stringRes }, + items = ReadingModeType.entries.map { it.flagValue to it.stringRes }, selectedItemId = viewModel.getMangaReadingMode(resolveDefault = false), ) { val newReadingMode = ReadingModeType.fromPreference(itemId) @@ -538,7 +538,7 @@ class ReaderActivity : BaseActivity() { setOnClickListener { popupMenu( - items = OrientationType.values().map { it.flagValue to it.stringRes }, + items = OrientationType.entries.map { it.flagValue to it.stringRes }, selectedItemId = viewModel.manga?.orientationType?.toInt() ?: readerPreferences.defaultOrientationType().get(), ) { diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt index 1010c1fbe..1d9f4bf0f 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderViewModel.kt @@ -861,13 +861,13 @@ class ReaderViewModel( } sealed class Dialog { - object Loading : Dialog() - object Settings : Dialog() + data object Loading : Dialog() + data object Settings : Dialog() data class PageActions(val page: ReaderPage) : Dialog() } sealed class Event { - object ReloadViewerChapters : Event() + data object ReloadViewerChapters : Event() data class SetOrientation(val orientation: Int) : Event() data class SetCoverResult(val result: SetAsCoverResult) : Event() diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt index ff1fb23c4..b02793015 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/model/ReaderChapter.kt @@ -40,9 +40,9 @@ data class ReaderChapter(val chapter: Chapter) { } sealed class State { - object Wait : State() - object Loading : State() - class Error(val error: Throwable) : State() - class Loaded(val pages: List) : State() + data object Wait : State() + data object Loading : State() + data class Error(val error: Throwable) : State() + data class Loaded(val pages: List) : State() } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt index 0125a78a4..bf5135153 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/OrientationType.kt @@ -18,6 +18,6 @@ enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val str companion object { const val MASK = 0x00000038 - fun fromPreference(preference: Int?): OrientationType = values().find { it.flagValue == preference } ?: DEFAULT + fun fromPreference(preference: Int?): OrientationType = entries.find { it.flagValue == preference } ?: DEFAULT } } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt index 73975e28f..e3f3b38b7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/setting/ReadingModeType.kt @@ -22,7 +22,7 @@ enum class ReadingModeType(val prefValue: Int, @StringRes val stringRes: Int, @D companion object { const val MASK = 0x00000007 - fun fromPreference(preference: Int?): ReadingModeType = values().find { it.flagValue == preference } ?: DEFAULT + fun fromPreference(preference: Int?): ReadingModeType = entries.find { it.flagValue == preference } ?: DEFAULT fun isPagerType(preference: Int): Boolean { val mode = fromPreference(preference) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerNavigation.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerNavigation.kt index d4acd01b1..aedfb2bbd 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerNavigation.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/viewer/ViewerNavigation.kt @@ -10,11 +10,11 @@ import eu.kanade.tachiyomi.util.lang.invert abstract class ViewerNavigation { sealed class NavigationRegion(@StringRes val nameRes: Int, val colorRes: Int) { - object MENU : NavigationRegion(R.string.action_menu, R.color.navigation_menu) - object PREV : NavigationRegion(R.string.nav_zone_prev, R.color.navigation_prev) - object NEXT : NavigationRegion(R.string.nav_zone_next, R.color.navigation_next) - object LEFT : NavigationRegion(R.string.nav_zone_left, R.color.navigation_left) - object RIGHT : NavigationRegion(R.string.nav_zone_right, R.color.navigation_right) + data object MENU : NavigationRegion(R.string.action_menu, R.color.navigation_menu) + data object PREV : NavigationRegion(R.string.nav_zone_prev, R.color.navigation_prev) + data object NEXT : NavigationRegion(R.string.nav_zone_next, R.color.navigation_next) + data object LEFT : NavigationRegion(R.string.nav_zone_left, R.color.navigation_left) + data object RIGHT : NavigationRegion(R.string.nav_zone_right, R.color.navigation_right) } data class Region( diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt index f1c05de55..66f8250d4 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/updates/UpdatesScreenModel.kt @@ -295,10 +295,10 @@ class UpdatesScreenModel( // Try to select the items in-between when possible val range: IntRange if (selectedIndex < selectedPositions[0]) { - range = selectedIndex + 1 until selectedPositions[0] + range = selectedIndex + 1.. selectedPositions[1]) { - range = (selectedPositions[1] + 1) until selectedIndex + range = (selectedPositions[1] + 1).., String> { } val updateStrategyAdapter = object : ColumnAdapter { - private val enumValues by lazy { UpdateStrategy.values() } - override fun decode(databaseValue: Long): UpdateStrategy = - enumValues.getOrElse(databaseValue.toInt()) { UpdateStrategy.ALWAYS_UPDATE } + UpdateStrategy.entries.getOrElse(databaseValue.toInt()) { UpdateStrategy.ALWAYS_UPDATE } override fun encode(value: UpdateStrategy): Long = value.ordinal.toLong() } diff --git a/domain/src/main/java/tachiyomi/domain/category/interactor/CreateCategoryWithName.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/CreateCategoryWithName.kt index 3674b797d..b497d2ff1 100644 --- a/domain/src/main/java/tachiyomi/domain/category/interactor/CreateCategoryWithName.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/CreateCategoryWithName.kt @@ -38,7 +38,7 @@ class CreateCategoryWithName( } sealed class Result { - object Success : Result() + data object Success : Result() data class InternalError(val error: Throwable) : Result() } } diff --git a/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt index e862303e1..287732768 100644 --- a/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/DeleteCategory.kt @@ -36,7 +36,7 @@ class DeleteCategory( } sealed class Result { - object Success : Result() + data object Success : Result() data class InternalError(val error: Throwable) : Result() } } diff --git a/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt index 2489aa6bf..eb06ec78a 100644 --- a/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/RenameCategory.kt @@ -29,7 +29,7 @@ class RenameCategory( suspend fun await(category: Category, name: String) = await(category.id, name) sealed class Result { - object Success : Result() + data object Success : Result() data class InternalError(val error: Throwable) : Result() } } diff --git a/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt index 4309eaae0..fb65b3f4a 100644 --- a/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/ReorderCategory.kt @@ -58,8 +58,8 @@ class ReorderCategory( } sealed class Result { - object Success : Result() - object Unchanged : Result() + data object Success : Result() + data object Unchanged : Result() data class InternalError(val error: Throwable) : Result() } diff --git a/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt b/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt index 4b9c8ebba..d6c91e1ef 100644 --- a/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt +++ b/domain/src/main/java/tachiyomi/domain/category/interactor/UpdateCategory.kt @@ -18,7 +18,7 @@ class UpdateCategory( } sealed class Result { - object Success : Result() + data object Success : Result() data class Error(val error: Exception) : Result() } } diff --git a/domain/src/main/java/tachiyomi/domain/library/model/LibraryDisplayMode.kt b/domain/src/main/java/tachiyomi/domain/library/model/LibraryDisplayMode.kt index c7d2866a5..7bda1b2f2 100644 --- a/domain/src/main/java/tachiyomi/domain/library/model/LibraryDisplayMode.kt +++ b/domain/src/main/java/tachiyomi/domain/library/model/LibraryDisplayMode.kt @@ -2,10 +2,10 @@ package tachiyomi.domain.library.model sealed class LibraryDisplayMode { - object CompactGrid : LibraryDisplayMode() - object ComfortableGrid : LibraryDisplayMode() - object List : LibraryDisplayMode() - object CoverOnlyGrid : LibraryDisplayMode() + data object CompactGrid : LibraryDisplayMode() + data object ComfortableGrid : LibraryDisplayMode() + data object List : LibraryDisplayMode() + data object CoverOnlyGrid : LibraryDisplayMode() object Serializer { fun deserialize(serialized: String): LibraryDisplayMode { diff --git a/domain/src/main/java/tachiyomi/domain/library/model/LibrarySortMode.kt b/domain/src/main/java/tachiyomi/domain/library/model/LibrarySortMode.kt index fcf67fc81..40acc5b5a 100644 --- a/domain/src/main/java/tachiyomi/domain/library/model/LibrarySortMode.kt +++ b/domain/src/main/java/tachiyomi/domain/library/model/LibrarySortMode.kt @@ -22,14 +22,14 @@ data class LibrarySort( override val mask: Long = 0b00111100L - object Alphabetical : Type(0b00000000) - object LastRead : Type(0b00000100) - object LastUpdate : Type(0b00001000) - object UnreadCount : Type(0b00001100) - object TotalChapters : Type(0b00010000) - object LatestChapter : Type(0b00010100) - object ChapterFetchDate : Type(0b00011000) - object DateAdded : Type(0b00011100) + data object Alphabetical : Type(0b00000000) + data object LastRead : Type(0b00000100) + data object LastUpdate : Type(0b00001000) + data object UnreadCount : Type(0b00001100) + data object TotalChapters : Type(0b00010000) + data object LatestChapter : Type(0b00010100) + data object ChapterFetchDate : Type(0b00011000) + data object DateAdded : Type(0b00011100) companion object { fun valueOf(flag: Long): Type { @@ -44,8 +44,8 @@ data class LibrarySort( override val mask: Long = 0b01000000L - object Ascending : Direction(0b01000000) - object Descending : Direction(0b00000000) + data object Ascending : Direction(0b01000000) + data object Descending : Direction(0b00000000) companion object { fun valueOf(flag: Long): Direction { diff --git a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt index 435d87a29..89950d30d 100644 --- a/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt +++ b/domain/src/main/java/tachiyomi/domain/release/interactor/GetApplicationRelease.kt @@ -72,8 +72,8 @@ class GetApplicationRelease( ) sealed class Result { - class NewUpdate(val release: Release) : Result() - object NoNewUpdate : Result() - object ThirdPartyInstallation : Result() + data class NewUpdate(val release: Release) : Result() + data object NoNewUpdate : Result() + data object ThirdPartyInstallation : Result() } } diff --git a/domain/src/main/java/tachiyomi/domain/source/model/Pin.kt b/domain/src/main/java/tachiyomi/domain/source/model/Pin.kt index 07361a509..ccb629b47 100644 --- a/domain/src/main/java/tachiyomi/domain/source/model/Pin.kt +++ b/domain/src/main/java/tachiyomi/domain/source/model/Pin.kt @@ -1,9 +1,9 @@ package tachiyomi.domain.source.model sealed class Pin(val code: Int) { - object Unpinned : Pin(0b00) - object Pinned : Pin(0b01) - object Actual : Pin(0b10) + data object Unpinned : Pin(0b00) + data object Pinned : Pin(0b01) + data object Actual : Pin(0b10) } inline fun Pins(builder: Pins.PinsBuilder.() -> Unit = {}): Pins { diff --git a/gradle/compose.versions.toml b/gradle/compose.versions.toml index 1c5c86a92..01ee818ab 100644 --- a/gradle/compose.versions.toml +++ b/gradle/compose.versions.toml @@ -1,5 +1,5 @@ [versions] -compiler = "1.4.8" +compiler = "1.5.0" compose-bom = "2023.07.00-alpha01" accompanist = "0.31.5-beta" diff --git a/gradle/kotlinx.versions.toml b/gradle/kotlinx.versions.toml index 96f9677d3..82189ce32 100644 --- a/gradle/kotlinx.versions.toml +++ b/gradle/kotlinx.versions.toml @@ -1,5 +1,5 @@ [versions] -kotlin_version = "1.8.22" +kotlin_version = "1.9.0" serialization_version = "1.5.1" xml_serialization_version = "0.86.1" diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index 8d4794280..5ff2a1ce4 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -1,5 +1,5 @@ [versions] -aboutlib_version = "10.8.2" +aboutlib_version = "10.8.3" okhttp_version = "5.0.0-alpha.11" shizuku_version = "12.2.0" sqlite = "2.3.1" @@ -30,7 +30,7 @@ jsoup = "org.jsoup:jsoup:1.16.1" disklrucache = "com.jakewharton:disklrucache:2.0.2" unifile = "com.github.tachiyomiorg:unifile:17bec43" -junrar = "com.github.junrar:junrar:7.5.4" +junrar = "com.github.junrar:junrar:7.5.5" sqlite-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" } sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" } diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt index a0589f1d9..c65aa9606 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/VerticalFastScroller.kt @@ -209,7 +209,7 @@ private fun rememberColumnWidthSums( gridWidth, horizontalArrangement.spacing.roundToPx(), ).toMutableList().apply { - for (i in 1 until size) { + for (i in 1..>?) { } else if (data.isEmpty()) { Text(text = stringResource(R.string.information_no_recent)) } else { - (0 until rowCount).forEach { i -> - val coverRow = (0 until columnCount).mapNotNull { j -> + (0.. + val coverRow = (0.. data.getOrNull(j + (i * columnCount)) } if (coverRow.isNotEmpty()) {