mirror of
https://github.com/mihonapp/mihon.git
synced 2025-11-15 13:37:29 +01:00
Bump dependencies
This commit is contained in:
@@ -55,13 +55,13 @@ class ExtensionFilterScreenModel(
|
||||
}
|
||||
|
||||
sealed class ExtensionFilterEvent {
|
||||
object FailedFetchingLanguages : ExtensionFilterEvent()
|
||||
data object FailedFetchingLanguages : ExtensionFilterEvent()
|
||||
}
|
||||
|
||||
sealed class ExtensionFilterState {
|
||||
|
||||
@Immutable
|
||||
object Loading : ExtensionFilterState()
|
||||
data object Loading : ExtensionFilterState()
|
||||
|
||||
@Immutable
|
||||
data class Success(
|
||||
|
||||
@@ -163,7 +163,7 @@ class ExtensionDetailsScreenModel(
|
||||
}
|
||||
|
||||
sealed class ExtensionDetailsEvent {
|
||||
object Uninstalled : ExtensionDetailsEvent()
|
||||
data object Uninstalled : ExtensionDetailsEvent()
|
||||
}
|
||||
|
||||
@Immutable
|
||||
|
||||
@@ -54,7 +54,7 @@ class MigrationMangaScreenModel(
|
||||
}
|
||||
|
||||
sealed class MigrationMangaEvent {
|
||||
object FailedFetchingFavorites : MigrationMangaEvent()
|
||||
data object FailedFetchingFavorites : MigrationMangaEvent()
|
||||
}
|
||||
|
||||
@Immutable
|
||||
|
||||
@@ -77,7 +77,7 @@ class MigrateSourceScreenModel(
|
||||
}
|
||||
|
||||
sealed class Event {
|
||||
object FailedFetchingSourcesWithCount : Event()
|
||||
data object FailedFetchingSourcesWithCount : Event()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ class SourcesFilterScreenModel(
|
||||
|
||||
sealed class SourcesFilterState {
|
||||
|
||||
object Loading : SourcesFilterState()
|
||||
data object Loading : SourcesFilterState()
|
||||
|
||||
data class Error(
|
||||
val throwable: Throwable,
|
||||
|
||||
@@ -94,7 +94,7 @@ class SourcesScreenModel(
|
||||
}
|
||||
|
||||
sealed class Event {
|
||||
object FailedFetchingSources : Event()
|
||||
data object FailedFetchingSources : Event()
|
||||
}
|
||||
|
||||
data class Dialog(val source: Source)
|
||||
|
||||
@@ -350,8 +350,8 @@ class BrowseSourceScreenModel(
|
||||
}
|
||||
|
||||
sealed class Listing(open val query: String?, open val filters: FilterList) {
|
||||
object Popular : Listing(query = GetRemoteManga.QUERY_POPULAR, filters = FilterList())
|
||||
object Latest : Listing(query = GetRemoteManga.QUERY_LATEST, filters = FilterList())
|
||||
data object Popular : Listing(query = GetRemoteManga.QUERY_POPULAR, filters = FilterList())
|
||||
data object Latest : Listing(query = GetRemoteManga.QUERY_LATEST, filters = FilterList())
|
||||
data class Search(override val query: String?, override val filters: FilterList) : Listing(query = query, filters = filters)
|
||||
|
||||
companion object {
|
||||
@@ -366,7 +366,7 @@ class BrowseSourceScreenModel(
|
||||
}
|
||||
|
||||
sealed class Dialog {
|
||||
object Filter : Dialog()
|
||||
data object Filter : Dialog()
|
||||
data class RemoveManga(val manga: Manga) : Dialog()
|
||||
data class AddDuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog()
|
||||
data class ChangeMangaCategory(
|
||||
|
||||
@@ -177,7 +177,7 @@ enum class SourceFilter {
|
||||
}
|
||||
|
||||
sealed class SearchItemResult {
|
||||
object Loading : SearchItemResult()
|
||||
data object Loading : SearchItemResult()
|
||||
|
||||
data class Error(
|
||||
val throwable: Throwable,
|
||||
|
||||
@@ -108,20 +108,20 @@ class CategoryScreenModel(
|
||||
}
|
||||
|
||||
sealed class CategoryDialog {
|
||||
object Create : CategoryDialog()
|
||||
data object Create : CategoryDialog()
|
||||
data class Rename(val category: Category) : CategoryDialog()
|
||||
data class Delete(val category: Category) : CategoryDialog()
|
||||
}
|
||||
|
||||
sealed class CategoryEvent {
|
||||
sealed class LocalizedMessage(@StringRes val stringRes: Int) : CategoryEvent()
|
||||
object InternalError : LocalizedMessage(R.string.internal_error)
|
||||
data object InternalError : LocalizedMessage(R.string.internal_error)
|
||||
}
|
||||
|
||||
sealed class CategoryScreenState {
|
||||
|
||||
@Immutable
|
||||
object Loading : CategoryScreenState()
|
||||
data object Loading : CategoryScreenState()
|
||||
|
||||
@Immutable
|
||||
data class Success(
|
||||
|
||||
@@ -114,14 +114,14 @@ class HistoryScreenModel(
|
||||
}
|
||||
|
||||
sealed class Dialog {
|
||||
object DeleteAll : Dialog()
|
||||
data object DeleteAll : Dialog()
|
||||
data class Delete(val history: HistoryWithRelations) : Dialog()
|
||||
}
|
||||
|
||||
sealed class Event {
|
||||
data class OpenChapter(val chapter: Chapter?) : Event()
|
||||
object InternalError : Event()
|
||||
object HistoryCleared : Event()
|
||||
data object InternalError : Event()
|
||||
data object HistoryCleared : Event()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -293,8 +293,8 @@ object HomeScreen : Screen() {
|
||||
|
||||
sealed class Tab {
|
||||
data class Library(val mangaIdToOpen: Long? = null) : Tab()
|
||||
object Updates : Tab()
|
||||
object History : Tab()
|
||||
data object Updates : Tab()
|
||||
data object History : Tab()
|
||||
data class Browse(val toExtensions: Boolean = false) : Tab()
|
||||
data class More(val toDownloads: Boolean) : Tab()
|
||||
}
|
||||
|
||||
@@ -658,7 +658,7 @@ class LibraryScreenModel(
|
||||
}
|
||||
|
||||
sealed class Dialog {
|
||||
object SettingsSheet : Dialog()
|
||||
data object SettingsSheet : Dialog()
|
||||
data class ChangeCategory(val manga: List<Manga>, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
||||
data class DeleteManga(val manga: List<Manga>) : Dialog()
|
||||
}
|
||||
|
||||
@@ -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[0]
|
||||
selectedPositions[0] = selectedIndex
|
||||
} else if (selectedIndex > selectedPositions[1]) {
|
||||
range = (selectedPositions[1] + 1) until selectedIndex
|
||||
range = (selectedPositions[1] + 1)..<selectedIndex
|
||||
selectedPositions[1] = selectedIndex
|
||||
} else {
|
||||
// Just select itself
|
||||
@@ -946,9 +946,9 @@ class MangaInfoScreenModel(
|
||||
data class ChangeCategory(val manga: Manga, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
||||
data class DeleteChapters(val chapters: List<Chapter>) : 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() {
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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(),
|
||||
) {
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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<ReaderPage>) : State()
|
||||
data object Wait : State()
|
||||
data object Loading : State()
|
||||
data class Error(val error: Throwable) : State()
|
||||
data class Loaded(val pages: List<ReaderPage>) : State()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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[0]
|
||||
selectedPositions[0] = selectedIndex
|
||||
} else if (selectedIndex > selectedPositions[1]) {
|
||||
range = (selectedPositions[1] + 1) until selectedIndex
|
||||
range = (selectedPositions[1] + 1)..<selectedIndex
|
||||
selectedPositions[1] = selectedIndex
|
||||
} else {
|
||||
// Just select itself
|
||||
@@ -371,7 +371,7 @@ class UpdatesScreenModel(
|
||||
}
|
||||
|
||||
sealed class Event {
|
||||
object InternalError : Event()
|
||||
data object InternalError : Event()
|
||||
data class LibraryUpdateTriggered(val started: Boolean) : Event()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user