Bump dependencies
This commit is contained in:
parent
3f868c0435
commit
ac306547a0
55 changed files with 109 additions and 111 deletions
|
@ -18,7 +18,7 @@ class ExtensionInstallerPreference(
|
||||||
|
|
||||||
override fun key() = "extension_installer"
|
override fun key() = "extension_installer"
|
||||||
|
|
||||||
val entries get() = ExtensionInstaller.values().run {
|
val entries get() = ExtensionInstaller.entries.run {
|
||||||
if (context.hasMiuiPackageInstaller) {
|
if (context.hasMiuiPackageInstaller) {
|
||||||
filter { it != ExtensionInstaller.PACKAGEINSTALLER }
|
filter { it != ExtensionInstaller.PACKAGEINSTALLER }
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -73,8 +73,8 @@ class SetReadStatus(
|
||||||
await(manga.id, read)
|
await(manga.id, read)
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
object NoChapters : Result()
|
data object NoChapters : Result()
|
||||||
data class InternalError(val error: Throwable) : Result()
|
data class InternalError(val error: Throwable) : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -142,7 +142,7 @@ private fun Extension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT): St
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Result<out T> {
|
sealed class Result<out T> {
|
||||||
object Loading : Result<Nothing>()
|
data object Loading : Result<Nothing>()
|
||||||
object Error : Result<Nothing>()
|
data object Error : Result<Nothing>()
|
||||||
data class Success<out T>(val value: T) : Result<T>()
|
data class Success<out T>(val value: T) : Result<T>()
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,7 +56,7 @@ fun GlobalSearchToolbar(
|
||||||
navigateUp = navigateUp,
|
navigateUp = navigateUp,
|
||||||
scrollBehavior = scrollBehavior,
|
scrollBehavior = scrollBehavior,
|
||||||
)
|
)
|
||||||
if (progress in 1 until total) {
|
if (progress in 1..<total) {
|
||||||
LinearProgressIndicator(
|
LinearProgressIndicator(
|
||||||
progress = progress / total.toFloat(),
|
progress = progress / total.toFloat(),
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
|
|
|
@ -88,7 +88,7 @@ fun MangaBottomActionMenu(
|
||||||
var resetJob: Job? = remember { null }
|
var resetJob: Job? = remember { null }
|
||||||
val onLongClickItem: (Int) -> Unit = { toConfirmIndex ->
|
val onLongClickItem: (Int) -> Unit = { toConfirmIndex ->
|
||||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||||
(0 until 7).forEach { i -> confirm[i] = i == toConfirmIndex }
|
(0..<7).forEach { i -> confirm[i] = i == toConfirmIndex }
|
||||||
resetJob?.cancel()
|
resetJob?.cancel()
|
||||||
resetJob = scope.launch {
|
resetJob = scope.launch {
|
||||||
delay(1.seconds)
|
delay(1.seconds)
|
||||||
|
@ -241,7 +241,7 @@ fun LibraryBottomActionMenu(
|
||||||
var resetJob: Job? = remember { null }
|
var resetJob: Job? = remember { null }
|
||||||
val onLongClickItem: (Int) -> Unit = { toConfirmIndex ->
|
val onLongClickItem: (Int) -> Unit = { toConfirmIndex ->
|
||||||
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
|
||||||
(0 until 5).forEach { i -> confirm[i] = i == toConfirmIndex }
|
(0..<5).forEach { i -> confirm[i] = i == toConfirmIndex }
|
||||||
resetJob?.cancel()
|
resetJob?.cancel()
|
||||||
resetJob = scope.launch {
|
resetJob = scope.launch {
|
||||||
delay(1.seconds)
|
delay(1.seconds)
|
||||||
|
|
|
@ -136,7 +136,7 @@ object SettingsAppearanceScreen : SearchableSettings {
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
pref = uiPreferences.tabletUiMode(),
|
pref = uiPreferences.tabletUiMode(),
|
||||||
title = stringResource(R.string.pref_tablet_ui_mode),
|
title = stringResource(R.string.pref_tablet_ui_mode),
|
||||||
entries = TabletUiMode.values().associateWith { stringResource(it.titleResId) },
|
entries = TabletUiMode.entries.associateWith { stringResource(it.titleResId) },
|
||||||
onValueChanged = {
|
onValueChanged = {
|
||||||
context.toast(R.string.requires_app_restart)
|
context.toast(R.string.requires_app_restart)
|
||||||
true
|
true
|
||||||
|
@ -180,7 +180,7 @@ object SettingsAppearanceScreen : SearchableSettings {
|
||||||
var eventType = parser.eventType
|
var eventType = parser.eventType
|
||||||
while (eventType != XmlPullParser.END_DOCUMENT) {
|
while (eventType != XmlPullParser.END_DOCUMENT) {
|
||||||
if (eventType == XmlPullParser.START_TAG && parser.name == "locale") {
|
if (eventType == XmlPullParser.START_TAG && parser.name == "locale") {
|
||||||
for (i in 0 until parser.attributeCount) {
|
for (i in 0..<parser.attributeCount) {
|
||||||
if (parser.getAttributeName(i) == "name") {
|
if (parser.getAttributeName(i) == "name") {
|
||||||
val langTag = parser.getAttributeValue(i)
|
val langTag = parser.getAttributeValue(i)
|
||||||
val displayName = LocaleHelper.getDisplayName(langTag)
|
val displayName = LocaleHelper.getDisplayName(langTag)
|
||||||
|
|
|
@ -33,7 +33,7 @@ object SettingsReaderScreen : SearchableSettings {
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
pref = readerPref.defaultReadingMode(),
|
pref = readerPref.defaultReadingMode(),
|
||||||
title = stringResource(R.string.pref_viewer_type),
|
title = stringResource(R.string.pref_viewer_type),
|
||||||
entries = ReadingModeType.values().drop(1)
|
entries = ReadingModeType.entries.drop(1)
|
||||||
.associate { it.flagValue to stringResource(it.stringRes) },
|
.associate { it.flagValue to stringResource(it.stringRes) },
|
||||||
),
|
),
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
|
@ -84,7 +84,7 @@ object SettingsReaderScreen : SearchableSettings {
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
pref = readerPreferences.defaultOrientationType(),
|
pref = readerPreferences.defaultOrientationType(),
|
||||||
title = stringResource(R.string.pref_rotation_type),
|
title = stringResource(R.string.pref_rotation_type),
|
||||||
entries = OrientationType.values().drop(1)
|
entries = OrientationType.entries.drop(1)
|
||||||
.associate { it.flagValue to stringResource(it.stringRes) },
|
.associate { it.flagValue to stringResource(it.stringRes) },
|
||||||
),
|
),
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
|
|
|
@ -70,7 +70,7 @@ object SettingsSecurityScreen : SearchableSettings {
|
||||||
Preference.PreferenceItem.ListPreference(
|
Preference.PreferenceItem.ListPreference(
|
||||||
pref = securityPreferences.secureScreen(),
|
pref = securityPreferences.secureScreen(),
|
||||||
title = stringResource(R.string.secure_screen),
|
title = stringResource(R.string.secure_screen),
|
||||||
entries = SecurityPreferences.SecureScreenMode.values()
|
entries = SecurityPreferences.SecureScreenMode.entries
|
||||||
.associateWith { stringResource(it.titleResId) },
|
.associateWith { stringResource(it.titleResId) },
|
||||||
),
|
),
|
||||||
Preference.PreferenceItem.InfoPreference(stringResource(R.string.secure_screen_summary)),
|
Preference.PreferenceItem.InfoPreference(stringResource(R.string.secure_screen_summary)),
|
||||||
|
|
|
@ -270,7 +270,7 @@ private class ClearDatabaseScreenModel : StateScreenModel<ClearDatabaseScreenMod
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class State {
|
sealed class State {
|
||||||
object Loading : State()
|
data object Loading : State()
|
||||||
data class Ready(
|
data class Ready(
|
||||||
val items: List<SourceWithCount>,
|
val items: List<SourceWithCount>,
|
||||||
val selection: List<Long> = emptyList(),
|
val selection: List<Long> = emptyList(),
|
||||||
|
|
|
@ -75,7 +75,7 @@ private fun AppThemesList(
|
||||||
onItemClick: (AppTheme) -> Unit,
|
onItemClick: (AppTheme) -> Unit,
|
||||||
) {
|
) {
|
||||||
val appThemes = remember {
|
val appThemes = remember {
|
||||||
AppTheme.values()
|
AppTheme.entries
|
||||||
.filterNot { it.titleResId == null || (it == AppTheme.MONET && !DeviceUtil.isDynamicColorAvailable) }
|
.filterNot { it.titleResId == null || (it == AppTheme.MONET && !DeviceUtil.isDynamicColorAvailable) }
|
||||||
}
|
}
|
||||||
LazyRow(
|
LazyRow(
|
||||||
|
|
|
@ -5,7 +5,7 @@ import eu.kanade.presentation.more.stats.data.StatsData
|
||||||
|
|
||||||
sealed class StatsScreenState {
|
sealed class StatsScreenState {
|
||||||
@Immutable
|
@Immutable
|
||||||
object Loading : StatsScreenState()
|
data object Loading : StatsScreenState()
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
data class Success(
|
data class Success(
|
||||||
|
|
|
@ -24,9 +24,9 @@ import tachiyomi.presentation.core.components.SettingsChipRow
|
||||||
import tachiyomi.presentation.core.components.SliderItem
|
import tachiyomi.presentation.core.components.SliderItem
|
||||||
import java.text.NumberFormat
|
import java.text.NumberFormat
|
||||||
|
|
||||||
private val readingModeOptions = ReadingModeType.values().map { it.stringRes to it }
|
private val readingModeOptions = ReadingModeType.entries.map { it.stringRes to it }
|
||||||
private val orientationTypeOptions = OrientationType.values().map { it.stringRes to it }
|
private val orientationTypeOptions = OrientationType.entries.map { it.stringRes to it }
|
||||||
private val tappingInvertModeOptions = ReaderPreferences.TappingInvertMode.values().map { it.titleResId to it }
|
private val tappingInvertModeOptions = ReaderPreferences.TappingInvertMode.entries.map { it.titleResId to it }
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
internal fun ColumnScope.ReadingModePage(screenModel: ReaderSettingsScreenModel) {
|
internal fun ColumnScope.ReadingModePage(screenModel: ReaderSettingsScreenModel) {
|
||||||
|
|
|
@ -29,5 +29,5 @@ object AppInfo {
|
||||||
*
|
*
|
||||||
* @since extension-lib 1.5
|
* @since extension-lib 1.5
|
||||||
*/
|
*/
|
||||||
fun getSupportedImageMimeTypes(): List<String> = ImageUtil.ImageType.values().map { it.mime }
|
fun getSupportedImageMimeTypes(): List<String> = ImageUtil.ImageType.entries.map { it.mime }
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,7 @@ sealed class Location {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
object Cache : Location()
|
data object Cache : Location()
|
||||||
|
|
||||||
fun directory(context: Context): File {
|
fun directory(context: Context): File {
|
||||||
return when (this) {
|
return when (this) {
|
||||||
|
|
|
@ -66,7 +66,7 @@ class BangumiInterceptor(val bangumi: Bangumi) : Interceptor {
|
||||||
|
|
||||||
private fun addToken(token: String, oidFormBody: FormBody): FormBody {
|
private fun addToken(token: String, oidFormBody: FormBody): FormBody {
|
||||||
val newFormBody = FormBody.Builder()
|
val newFormBody = FormBody.Builder()
|
||||||
for (i in 0 until oidFormBody.size) {
|
for (i in 0..<oidFormBody.size) {
|
||||||
newFormBody.add(oidFormBody.name(i), oidFormBody.value(i))
|
newFormBody.add(oidFormBody.name(i), oidFormBody.value(i))
|
||||||
}
|
}
|
||||||
newFormBody.add("access_token", token)
|
newFormBody.add("access_token", token)
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package eu.kanade.tachiyomi.extension.model
|
package eu.kanade.tachiyomi.extension.model
|
||||||
|
|
||||||
sealed class LoadResult {
|
sealed class LoadResult {
|
||||||
class Success(val extension: Extension.Installed) : LoadResult()
|
data class Success(val extension: Extension.Installed) : LoadResult()
|
||||||
class Untrusted(val extension: Extension.Untrusted) : LoadResult()
|
data class Untrusted(val extension: Extension.Untrusted) : LoadResult()
|
||||||
object Error : LoadResult()
|
data object Error : LoadResult()
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,13 +55,13 @@ class ExtensionFilterScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class ExtensionFilterEvent {
|
sealed class ExtensionFilterEvent {
|
||||||
object FailedFetchingLanguages : ExtensionFilterEvent()
|
data object FailedFetchingLanguages : ExtensionFilterEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class ExtensionFilterState {
|
sealed class ExtensionFilterState {
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
object Loading : ExtensionFilterState()
|
data object Loading : ExtensionFilterState()
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
data class Success(
|
data class Success(
|
||||||
|
|
|
@ -163,7 +163,7 @@ class ExtensionDetailsScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class ExtensionDetailsEvent {
|
sealed class ExtensionDetailsEvent {
|
||||||
object Uninstalled : ExtensionDetailsEvent()
|
data object Uninstalled : ExtensionDetailsEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
|
|
|
@ -54,7 +54,7 @@ class MigrationMangaScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class MigrationMangaEvent {
|
sealed class MigrationMangaEvent {
|
||||||
object FailedFetchingFavorites : MigrationMangaEvent()
|
data object FailedFetchingFavorites : MigrationMangaEvent()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
|
|
|
@ -77,7 +77,7 @@ class MigrateSourceScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Event {
|
sealed class Event {
|
||||||
object FailedFetchingSourcesWithCount : Event()
|
data object FailedFetchingSourcesWithCount : Event()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -60,7 +60,7 @@ class SourcesFilterScreenModel(
|
||||||
|
|
||||||
sealed class SourcesFilterState {
|
sealed class SourcesFilterState {
|
||||||
|
|
||||||
object Loading : SourcesFilterState()
|
data object Loading : SourcesFilterState()
|
||||||
|
|
||||||
data class Error(
|
data class Error(
|
||||||
val throwable: Throwable,
|
val throwable: Throwable,
|
||||||
|
|
|
@ -94,7 +94,7 @@ class SourcesScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Event {
|
sealed class Event {
|
||||||
object FailedFetchingSources : Event()
|
data object FailedFetchingSources : Event()
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Dialog(val source: Source)
|
data class Dialog(val source: Source)
|
||||||
|
|
|
@ -350,8 +350,8 @@ class BrowseSourceScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Listing(open val query: String?, open val filters: FilterList) {
|
sealed class Listing(open val query: String?, open val filters: FilterList) {
|
||||||
object Popular : Listing(query = GetRemoteManga.QUERY_POPULAR, filters = FilterList())
|
data object Popular : Listing(query = GetRemoteManga.QUERY_POPULAR, filters = FilterList())
|
||||||
object Latest : Listing(query = GetRemoteManga.QUERY_LATEST, 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)
|
data class Search(override val query: String?, override val filters: FilterList) : Listing(query = query, filters = filters)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
|
@ -366,7 +366,7 @@ class BrowseSourceScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Dialog {
|
sealed class Dialog {
|
||||||
object Filter : Dialog()
|
data object Filter : Dialog()
|
||||||
data class RemoveManga(val manga: Manga) : Dialog()
|
data class RemoveManga(val manga: Manga) : Dialog()
|
||||||
data class AddDuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog()
|
data class AddDuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog()
|
||||||
data class ChangeMangaCategory(
|
data class ChangeMangaCategory(
|
||||||
|
|
|
@ -177,7 +177,7 @@ enum class SourceFilter {
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class SearchItemResult {
|
sealed class SearchItemResult {
|
||||||
object Loading : SearchItemResult()
|
data object Loading : SearchItemResult()
|
||||||
|
|
||||||
data class Error(
|
data class Error(
|
||||||
val throwable: Throwable,
|
val throwable: Throwable,
|
||||||
|
|
|
@ -108,20 +108,20 @@ class CategoryScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class CategoryDialog {
|
sealed class CategoryDialog {
|
||||||
object Create : CategoryDialog()
|
data object Create : CategoryDialog()
|
||||||
data class Rename(val category: Category) : CategoryDialog()
|
data class Rename(val category: Category) : CategoryDialog()
|
||||||
data class Delete(val category: Category) : CategoryDialog()
|
data class Delete(val category: Category) : CategoryDialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class CategoryEvent {
|
sealed class CategoryEvent {
|
||||||
sealed class LocalizedMessage(@StringRes val stringRes: Int) : 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 {
|
sealed class CategoryScreenState {
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
object Loading : CategoryScreenState()
|
data object Loading : CategoryScreenState()
|
||||||
|
|
||||||
@Immutable
|
@Immutable
|
||||||
data class Success(
|
data class Success(
|
||||||
|
|
|
@ -114,14 +114,14 @@ class HistoryScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Dialog {
|
sealed class Dialog {
|
||||||
object DeleteAll : Dialog()
|
data object DeleteAll : Dialog()
|
||||||
data class Delete(val history: HistoryWithRelations) : Dialog()
|
data class Delete(val history: HistoryWithRelations) : Dialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Event {
|
sealed class Event {
|
||||||
data class OpenChapter(val chapter: Chapter?) : Event()
|
data class OpenChapter(val chapter: Chapter?) : Event()
|
||||||
object InternalError : Event()
|
data object InternalError : Event()
|
||||||
object HistoryCleared : Event()
|
data object HistoryCleared : Event()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -293,8 +293,8 @@ object HomeScreen : Screen() {
|
||||||
|
|
||||||
sealed class Tab {
|
sealed class Tab {
|
||||||
data class Library(val mangaIdToOpen: Long? = null) : Tab()
|
data class Library(val mangaIdToOpen: Long? = null) : Tab()
|
||||||
object Updates : Tab()
|
data object Updates : Tab()
|
||||||
object History : Tab()
|
data object History : Tab()
|
||||||
data class Browse(val toExtensions: Boolean = false) : Tab()
|
data class Browse(val toExtensions: Boolean = false) : Tab()
|
||||||
data class More(val toDownloads: Boolean) : Tab()
|
data class More(val toDownloads: Boolean) : Tab()
|
||||||
}
|
}
|
||||||
|
|
|
@ -658,7 +658,7 @@ class LibraryScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Dialog {
|
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 ChangeCategory(val manga: List<Manga>, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
||||||
data class DeleteManga(val manga: List<Manga>) : Dialog()
|
data class DeleteManga(val manga: List<Manga>) : Dialog()
|
||||||
}
|
}
|
||||||
|
|
|
@ -854,10 +854,10 @@ class MangaInfoScreenModel(
|
||||||
// Try to select the items in-between when possible
|
// Try to select the items in-between when possible
|
||||||
val range: IntRange
|
val range: IntRange
|
||||||
if (selectedIndex < selectedPositions[0]) {
|
if (selectedIndex < selectedPositions[0]) {
|
||||||
range = selectedIndex + 1 until selectedPositions[0]
|
range = selectedIndex + 1..<selectedPositions[0]
|
||||||
selectedPositions[0] = selectedIndex
|
selectedPositions[0] = selectedIndex
|
||||||
} else if (selectedIndex > selectedPositions[1]) {
|
} else if (selectedIndex > selectedPositions[1]) {
|
||||||
range = (selectedPositions[1] + 1) until selectedIndex
|
range = (selectedPositions[1] + 1)..<selectedIndex
|
||||||
selectedPositions[1] = selectedIndex
|
selectedPositions[1] = selectedIndex
|
||||||
} else {
|
} else {
|
||||||
// Just select itself
|
// Just select itself
|
||||||
|
@ -946,9 +946,9 @@ class MangaInfoScreenModel(
|
||||||
data class ChangeCategory(val manga: Manga, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
data class ChangeCategory(val manga: Manga, val initialSelection: List<CheckboxState<Category>>) : Dialog()
|
||||||
data class DeleteChapters(val chapters: List<Chapter>) : Dialog()
|
data class DeleteChapters(val chapters: List<Chapter>) : Dialog()
|
||||||
data class DuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog()
|
data class DuplicateManga(val manga: Manga, val duplicate: Manga) : Dialog()
|
||||||
object SettingsSheet : Dialog()
|
data object SettingsSheet : Dialog()
|
||||||
object TrackSheet : Dialog()
|
data object TrackSheet : Dialog()
|
||||||
object FullCover : Dialog()
|
data object FullCover : Dialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun dismissDialog() {
|
fun dismissDialog() {
|
||||||
|
|
|
@ -109,7 +109,7 @@ private class MoreScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class DownloadQueueState {
|
sealed class DownloadQueueState {
|
||||||
object Stopped : DownloadQueueState()
|
data object Stopped : DownloadQueueState()
|
||||||
data class Paused(val pending: Int) : DownloadQueueState()
|
data class Paused(val pending: Int) : DownloadQueueState()
|
||||||
data class Downloading(val pending: Int) : DownloadQueueState()
|
data class Downloading(val pending: Int) : DownloadQueueState()
|
||||||
}
|
}
|
||||||
|
|
|
@ -485,7 +485,7 @@ class ReaderActivity : BaseActivity() {
|
||||||
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
popupMenu(
|
popupMenu(
|
||||||
items = ReadingModeType.values().map { it.flagValue to it.stringRes },
|
items = ReadingModeType.entries.map { it.flagValue to it.stringRes },
|
||||||
selectedItemId = viewModel.getMangaReadingMode(resolveDefault = false),
|
selectedItemId = viewModel.getMangaReadingMode(resolveDefault = false),
|
||||||
) {
|
) {
|
||||||
val newReadingMode = ReadingModeType.fromPreference(itemId)
|
val newReadingMode = ReadingModeType.fromPreference(itemId)
|
||||||
|
@ -538,7 +538,7 @@ class ReaderActivity : BaseActivity() {
|
||||||
|
|
||||||
setOnClickListener {
|
setOnClickListener {
|
||||||
popupMenu(
|
popupMenu(
|
||||||
items = OrientationType.values().map { it.flagValue to it.stringRes },
|
items = OrientationType.entries.map { it.flagValue to it.stringRes },
|
||||||
selectedItemId = viewModel.manga?.orientationType?.toInt()
|
selectedItemId = viewModel.manga?.orientationType?.toInt()
|
||||||
?: readerPreferences.defaultOrientationType().get(),
|
?: readerPreferences.defaultOrientationType().get(),
|
||||||
) {
|
) {
|
||||||
|
|
|
@ -861,13 +861,13 @@ class ReaderViewModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Dialog {
|
sealed class Dialog {
|
||||||
object Loading : Dialog()
|
data object Loading : Dialog()
|
||||||
object Settings : Dialog()
|
data object Settings : Dialog()
|
||||||
data class PageActions(val page: ReaderPage) : Dialog()
|
data class PageActions(val page: ReaderPage) : Dialog()
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Event {
|
sealed class Event {
|
||||||
object ReloadViewerChapters : Event()
|
data object ReloadViewerChapters : Event()
|
||||||
data class SetOrientation(val orientation: Int) : Event()
|
data class SetOrientation(val orientation: Int) : Event()
|
||||||
data class SetCoverResult(val result: SetAsCoverResult) : Event()
|
data class SetCoverResult(val result: SetAsCoverResult) : Event()
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,9 @@ data class ReaderChapter(val chapter: Chapter) {
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class State {
|
sealed class State {
|
||||||
object Wait : State()
|
data object Wait : State()
|
||||||
object Loading : State()
|
data object Loading : State()
|
||||||
class Error(val error: Throwable) : State()
|
data class Error(val error: Throwable) : State()
|
||||||
class Loaded(val pages: List<ReaderPage>) : 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 {
|
companion object {
|
||||||
const val MASK = 0x00000038
|
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 {
|
companion object {
|
||||||
const val MASK = 0x00000007
|
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 {
|
fun isPagerType(preference: Int): Boolean {
|
||||||
val mode = fromPreference(preference)
|
val mode = fromPreference(preference)
|
||||||
|
|
|
@ -10,11 +10,11 @@ import eu.kanade.tachiyomi.util.lang.invert
|
||||||
abstract class ViewerNavigation {
|
abstract class ViewerNavigation {
|
||||||
|
|
||||||
sealed class NavigationRegion(@StringRes val nameRes: Int, val colorRes: Int) {
|
sealed class NavigationRegion(@StringRes val nameRes: Int, val colorRes: Int) {
|
||||||
object MENU : NavigationRegion(R.string.action_menu, R.color.navigation_menu)
|
data object MENU : NavigationRegion(R.string.action_menu, R.color.navigation_menu)
|
||||||
object PREV : NavigationRegion(R.string.nav_zone_prev, R.color.navigation_prev)
|
data object PREV : NavigationRegion(R.string.nav_zone_prev, R.color.navigation_prev)
|
||||||
object NEXT : NavigationRegion(R.string.nav_zone_next, R.color.navigation_next)
|
data object NEXT : NavigationRegion(R.string.nav_zone_next, R.color.navigation_next)
|
||||||
object LEFT : NavigationRegion(R.string.nav_zone_left, R.color.navigation_left)
|
data 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 RIGHT : NavigationRegion(R.string.nav_zone_right, R.color.navigation_right)
|
||||||
}
|
}
|
||||||
|
|
||||||
data class Region(
|
data class Region(
|
||||||
|
|
|
@ -295,10 +295,10 @@ class UpdatesScreenModel(
|
||||||
// Try to select the items in-between when possible
|
// Try to select the items in-between when possible
|
||||||
val range: IntRange
|
val range: IntRange
|
||||||
if (selectedIndex < selectedPositions[0]) {
|
if (selectedIndex < selectedPositions[0]) {
|
||||||
range = selectedIndex + 1 until selectedPositions[0]
|
range = selectedIndex + 1..<selectedPositions[0]
|
||||||
selectedPositions[0] = selectedIndex
|
selectedPositions[0] = selectedIndex
|
||||||
} else if (selectedIndex > selectedPositions[1]) {
|
} else if (selectedIndex > selectedPositions[1]) {
|
||||||
range = (selectedPositions[1] + 1) until selectedIndex
|
range = (selectedPositions[1] + 1)..<selectedIndex
|
||||||
selectedPositions[1] = selectedIndex
|
selectedPositions[1] = selectedIndex
|
||||||
} else {
|
} else {
|
||||||
// Just select itself
|
// Just select itself
|
||||||
|
@ -371,7 +371,7 @@ class UpdatesScreenModel(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Event {
|
sealed class Event {
|
||||||
object InternalError : Event()
|
data object InternalError : Event()
|
||||||
data class LibraryUpdateTriggered(val started: Boolean) : Event()
|
data class LibraryUpdateTriggered(val started: Boolean) : Event()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,7 +27,7 @@ object GLUtil {
|
||||||
var maximumTextureSize = 0
|
var maximumTextureSize = 0
|
||||||
|
|
||||||
// Iterate through all the configurations to located the maximum texture size
|
// Iterate through all the configurations to located the maximum texture size
|
||||||
for (i in 0 until totalConfigurations[0]) {
|
for (i in 0..<totalConfigurations[0]) {
|
||||||
// Only need to check for width since opengl textures are always squared
|
// Only need to check for width since opengl textures are always squared
|
||||||
egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize)
|
egl.eglGetConfigAttrib(display, configurationsList[i], EGL10.EGL_MAX_PBUFFER_WIDTH, textureSize)
|
||||||
|
|
||||||
|
|
|
@ -150,12 +150,12 @@ enum class ComicInfoPublishingStatus(
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun toComicInfoValue(value: Long): String {
|
fun toComicInfoValue(value: Long): String {
|
||||||
return values().firstOrNull { it.sMangaModelValue == value.toInt() }?.comicInfoValue
|
return entries.firstOrNull { it.sMangaModelValue == value.toInt() }?.comicInfoValue
|
||||||
?: UNKNOWN.comicInfoValue
|
?: UNKNOWN.comicInfoValue
|
||||||
}
|
}
|
||||||
|
|
||||||
fun toSMangaValue(value: String?): Int {
|
fun toSMangaValue(value: String?): Int {
|
||||||
return values().firstOrNull { it.comicInfoValue == value }?.sMangaModelValue
|
return entries.firstOrNull { it.comicInfoValue == value }?.sMangaModelValue
|
||||||
?: UNKNOWN.sMangaModelValue
|
?: UNKNOWN.sMangaModelValue
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -330,7 +330,7 @@ object ImageUtil {
|
||||||
}
|
}
|
||||||
|
|
||||||
return buildList {
|
return buildList {
|
||||||
val range = 0 until partCount
|
val range = 0..<partCount
|
||||||
for (index in range) {
|
for (index in range) {
|
||||||
// Only continue if the list is empty or there is image remaining
|
// Only continue if the list is empty or there is image remaining
|
||||||
if (isNotEmpty() && imageHeight <= last().bottomOffset) break
|
if (isNotEmpty() && imageHeight <= last().bottomOffset) break
|
||||||
|
@ -440,7 +440,7 @@ object ImageUtil {
|
||||||
var blackStreak = false
|
var blackStreak = false
|
||||||
var whiteStreak = false
|
var whiteStreak = false
|
||||||
val notOffset = x == left || x == right
|
val notOffset = x == left || x == right
|
||||||
inner@ for ((index, y) in (0 until image.height step image.height / 25).withIndex()) {
|
inner@ for ((index, y) in (0..<image.height step image.height / 25).withIndex()) {
|
||||||
val pixel = image[x, y]
|
val pixel = image[x, y]
|
||||||
val pixelOff = image[x + (if (x < image.width / 2) -offsetX else offsetX), y]
|
val pixelOff = image[x + (if (x < image.width / 2) -offsetX else offsetX), y]
|
||||||
if (pixel.isWhite()) {
|
if (pixel.isWhite()) {
|
||||||
|
|
|
@ -21,10 +21,8 @@ val listOfStringsAdapter = object : ColumnAdapter<List<String>, String> {
|
||||||
}
|
}
|
||||||
|
|
||||||
val updateStrategyAdapter = object : ColumnAdapter<UpdateStrategy, Long> {
|
val updateStrategyAdapter = object : ColumnAdapter<UpdateStrategy, Long> {
|
||||||
private val enumValues by lazy { UpdateStrategy.values() }
|
|
||||||
|
|
||||||
override fun decode(databaseValue: Long): UpdateStrategy =
|
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()
|
override fun encode(value: UpdateStrategy): Long = value.ordinal.toLong()
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class CreateCategoryWithName(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
data class InternalError(val error: Throwable) : Result()
|
data class InternalError(val error: Throwable) : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ class DeleteCategory(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
data class InternalError(val error: Throwable) : Result()
|
data class InternalError(val error: Throwable) : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,7 +29,7 @@ class RenameCategory(
|
||||||
suspend fun await(category: Category, name: String) = await(category.id, name)
|
suspend fun await(category: Category, name: String) = await(category.id, name)
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
data class InternalError(val error: Throwable) : Result()
|
data class InternalError(val error: Throwable) : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,8 +58,8 @@ class ReorderCategory(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
object Unchanged : Result()
|
data object Unchanged : Result()
|
||||||
data class InternalError(val error: Throwable) : Result()
|
data class InternalError(val error: Throwable) : Result()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class UpdateCategory(
|
||||||
}
|
}
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
object Success : Result()
|
data object Success : Result()
|
||||||
data class Error(val error: Exception) : Result()
|
data class Error(val error: Exception) : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,10 +2,10 @@ package tachiyomi.domain.library.model
|
||||||
|
|
||||||
sealed class LibraryDisplayMode {
|
sealed class LibraryDisplayMode {
|
||||||
|
|
||||||
object CompactGrid : LibraryDisplayMode()
|
data object CompactGrid : LibraryDisplayMode()
|
||||||
object ComfortableGrid : LibraryDisplayMode()
|
data object ComfortableGrid : LibraryDisplayMode()
|
||||||
object List : LibraryDisplayMode()
|
data object List : LibraryDisplayMode()
|
||||||
object CoverOnlyGrid : LibraryDisplayMode()
|
data object CoverOnlyGrid : LibraryDisplayMode()
|
||||||
|
|
||||||
object Serializer {
|
object Serializer {
|
||||||
fun deserialize(serialized: String): LibraryDisplayMode {
|
fun deserialize(serialized: String): LibraryDisplayMode {
|
||||||
|
|
|
@ -22,14 +22,14 @@ data class LibrarySort(
|
||||||
|
|
||||||
override val mask: Long = 0b00111100L
|
override val mask: Long = 0b00111100L
|
||||||
|
|
||||||
object Alphabetical : Type(0b00000000)
|
data object Alphabetical : Type(0b00000000)
|
||||||
object LastRead : Type(0b00000100)
|
data object LastRead : Type(0b00000100)
|
||||||
object LastUpdate : Type(0b00001000)
|
data object LastUpdate : Type(0b00001000)
|
||||||
object UnreadCount : Type(0b00001100)
|
data object UnreadCount : Type(0b00001100)
|
||||||
object TotalChapters : Type(0b00010000)
|
data object TotalChapters : Type(0b00010000)
|
||||||
object LatestChapter : Type(0b00010100)
|
data object LatestChapter : Type(0b00010100)
|
||||||
object ChapterFetchDate : Type(0b00011000)
|
data object ChapterFetchDate : Type(0b00011000)
|
||||||
object DateAdded : Type(0b00011100)
|
data object DateAdded : Type(0b00011100)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun valueOf(flag: Long): Type {
|
fun valueOf(flag: Long): Type {
|
||||||
|
@ -44,8 +44,8 @@ data class LibrarySort(
|
||||||
|
|
||||||
override val mask: Long = 0b01000000L
|
override val mask: Long = 0b01000000L
|
||||||
|
|
||||||
object Ascending : Direction(0b01000000)
|
data object Ascending : Direction(0b01000000)
|
||||||
object Descending : Direction(0b00000000)
|
data object Descending : Direction(0b00000000)
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun valueOf(flag: Long): Direction {
|
fun valueOf(flag: Long): Direction {
|
||||||
|
|
|
@ -72,8 +72,8 @@ class GetApplicationRelease(
|
||||||
)
|
)
|
||||||
|
|
||||||
sealed class Result {
|
sealed class Result {
|
||||||
class NewUpdate(val release: Release) : Result()
|
data class NewUpdate(val release: Release) : Result()
|
||||||
object NoNewUpdate : Result()
|
data object NoNewUpdate : Result()
|
||||||
object ThirdPartyInstallation : Result()
|
data object ThirdPartyInstallation : Result()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package tachiyomi.domain.source.model
|
package tachiyomi.domain.source.model
|
||||||
|
|
||||||
sealed class Pin(val code: Int) {
|
sealed class Pin(val code: Int) {
|
||||||
object Unpinned : Pin(0b00)
|
data object Unpinned : Pin(0b00)
|
||||||
object Pinned : Pin(0b01)
|
data object Pinned : Pin(0b01)
|
||||||
object Actual : Pin(0b10)
|
data object Actual : Pin(0b10)
|
||||||
}
|
}
|
||||||
|
|
||||||
inline fun Pins(builder: Pins.PinsBuilder.() -> Unit = {}): Pins {
|
inline fun Pins(builder: Pins.PinsBuilder.() -> Unit = {}): Pins {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
compiler = "1.4.8"
|
compiler = "1.5.0"
|
||||||
compose-bom = "2023.07.00-alpha01"
|
compose-bom = "2023.07.00-alpha01"
|
||||||
accompanist = "0.31.5-beta"
|
accompanist = "0.31.5-beta"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
kotlin_version = "1.8.22"
|
kotlin_version = "1.9.0"
|
||||||
serialization_version = "1.5.1"
|
serialization_version = "1.5.1"
|
||||||
xml_serialization_version = "0.86.1"
|
xml_serialization_version = "0.86.1"
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
[versions]
|
[versions]
|
||||||
aboutlib_version = "10.8.2"
|
aboutlib_version = "10.8.3"
|
||||||
okhttp_version = "5.0.0-alpha.11"
|
okhttp_version = "5.0.0-alpha.11"
|
||||||
shizuku_version = "12.2.0"
|
shizuku_version = "12.2.0"
|
||||||
sqlite = "2.3.1"
|
sqlite = "2.3.1"
|
||||||
|
@ -30,7 +30,7 @@ jsoup = "org.jsoup:jsoup:1.16.1"
|
||||||
|
|
||||||
disklrucache = "com.jakewharton:disklrucache:2.0.2"
|
disklrucache = "com.jakewharton:disklrucache:2.0.2"
|
||||||
unifile = "com.github.tachiyomiorg:unifile:17bec43"
|
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-framework = { module = "androidx.sqlite:sqlite-framework", version.ref = "sqlite" }
|
||||||
sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" }
|
sqlite-ktx = { module = "androidx.sqlite:sqlite-ktx", version.ref = "sqlite" }
|
||||||
|
|
|
@ -209,7 +209,7 @@ private fun rememberColumnWidthSums(
|
||||||
gridWidth,
|
gridWidth,
|
||||||
horizontalArrangement.spacing.roundToPx(),
|
horizontalArrangement.spacing.roundToPx(),
|
||||||
).toMutableList().apply {
|
).toMutableList().apply {
|
||||||
for (i in 1 until size) {
|
for (i in 1..<size) {
|
||||||
this[i] += this[i - 1]
|
this[i] += this[i - 1]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,8 +36,8 @@ fun UpdatesWidget(data: List<Pair<Long, Bitmap?>>?) {
|
||||||
} else if (data.isEmpty()) {
|
} else if (data.isEmpty()) {
|
||||||
Text(text = stringResource(R.string.information_no_recent))
|
Text(text = stringResource(R.string.information_no_recent))
|
||||||
} else {
|
} else {
|
||||||
(0 until rowCount).forEach { i ->
|
(0..<rowCount).forEach { i ->
|
||||||
val coverRow = (0 until columnCount).mapNotNull { j ->
|
val coverRow = (0..<columnCount).mapNotNull { j ->
|
||||||
data.getOrNull(j + (i * columnCount))
|
data.getOrNull(j + (i * columnCount))
|
||||||
}
|
}
|
||||||
if (coverRow.isNotEmpty()) {
|
if (coverRow.isNotEmpty()) {
|
||||||
|
|
Reference in a new issue