ktlint format again

This commit is contained in:
LuftVerbot 2023-11-19 16:05:25 +01:00
parent 05f91245ac
commit ea2b7fe7c0
416 changed files with 2101 additions and 1791 deletions

View file

@ -1,6 +1,6 @@
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
import java.io.FileInputStream
import java.util.Properties
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins {
id("com.android.application")
@ -110,15 +110,17 @@ android {
}
packaging {
resources.excludes.addAll(listOf(
"META-INF/DEPENDENCIES",
"LICENSE.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/README.md",
"META-INF/NOTICE",
"META-INF/*.kotlin_module",
))
resources.excludes.addAll(
listOf(
"META-INF/DEPENDENCIES",
"LICENSE.txt",
"META-INF/LICENSE",
"META-INF/LICENSE.txt",
"META-INF/README.md",
"META-INF/NOTICE",
"META-INF/*.kotlin_module",
),
)
}
dependenciesInfo {
@ -282,7 +284,7 @@ androidComponents {
// Disables standardBenchmark
if (variantBuilder.buildType == "benchmark") {
variantBuilder.enable = variantBuilder.productFlavors.containsAll(
listOf("default" to "dev")
listOf("default" to "dev"),
)
}
}
@ -318,12 +320,12 @@ tasks {
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:reportsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
project.buildDir.absolutePath + "/compose_metrics",
)
kotlinOptions.freeCompilerArgs += listOf(
"-P",
"plugin:androidx.compose.compiler.plugins.kotlin:metricsDestination=" +
project.buildDir.absolutePath + "/compose_metrics"
project.buildDir.absolutePath + "/compose_metrics",
)
}
}

View file

@ -78,7 +78,7 @@ private class BandwidthHeroDataSaver(preferences: SourcePreferences) : DataSaver
imageUrl
} else {
getUrl(
imageUrl
imageUrl,
)
}
imageUrl.contains(".gif", true) -> if (ignoreGif) imageUrl else getUrl(imageUrl)
@ -110,7 +110,7 @@ private class WsrvNlDataSaver(preferences: SourcePreferences) : DataSaver {
imageUrl
} else {
getUrl(
imageUrl
imageUrl,
)
}
imageUrl.contains(".gif", true) -> if (ignoreGif) imageUrl else getUrl(imageUrl)
@ -122,8 +122,9 @@ private class WsrvNlDataSaver(preferences: SourcePreferences) : DataSaver {
// Network Request sent to wsrv
return "https://wsrv.nl/?url=$imageUrl" + if (imageUrl.contains(".webp", true) || imageUrl.contains(
".gif",
true
)) {
true,
)
) {
if (!format) {
// Preserve output image extension for animated images(.webp and .gif)
"&q=$quality&n=-1"
@ -159,7 +160,7 @@ private class ReSmushItDataSaver(preferences: SourcePreferences) : DataSaver {
imageUrl
} else {
getUrl(
imageUrl
imageUrl,
)
}
imageUrl.contains(".gif", true) -> if (ignoreGif) imageUrl else getUrl(imageUrl)

View file

@ -22,11 +22,11 @@ class BasePreferences(
fun acraEnabled() = preferenceStore.getBoolean(
"acra.enable",
isPreviewBuildType || isReleaseBuildType
isPreviewBuildType || isReleaseBuildType,
)
fun deviceHasPip() = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O && context.packageManager.hasSystemFeature(
PackageManager.FEATURE_PICTURE_IN_PICTURE
PackageManager.FEATURE_PICTURE_IN_PICTURE,
)
enum class ExtensionInstaller(@StringRes val titleResId: Int) {

View file

@ -1,9 +1,9 @@
package eu.kanade.domain.entries.anime.interactor
import kotlin.math.pow
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.entries.anime.model.AnimeUpdate
import tachiyomi.domain.entries.anime.repository.AnimeRepository
import kotlin.math.pow
class SetAnimeViewerFlags(
private val animeRepository: AnimeRepository,

View file

@ -3,8 +3,6 @@ package eu.kanade.domain.entries.anime.interactor
import eu.kanade.domain.entries.anime.model.hasCustomCover
import eu.kanade.tachiyomi.animesource.model.SAnime
import eu.kanade.tachiyomi.data.cache.AnimeCoverCache
import java.time.ZonedDateTime
import java.util.Date
import tachiyomi.domain.entries.anime.interactor.SetAnimeFetchInterval
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.entries.anime.model.AnimeUpdate
@ -12,6 +10,8 @@ import tachiyomi.domain.entries.anime.repository.AnimeRepository
import tachiyomi.source.local.entries.anime.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.time.ZonedDateTime
import java.util.Date
class UpdateAnime(
private val animeRepository: AnimeRepository,
@ -92,7 +92,7 @@ class UpdateAnime(
suspend fun awaitUpdateCoverLastModified(mangaId: Long): Boolean {
return animeRepository.updateAnime(
AnimeUpdate(id = mangaId, coverLastModified = Date().time)
AnimeUpdate(id = mangaId, coverLastModified = Date().time),
)
}

View file

@ -3,8 +3,6 @@ package eu.kanade.domain.entries.manga.interactor
import eu.kanade.domain.entries.manga.model.hasCustomCover
import eu.kanade.tachiyomi.data.cache.MangaCoverCache
import eu.kanade.tachiyomi.source.model.SManga
import java.time.ZonedDateTime
import java.util.Date
import tachiyomi.domain.entries.manga.interactor.SetMangaFetchInterval
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.entries.manga.model.MangaUpdate
@ -12,6 +10,8 @@ import tachiyomi.domain.entries.manga.repository.MangaRepository
import tachiyomi.source.local.entries.manga.isLocal
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.time.ZonedDateTime
import java.util.Date
class UpdateManga(
private val mangaRepository: MangaRepository,
@ -92,7 +92,7 @@ class UpdateManga(
suspend fun awaitUpdateCoverLastModified(mangaId: Long): Boolean {
return mangaRepository.updateManga(
MangaUpdate(id = mangaId, coverLastModified = Date().time)
MangaUpdate(id = mangaId, coverLastModified = Date().time),
)
}

View file

@ -9,10 +9,6 @@ import eu.kanade.tachiyomi.data.download.manga.MangaDownloadProvider
import eu.kanade.tachiyomi.source.MangaSource
import eu.kanade.tachiyomi.source.model.SChapter
import eu.kanade.tachiyomi.source.online.HttpSource
import java.lang.Long.max
import java.time.ZonedDateTime
import java.util.Date
import java.util.TreeSet
import tachiyomi.data.items.chapter.ChapterSanitizer
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.items.chapter.interactor.GetChapterByMangaId
@ -25,6 +21,10 @@ import tachiyomi.domain.items.chapter.repository.ChapterRepository
import tachiyomi.domain.items.chapter.service.ChapterRecognition
import tachiyomi.source.local.entries.manga.isLocal
import uy.kohesive.injekt.api.get
import java.lang.Long.max
import java.time.ZonedDateTime
import java.util.Date
import java.util.TreeSet
class SyncChaptersWithSource(
private val downloadManager: MangaDownloadManager,
@ -103,7 +103,7 @@ class SyncChaptersWithSource(
val chapterNumber = ChapterRecognition.parseChapterNumber(
manga.title,
chapter.name,
chapter.chapterNumber
chapter.chapterNumber,
)
chapter = chapter.copy(chapterNumber = chapterNumber)
@ -122,13 +122,13 @@ class SyncChaptersWithSource(
if (shouldUpdateDbChapter.await(dbChapter, chapter)) {
val shouldRenameChapter = downloadProvider.isChapterDirNameChanged(
dbChapter,
chapter
chapter,
) &&
downloadManager.isChapterDownloaded(
dbChapter.name,
dbChapter.scanlator,
manga.title,
manga.source
manga.source,
)
if (shouldRenameChapter) {

View file

@ -1,10 +1,10 @@
package eu.kanade.domain.items.chapter.model
import data.Chapters
import eu.kanade.tachiyomi.data.database.models.manga.Chapter as DbChapter
import eu.kanade.tachiyomi.data.database.models.manga.ChapterImpl
import eu.kanade.tachiyomi.source.model.SChapter
import tachiyomi.domain.items.chapter.model.Chapter
import eu.kanade.tachiyomi.data.database.models.manga.Chapter as DbChapter
// TODO: Remove when all deps are migrated
fun Chapter.toSChapter(): SChapter {

View file

@ -27,7 +27,7 @@ fun List<Chapter>.applyFilters(manga: Manga, downloadManager: MangaDownloadManag
chapter.name,
chapter.scanlator,
manga.title,
manga.source
manga.source,
)
downloaded || isLocalManga
}

View file

@ -9,10 +9,6 @@ import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.animesource.online.AnimeHttpSource
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadManager
import eu.kanade.tachiyomi.data.download.anime.AnimeDownloadProvider
import java.lang.Long.max
import java.time.ZonedDateTime
import java.util.Date
import java.util.TreeSet
import tachiyomi.data.items.episode.EpisodeSanitizer
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.items.episode.interactor.GetEpisodeByAnimeId
@ -25,6 +21,10 @@ import tachiyomi.domain.items.episode.repository.EpisodeRepository
import tachiyomi.domain.items.episode.service.EpisodeRecognition
import tachiyomi.source.local.entries.anime.isLocal
import uy.kohesive.injekt.api.get
import java.lang.Long.max
import java.time.ZonedDateTime
import java.util.Date
import java.util.TreeSet
class SyncEpisodesWithSource(
private val downloadManager: AnimeDownloadManager,
@ -103,7 +103,7 @@ class SyncEpisodesWithSource(
val episodeNumber = EpisodeRecognition.parseEpisodeNumber(
anime.title,
episode.name,
episode.episodeNumber
episode.episodeNumber,
)
episode = episode.copy(episodeNumber = episodeNumber)
@ -122,13 +122,13 @@ class SyncEpisodesWithSource(
if (shouldUpdateDbEpisode.await(dbEpisode, episode)) {
val shouldRenameEpisode = downloadProvider.isEpisodeDirNameChanged(
dbEpisode,
episode
episode,
) &&
downloadManager.isEpisodeDownloaded(
dbEpisode.name,
dbEpisode.scanlator,
anime.title,
anime.source
anime.source,
)
if (shouldRenameEpisode) {
@ -142,7 +142,7 @@ class SyncEpisodesWithSource(
)
if (episode.dateUpload != 0L) {
toChangeEpisode = toChangeEpisode.copy(
dateUpload = sourceEpisode.dateUpload
dateUpload = sourceEpisode.dateUpload,
)
}
toChange.add(toChangeEpisode)

View file

@ -2,9 +2,9 @@ package eu.kanade.domain.items.episode.model
import dataanime.Episodes
import eu.kanade.tachiyomi.animesource.model.SEpisode
import eu.kanade.tachiyomi.data.database.models.anime.Episode as DbEpisode
import eu.kanade.tachiyomi.data.database.models.anime.EpisodeImpl
import tachiyomi.domain.items.episode.model.Episode
import eu.kanade.tachiyomi.data.database.models.anime.Episode as DbEpisode
// TODO: Remove when all deps are migrated
fun Episode.toSEpisode(): SEpisode {

View file

@ -27,7 +27,7 @@ fun List<Episode>.applyFilters(anime: Anime, downloadManager: AnimeDownloadManag
episode.name,
episode.scanlator,
anime.title,
anime.source
anime.source,
)
downloaded || isLocalAnime
}

View file

@ -2,14 +2,14 @@ package eu.kanade.domain.source.anime.interactor
import eu.kanade.domain.source.service.SetMigrateSorting
import eu.kanade.domain.source.service.SourcePreferences
import java.text.Collator
import java.util.Collections
import java.util.Locale
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import tachiyomi.domain.source.anime.model.AnimeSource
import tachiyomi.domain.source.anime.repository.AnimeSourceRepository
import tachiyomi.source.local.entries.anime.LocalAnimeSource
import java.text.Collator
import java.util.Collections
import java.util.Locale
class GetAnimeSourcesWithFavoriteCount(
private val repository: AnimeSourceRepository,
@ -44,7 +44,7 @@ class GetAnimeSourcesWithFavoriteCount(
b.first.isStub && a.first.isStub.not() -> 1
else -> collator.compare(
a.first.name.lowercase(locale),
b.first.name.lowercase(locale)
b.first.name.lowercase(locale),
)
}
}

View file

@ -2,11 +2,11 @@ package eu.kanade.domain.source.anime.interactor
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.util.system.LocaleHelper
import java.util.SortedMap
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import tachiyomi.domain.source.anime.model.AnimeSource
import tachiyomi.domain.source.anime.repository.AnimeSourceRepository
import java.util.SortedMap
class GetLanguagesWithAnimeSources(
private val repository: AnimeSourceRepository,

View file

@ -25,7 +25,7 @@ class ToggleAnimeSource(
disabled.minus(transformedSourceIds)
} else {
disabled.plus(
transformedSourceIds
transformedSourceIds,
)
}
}

View file

@ -2,11 +2,11 @@ package eu.kanade.domain.source.manga.interactor
import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.util.system.LocaleHelper
import java.util.SortedMap
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import tachiyomi.domain.source.manga.model.Source
import tachiyomi.domain.source.manga.repository.MangaSourceRepository
import java.util.SortedMap
class GetLanguagesWithMangaSources(
private val repository: MangaSourceRepository,

View file

@ -2,14 +2,14 @@ package eu.kanade.domain.source.manga.interactor
import eu.kanade.domain.source.service.SetMigrateSorting
import eu.kanade.domain.source.service.SourcePreferences
import java.text.Collator
import java.util.Collections
import java.util.Locale
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.combine
import tachiyomi.domain.source.manga.model.Source
import tachiyomi.domain.source.manga.repository.MangaSourceRepository
import tachiyomi.source.local.entries.manga.LocalMangaSource
import java.text.Collator
import java.util.Collections
import java.util.Locale
class GetMangaSourcesWithFavoriteCount(
private val repository: MangaSourceRepository,
@ -44,7 +44,7 @@ class GetMangaSourcesWithFavoriteCount(
b.first.isStub && a.first.isStub.not() -> 1
else -> collator.compare(
a.first.name.lowercase(locale),
b.first.name.lowercase(locale)
b.first.name.lowercase(locale),
)
}
}

View file

@ -25,7 +25,7 @@ class ToggleMangaSource(
disabled.minus(transformedSourceIds)
} else {
disabled.plus(
transformedSourceIds
transformedSourceIds,
)
}
}

View file

@ -15,24 +15,24 @@ class SourcePreferences(
"pref_display_mode_catalogue",
LibraryDisplayMode.default,
LibraryDisplayMode.Serializer::serialize,
LibraryDisplayMode.Serializer::deserialize
LibraryDisplayMode.Serializer::deserialize,
)
fun enabledLanguages() = preferenceStore.getStringSet(
"source_languages",
LocaleHelper.getDefaultEnabledLanguages()
LocaleHelper.getDefaultEnabledLanguages(),
)
fun showNsfwSource() = preferenceStore.getBoolean("show_nsfw_source", true)
fun migrationSortingMode() = preferenceStore.getEnum(
"pref_migration_sorting",
SetMigrateSorting.Mode.ALPHABETICAL
SetMigrateSorting.Mode.ALPHABETICAL,
)
fun migrationSortingDirection() = preferenceStore.getEnum(
"pref_migration_direction",
SetMigrateSorting.Direction.ASCENDING
SetMigrateSorting.Direction.ASCENDING,
)
fun trustedSignatures() = preferenceStore.getStringSet("trusted_signatures", emptySet())
@ -53,12 +53,12 @@ class SourcePreferences(
fun hideInAnimeLibraryItems() = preferenceStore.getBoolean(
"browse_hide_in_anime_library_items",
false
false,
)
fun hideInMangaLibraryItems() = preferenceStore.getBoolean(
"browse_hide_in_library_items",
false
false,
)
// SY -->
@ -81,7 +81,7 @@ class SourcePreferences(
fun dataSaverImageFormatJpeg() = preferenceStore.getBoolean(
"data_saver_image_format_jpeg",
false
false,
)
fun dataSaverServer() = preferenceStore.getString("data_saver_server", "")

View file

@ -36,7 +36,7 @@ class RefreshAnimeTracks(
syncEpisodeProgressWithTrack.await(
animeId,
track,
service.animeService
service.animeService,
)
}
null

View file

@ -1,7 +1,7 @@
package eu.kanade.domain.track.anime.model
import eu.kanade.tachiyomi.data.database.models.anime.AnimeTrack as DbAnimeTrack
import tachiyomi.domain.track.anime.model.AnimeTrack
import eu.kanade.tachiyomi.data.database.models.anime.AnimeTrack as DbAnimeTrack
fun AnimeTrack.copyPersonalFrom(other: AnimeTrack): AnimeTrack {
return this.copy(
@ -14,7 +14,7 @@ fun AnimeTrack.copyPersonalFrom(other: AnimeTrack): AnimeTrack {
}
fun AnimeTrack.toDbTrack(): DbAnimeTrack = eu.kanade.tachiyomi.data.database.models.anime.AnimeTrack.create(
syncId
syncId,
).also {
it.id = id
it.anime_id = animeId

View file

@ -12,8 +12,6 @@ import eu.kanade.domain.track.anime.model.toDbTrack
import eu.kanade.domain.track.anime.store.DelayedAnimeTrackingStore
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.util.system.workManager
import kotlin.time.Duration.Companion.minutes
import kotlin.time.toJavaDuration
import logcat.LogPriority
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat
@ -21,6 +19,8 @@ import tachiyomi.domain.track.anime.interactor.GetAnimeTracks
import tachiyomi.domain.track.anime.interactor.InsertAnimeTrack
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import kotlin.time.Duration.Companion.minutes
import kotlin.time.toJavaDuration
class DelayedAnimeTrackingUpdateJob(context: Context, workerParams: WorkerParameters) :
CoroutineWorker(context, workerParams) {

View file

@ -1,7 +1,7 @@
package eu.kanade.domain.track.manga.model
import eu.kanade.tachiyomi.data.database.models.manga.MangaTrack as DbMangaTrack
import tachiyomi.domain.track.manga.model.MangaTrack
import eu.kanade.tachiyomi.data.database.models.manga.MangaTrack as DbMangaTrack
fun MangaTrack.copyPersonalFrom(other: MangaTrack): MangaTrack {
return this.copy(
@ -14,7 +14,7 @@ fun MangaTrack.copyPersonalFrom(other: MangaTrack): MangaTrack {
}
fun MangaTrack.toDbTrack(): DbMangaTrack = eu.kanade.tachiyomi.data.database.models.manga.MangaTrack.create(
syncId
syncId,
).also {
it.id = id
it.manga_id = mangaId

View file

@ -12,8 +12,6 @@ import eu.kanade.domain.track.manga.model.toDbTrack
import eu.kanade.domain.track.manga.store.DelayedMangaTrackingStore
import eu.kanade.tachiyomi.data.track.TrackManager
import eu.kanade.tachiyomi.util.system.workManager
import kotlin.time.Duration.Companion.minutes
import kotlin.time.toJavaDuration
import logcat.LogPriority
import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat
@ -21,6 +19,8 @@ import tachiyomi.domain.track.manga.interactor.GetMangaTracks
import tachiyomi.domain.track.manga.interactor.InsertMangaTrack
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import kotlin.time.Duration.Companion.minutes
import kotlin.time.toJavaDuration
class DelayedMangaTrackingUpdateJob(context: Context, workerParams: WorkerParameters) :
CoroutineWorker(context, workerParams) {

View file

@ -27,7 +27,7 @@ class TrackPreferences(
fun showNextEpisodeAiringTime() = preferenceStore.getBoolean(
"show_next_episode_airing_time",
true
true,
)
companion object {

View file

@ -6,11 +6,11 @@ import eu.kanade.domain.ui.model.TabletUiMode
import eu.kanade.domain.ui.model.ThemeMode
import eu.kanade.tachiyomi.util.system.DeviceUtil
import eu.kanade.tachiyomi.util.system.isDynamicColorAvailable
import tachiyomi.core.preference.PreferenceStore
import tachiyomi.core.preference.getEnum
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Locale
import tachiyomi.core.preference.PreferenceStore
import tachiyomi.core.preference.getEnum
class UiPreferences(
private val preferenceStore: PreferenceStore,

View file

@ -27,7 +27,7 @@ fun BaseBrowseItem(
)
.padding(
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small
vertical = MaterialTheme.padding.small,
),
verticalAlignment = Alignment.CenterVertically,
) {

View file

@ -237,7 +237,7 @@ private fun DetailsHeader(
)
val strippedPkgName = extension.pkgName.substringAfter(
"eu.kanade.tachiyomi.animeextension."
"eu.kanade.tachiyomi.animeextension.",
)
Text(

View file

@ -297,7 +297,7 @@ private fun AnimeExtensionItemContent(
Text(
text = LocaleHelper.getSourceDisplayName(
extension.lang,
LocalContext.current
LocalContext.current,
),
)
}

View file

@ -103,7 +103,7 @@ private fun AnimeSourceHeader(
modifier = modifier
.padding(
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small
vertical = MaterialTheme.padding.small,
),
style = MaterialTheme.typography.header,
)
@ -151,7 +151,7 @@ private fun AnimeSourcePinButton(
MaterialTheme.colorScheme.primary
} else {
MaterialTheme.colorScheme.onBackground.copy(
alpha = SecondaryItemAlpha
alpha = SecondaryItemAlpha,
)
}
val description = if (isPinned) R.string.action_unpin else R.string.action_pin

View file

@ -104,11 +104,11 @@ private fun MigrateAnimeSourceList(
when (sortingMode) {
SetMigrateSorting.Mode.ALPHABETICAL -> Icon(
Icons.Outlined.SortByAlpha,
contentDescription = stringResource(R.string.action_sort_alpha)
contentDescription = stringResource(R.string.action_sort_alpha),
)
SetMigrateSorting.Mode.TOTAL -> Icon(
Icons.Outlined.Numbers,
contentDescription = stringResource(R.string.action_sort_count)
contentDescription = stringResource(R.string.action_sort_count),
)
}
}
@ -116,11 +116,11 @@ private fun MigrateAnimeSourceList(
when (sortingDirection) {
SetMigrateSorting.Direction.ASCENDING -> Icon(
Icons.Outlined.ArrowUpward,
contentDescription = stringResource(R.string.action_asc)
contentDescription = stringResource(R.string.action_asc),
)
SetMigrateSorting.Direction.DESCENDING -> Icon(
Icons.Outlined.ArrowDownward,
contentDescription = stringResource(R.string.action_desc)
contentDescription = stringResource(R.string.action_desc),
)
}
}

View file

@ -129,7 +129,7 @@ private fun AnimeExtension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT
value = try {
val appInfo = AnimeExtensionLoader.getAnimeExtensionPackageInfoFromPkgName(
context,
pkgName
pkgName,
)!!.applicationInfo
val appResources = context.packageManager.getResourcesForApplication(appInfo)
Result.Success(

View file

@ -56,7 +56,7 @@ fun GlobalAnimeSearchToolbar(
navigateUp = navigateUp,
scrollBehavior = scrollBehavior,
)
if (progress in 1..< total) {
if (progress in 1..<total) {
LinearProgressIndicator(
progress = progress / total.toFloat(),
modifier = Modifier

View file

@ -298,7 +298,7 @@ private fun ExtensionItemContent(
Text(
text = LocaleHelper.getSourceDisplayName(
extension.lang,
LocalContext.current
LocalContext.current,
),
)
}

View file

@ -103,7 +103,7 @@ private fun SourceHeader(
modifier = modifier
.padding(
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small
vertical = MaterialTheme.padding.small,
),
style = MaterialTheme.typography.header,
)
@ -151,7 +151,7 @@ private fun SourcePinButton(
MaterialTheme.colorScheme.primary
} else {
MaterialTheme.colorScheme.onBackground.copy(
alpha = SecondaryItemAlpha
alpha = SecondaryItemAlpha,
)
}
val description = if (isPinned) R.string.action_unpin else R.string.action_pin

View file

@ -104,11 +104,11 @@ private fun MigrateSourceList(
when (sortingMode) {
SetMigrateSorting.Mode.ALPHABETICAL -> Icon(
Icons.Outlined.SortByAlpha,
contentDescription = stringResource(R.string.action_sort_alpha)
contentDescription = stringResource(R.string.action_sort_alpha),
)
SetMigrateSorting.Mode.TOTAL -> Icon(
Icons.Outlined.Numbers,
contentDescription = stringResource(R.string.action_sort_count)
contentDescription = stringResource(R.string.action_sort_count),
)
}
}
@ -116,11 +116,11 @@ private fun MigrateSourceList(
when (sortingDirection) {
SetMigrateSorting.Direction.ASCENDING -> Icon(
Icons.Outlined.ArrowUpward,
contentDescription = stringResource(R.string.action_asc)
contentDescription = stringResource(R.string.action_asc),
)
SetMigrateSorting.Direction.DESCENDING -> Icon(
Icons.Outlined.ArrowDownward,
contentDescription = stringResource(R.string.action_desc)
contentDescription = stringResource(R.string.action_desc),
)
}
}

View file

@ -129,7 +129,7 @@ private fun MangaExtension.getIcon(density: Int = DisplayMetrics.DENSITY_DEFAULT
value = try {
val appInfo = MangaExtensionLoader.getMangaExtensionPackageInfoFromPkgName(
context,
pkgName
pkgName,
)!!.applicationInfo
val appResources = context.packageManager.getResourcesForApplication(appInfo)
Result.Success(

View file

@ -49,7 +49,7 @@ fun AnimeCategoryScreen(
categories = state.categories,
lazyListState = lazyListState,
paddingValues = contentPadding + topSmallPaddingValues + PaddingValues(
horizontal = MaterialTheme.padding.medium
horizontal = MaterialTheme.padding.medium,
),
onClickRename = onClickRename,
onClickHide = onClickHide,

View file

@ -65,7 +65,7 @@ fun ChangeCategoryDialog(
TextButton(onClick = {
onDismissRequest()
onEditCategories()
},) {
}) {
Text(text = stringResource(R.string.action_edit))
}
Spacer(modifier = Modifier.weight(1f))

View file

@ -49,7 +49,7 @@ fun MangaCategoryScreen(
categories = state.categories,
lazyListState = lazyListState,
paddingValues = contentPadding + topSmallPaddingValues + PaddingValues(
horizontal = MaterialTheme.padding.medium
horizontal = MaterialTheme.padding.medium,
),
onClickRename = onClickRename,
onClickHide = onClickHide,

View file

@ -15,9 +15,9 @@ import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource
import eu.kanade.tachiyomi.R
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.delay
import tachiyomi.domain.category.model.Category
import kotlin.time.Duration.Companion.seconds
@Composable
fun CategoryCreateDialog(
@ -146,7 +146,7 @@ fun CategoryDeleteDialog(
TextButton(onClick = {
onDelete()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},

View file

@ -235,7 +235,7 @@ fun AppBarActions(
Icon(
Icons.Outlined.MoreVert,
contentDescription = stringResource(
R.string.abc_action_menu_overflow_description
R.string.abc_action_menu_overflow_description,
),
)
}
@ -327,9 +327,11 @@ fun SearchToolbar(
placeholder = {
Text(
modifier = Modifier.secondaryItemAlpha(),
text = (placeholderText ?: stringResource(
R.string.action_search_hint
)),
text = (
placeholderText ?: stringResource(
R.string.action_search_hint,
)
),
maxLines = 1,
overflow = TextOverflow.Ellipsis,
style = MaterialTheme.typography.titleMedium.copy(

View file

@ -7,7 +7,6 @@ import androidx.compose.material.icons.outlined.ArrowLeft
import androidx.compose.material.icons.outlined.ArrowRight
import androidx.compose.material.icons.outlined.RadioButtonChecked
import androidx.compose.material.icons.outlined.RadioButtonUnchecked
import androidx.compose.material3.DropdownMenu as ComposeDropdownMenu
import androidx.compose.material3.DropdownMenuItem
import androidx.compose.material3.Icon
import androidx.compose.material3.MaterialTheme
@ -24,6 +23,7 @@ import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.PopupProperties
import eu.kanade.tachiyomi.R
import androidx.compose.material3.DropdownMenu as ComposeDropdownMenu
@Composable
fun DropdownMenu(

View file

@ -5,9 +5,9 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext
import eu.kanade.tachiyomi.util.lang.toRelativeString
import tachiyomi.presentation.core.components.ListGroupHeader
import java.text.DateFormat
import java.util.Date
import tachiyomi.presentation.core.components.ListGroupHeader
@Composable
fun RelativeDateHeader(

View file

@ -63,10 +63,12 @@ fun TabbedDialog(
TabRow(
modifier = Modifier.weight(1f),
selectedTabIndex = pagerState.currentPage,
indicator = { TabIndicator(
it[pagerState.currentPage],
pagerState.currentPageOffsetFraction
) },
indicator = {
TabIndicator(
it[pagerState.currentPage],
pagerState.currentPageOffsetFraction,
)
},
divider = {},
) {
tabTitles.fastForEachIndexed { i, tab ->

View file

@ -98,10 +98,12 @@ fun TabbedScreen(
Tab(
selected = state.currentPage == index,
onClick = { scope.launch { state.animateScrollToPage(index) } },
text = { TabText(
text = stringResource(tab.titleRes),
badgeCount = tab.badgeNumber
) },
text = {
TabText(
text = stringResource(tab.titleRes),
badgeCount = tab.badgeNumber,
)
},
unselectedContentColor = MaterialTheme.colorScheme.onSurface,
)
}

View file

@ -35,7 +35,7 @@ fun CrashScreen(
headingText = stringResource(R.string.crash_screen_title),
subtitleText = stringResource(
R.string.crash_screen_description,
stringResource(R.string.app_name)
stringResource(R.string.app_name),
),
acceptText = stringResource(R.string.pref_dump_crash_logs),
onAcceptClick = {

View file

@ -56,13 +56,13 @@ import androidx.compose.ui.unit.dp
import eu.kanade.presentation.components.EntryDownloadDropdownMenu
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.player.settings.PlayerPreferences
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.Job
import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import kotlin.time.Duration.Companion.seconds
@Composable
fun EntryBottomActionMenu(
@ -90,7 +90,7 @@ fun EntryBottomActionMenu(
modifier = modifier,
shape = MaterialTheme.shapes.large.copy(
bottomEnd = ZeroCornerSize,
bottomStart = ZeroCornerSize
bottomStart = ZeroCornerSize,
),
tonalElevation = 3.dp,
) {
@ -270,7 +270,7 @@ fun LibraryBottomActionMenu(
modifier = modifier,
shape = MaterialTheme.shapes.large.copy(
bottomEnd = ZeroCornerSize,
bottomStart = ZeroCornerSize
bottomStart = ZeroCornerSize,
),
tonalElevation = 3.dp,
) {
@ -279,7 +279,7 @@ fun LibraryBottomActionMenu(
var resetJob: Job? = remember { null }
val onLongClickItem: (Int) -> Unit = { toConfirmIndex ->
haptic.performHapticFeedback(HapticFeedbackType.LongPress)
(0 ..<5).forEach { i -> confirm[i] = i == toConfirmIndex }
(0..<5).forEach { i -> confirm[i] = i == toConfirmIndex }
resetJob?.cancel()
resetJob = scope.launch {
delay(1.seconds)

View file

@ -92,7 +92,7 @@ fun SetIntervalDialog(
TextButton(onClick = {
onValueChanged(selectedInterval)
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},

View file

@ -76,9 +76,6 @@ import eu.kanade.tachiyomi.ui.entries.anime.AnimeScreenModel
import eu.kanade.tachiyomi.ui.entries.anime.EpisodeItem
import eu.kanade.tachiyomi.util.lang.toRelativeString
import eu.kanade.tachiyomi.util.system.copyToClipboard
import java.text.DateFormat
import java.util.Date
import java.util.concurrent.TimeUnit
import kotlinx.coroutines.delay
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.domain.items.episode.model.Episode
@ -92,6 +89,9 @@ import tachiyomi.presentation.core.components.material.PullRefresh
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.util.isScrolledToEnd
import tachiyomi.presentation.core.util.isScrollingUp
import java.text.DateFormat
import java.util.Date
import java.util.concurrent.TimeUnit
@Composable
fun AnimeScreen(
@ -651,10 +651,12 @@ fun AnimeScreenLargeImpl(
}
Text(text = stringResource(id))
},
icon = { Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = null
) },
icon = {
Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = null,
)
},
onClick = onContinueWatching,
expanded = episodeListState.isScrollingUp() || episodeListState.isScrolledToEnd(),
)
@ -886,12 +888,14 @@ private fun LazyListScope.sharedEpisodeItems(
onEpisodeItemClick(
episodeItem = episodeItem,
episodes = episodes,
onToggleSelection = { onEpisodeSelected(
episodeItem,
!episodeItem.selected,
true,
false
) },
onToggleSelection = {
onEpisodeSelected(
episodeItem,
!episodeItem.selected,
true,
false,
)
},
onEpisodeClicked = onEpisodeClicked,
)
},

View file

@ -236,7 +236,7 @@ private fun VideoList(
listOf(episode),
true,
it,
selectedVideo
selectedVideo,
)
}
@ -254,7 +254,7 @@ private fun VideoList(
anime.id,
episode.id,
true,
selectedVideo
selectedVideo,
)
}
},
@ -274,7 +274,10 @@ private fun VideoList(
ClickableRow(
text = video.quality,
icon = null,
onClick = { selectedVideo = video; showAllQualities = false },
onClick = {
selectedVideo = video
showAllQualities = false
},
)
}
}
@ -301,19 +304,28 @@ private fun QualityOptions(
ClickableRow(
text = stringResource(R.string.action_start_download_internally),
icon = Icons.Outlined.Download,
onClick = { onDownloadClicked(); closeMenu() },
onClick = {
onDownloadClicked()
closeMenu()
},
)
ClickableRow(
text = stringResource(R.string.action_start_download_externally),
icon = Icons.Outlined.SystemUpdateAlt,
onClick = { onExtDownloadClicked(); closeMenu() },
onClick = {
onExtDownloadClicked()
closeMenu()
},
)
ClickableRow(
text = stringResource(R.string.action_play_externally),
icon = Icons.Outlined.OpenInNew,
onClick = { onExtPlayerClicked(); closeMenu() },
onClick = {
onExtPlayerClicked()
closeMenu()
},
)
}
}

View file

@ -123,7 +123,7 @@ fun AnimeCoverDialog(
Icon(
imageVector = Icons.Outlined.Edit,
contentDescription = stringResource(
R.string.action_edit_cover
R.string.action_edit_cover,
),
)
}

View file

@ -51,13 +51,13 @@ import androidx.compose.ui.unit.sp
import eu.kanade.presentation.entries.DotSeparatorText
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.download.anime.model.AnimeDownload
import kotlin.math.absoluteValue
import me.saket.swipe.SwipeableActionsBox
import me.saket.swipe.rememberSwipeableActionsState
import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.presentation.core.components.material.ReadItemAlpha
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
import tachiyomi.presentation.core.util.selectedBackground
import kotlin.math.absoluteValue
@Composable
fun AnimeEpisodeListItem(
@ -157,11 +157,11 @@ fun AnimeEpisodeListItem(
Icon(
imageVector = Icons.Filled.Bookmark,
contentDescription = stringResource(
R.string.action_filter_bookmarked
R.string.action_filter_bookmarked,
),
modifier = Modifier
.sizeIn(
maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp }
maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp },
),
tint = MaterialTheme.colorScheme.primary,
)

View file

@ -81,13 +81,13 @@ import eu.kanade.presentation.entries.ItemCover
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.animesource.model.SAnime
import eu.kanade.tachiyomi.util.system.copyToClipboard
import kotlin.math.absoluteValue
import kotlin.math.roundToInt
import tachiyomi.domain.entries.anime.model.Anime
import tachiyomi.presentation.core.components.material.TextButton
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.util.clickableNoIndication
import tachiyomi.presentation.core.util.secondaryItemAlpha
import kotlin.math.absoluteValue
import kotlin.math.roundToInt
private val whitespaceLineRegex = Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTILINE))
@ -196,7 +196,7 @@ fun AnimeActionRow(
title = pluralStringResource(
id = R.plurals.day,
count = fetchInterval.absoluteValue,
fetchInterval.absoluteValue
fetchInterval.absoluteValue,
),
icon = Icons.Default.HourglassEmpty,
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
@ -211,7 +211,7 @@ fun AnimeActionRow(
pluralStringResource(
id = R.plurals.num_trackers,
count = trackingCount,
trackingCount
trackingCount,
)
},
icon = if (trackingCount == 0) Icons.Outlined.Sync else Icons.Outlined.Done,
@ -246,7 +246,7 @@ fun ExpandableAnimeDescription(
}
val desc =
description.takeIf { !it.isNullOrBlank() } ?: stringResource(
R.string.description_placeholder
R.string.description_placeholder,
)
val trimmedDescription = remember(desc) {
desc
@ -426,7 +426,7 @@ private fun AnimeAndSourceTitlesLarge(
SAnime.COMPLETED.toLong() -> stringResource(R.string.completed)
SAnime.LICENSED.toLong() -> stringResource(R.string.licensed)
SAnime.PUBLISHING_FINISHED.toLong() -> stringResource(
R.string.publishing_finished
R.string.publishing_finished,
)
SAnime.CANCELLED.toLong() -> stringResource(R.string.cancelled)
SAnime.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
@ -561,7 +561,7 @@ private fun AnimeAndSourceTitlesSmall(
SAnime.COMPLETED.toLong() -> stringResource(R.string.completed)
SAnime.LICENSED.toLong() -> stringResource(R.string.licensed)
SAnime.PUBLISHING_FINISHED.toLong() -> stringResource(
R.string.publishing_finished
R.string.publishing_finished,
)
SAnime.CANCELLED.toLong() -> stringResource(R.string.cancelled)
SAnime.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
@ -627,7 +627,7 @@ private fun AnimeSummary(
)
}.map { it.measure(constraints) }
expandedHeight = expandedPlaceable.maxByOrNull { it.height }?.height?.coerceAtLeast(
shrunkHeight
shrunkHeight,
) ?: 0
val actualPlaceable = subcompose("description") {
@ -652,11 +652,11 @@ private fun AnimeSummary(
Icon(
painter = rememberAnimatedVectorPainter(image, !expanded),
contentDescription = stringResource(
if (expanded) R.string.manga_info_collapse else R.string.manga_info_expand
if (expanded) R.string.manga_info_collapse else R.string.manga_info_expand,
),
tint = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.background(
Brush.radialGradient(colors = colors.asReversed())
Brush.radialGradient(colors = colors.asReversed()),
),
)
}

View file

@ -71,8 +71,6 @@ import eu.kanade.tachiyomi.ui.entries.manga.ChapterItem
import eu.kanade.tachiyomi.ui.entries.manga.MangaScreenModel
import eu.kanade.tachiyomi.util.lang.toRelativeString
import eu.kanade.tachiyomi.util.system.copyToClipboard
import java.text.DateFormat
import java.util.Date
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.domain.items.chapter.model.Chapter
import tachiyomi.domain.items.service.missingItemsCount
@ -85,6 +83,8 @@ import tachiyomi.presentation.core.components.material.PullRefresh
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.util.isScrolledToEnd
import tachiyomi.presentation.core.util.isScrollingUp
import java.text.DateFormat
import java.util.Date
@Composable
fun MangaScreen(
@ -593,10 +593,12 @@ fun MangaScreenLargeImpl(
}
Text(text = stringResource(id))
},
icon = { Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = null
) },
icon = {
Icon(
imageVector = Icons.Filled.PlayArrow,
contentDescription = null,
)
},
onClick = onContinueReading,
expanded = chapterListState.isScrollingUp() || chapterListState.isScrolledToEnd(),
)
@ -794,12 +796,14 @@ private fun LazyListScope.sharedChapterItems(
onChapterItemClick(
chapterItem = chapterItem,
chapters = chapters,
onToggleSelection = { onChapterSelected(
chapterItem,
!chapterItem.selected,
true,
false
) },
onToggleSelection = {
onChapterSelected(
chapterItem,
!chapterItem.selected,
true,
false,
)
},
onChapterClicked = onChapterClicked,
)
},

View file

@ -50,13 +50,13 @@ import androidx.compose.ui.unit.sp
import eu.kanade.presentation.entries.DotSeparatorText
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.download.manga.model.MangaDownload
import kotlin.math.absoluteValue
import me.saket.swipe.SwipeableActionsBox
import me.saket.swipe.rememberSwipeableActionsState
import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.presentation.core.components.material.ReadItemAlpha
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
import tachiyomi.presentation.core.util.selectedBackground
import kotlin.math.absoluteValue
@Composable
fun MangaChapterListItem(
@ -156,11 +156,11 @@ fun MangaChapterListItem(
Icon(
imageVector = Icons.Filled.Bookmark,
contentDescription = stringResource(
R.string.action_filter_bookmarked
R.string.action_filter_bookmarked,
),
modifier = Modifier
.sizeIn(
maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp }
maxHeight = with(LocalDensity.current) { textHeight.toDp() - 2.dp },
),
tint = MaterialTheme.colorScheme.primary,
)

View file

@ -123,7 +123,7 @@ fun MangaCoverDialog(
Icon(
imageVector = Icons.Outlined.Edit,
contentDescription = stringResource(
R.string.action_edit_cover
R.string.action_edit_cover,
),
)
}

View file

@ -81,13 +81,13 @@ import eu.kanade.presentation.entries.ItemCover
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.system.copyToClipboard
import kotlin.math.absoluteValue
import kotlin.math.roundToInt
import tachiyomi.domain.entries.manga.model.Manga
import tachiyomi.presentation.core.components.material.TextButton
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.util.clickableNoIndication
import tachiyomi.presentation.core.util.secondaryItemAlpha
import kotlin.math.absoluteValue
import kotlin.math.roundToInt
private val whitespaceLineRegex = Regex("[\\r\\n]{2,}", setOf(RegexOption.MULTILINE))
@ -196,7 +196,7 @@ fun MangaActionRow(
title = pluralStringResource(
id = R.plurals.day,
count = fetchInterval.absoluteValue,
fetchInterval.absoluteValue
fetchInterval.absoluteValue,
),
icon = Icons.Default.HourglassEmpty,
color = if (isUserIntervalMode) MaterialTheme.colorScheme.primary else defaultActionButtonColor,
@ -211,7 +211,7 @@ fun MangaActionRow(
pluralStringResource(
id = R.plurals.num_trackers,
count = trackingCount,
trackingCount
trackingCount,
)
},
icon = if (trackingCount == 0) Icons.Outlined.Sync else Icons.Outlined.Done,
@ -246,7 +246,7 @@ fun ExpandableMangaDescription(
}
val desc =
description.takeIf { !it.isNullOrBlank() } ?: stringResource(
R.string.description_placeholder
R.string.description_placeholder,
)
val trimmedDescription = remember(desc) {
desc
@ -426,7 +426,7 @@ private fun MangaAndSourceTitlesLarge(
SManga.COMPLETED.toLong() -> stringResource(R.string.completed)
SManga.LICENSED.toLong() -> stringResource(R.string.licensed)
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(
R.string.publishing_finished
R.string.publishing_finished,
)
SManga.CANCELLED.toLong() -> stringResource(R.string.cancelled)
SManga.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
@ -561,7 +561,7 @@ private fun MangaAndSourceTitlesSmall(
SManga.COMPLETED.toLong() -> stringResource(R.string.completed)
SManga.LICENSED.toLong() -> stringResource(R.string.licensed)
SManga.PUBLISHING_FINISHED.toLong() -> stringResource(
R.string.publishing_finished
R.string.publishing_finished,
)
SManga.CANCELLED.toLong() -> stringResource(R.string.cancelled)
SManga.ON_HIATUS.toLong() -> stringResource(R.string.on_hiatus)
@ -627,7 +627,7 @@ private fun MangaSummary(
)
}.map { it.measure(constraints) }
expandedHeight = expandedPlaceable.maxByOrNull { it.height }?.height?.coerceAtLeast(
shrunkHeight
shrunkHeight,
) ?: 0
val actualPlaceable = subcompose("description") {
@ -652,11 +652,11 @@ private fun MangaSummary(
Icon(
painter = rememberAnimatedVectorPainter(image, !expanded),
contentDescription = stringResource(
if (expanded) R.string.manga_info_collapse else R.string.manga_info_expand
if (expanded) R.string.manga_info_collapse else R.string.manga_info_expand,
),
tint = MaterialTheme.colorScheme.onBackground,
modifier = Modifier.background(
Brush.radialGradient(colors = colors.asReversed())
Brush.radialGradient(colors = colors.asReversed()),
),
)
}

View file

@ -12,7 +12,7 @@ import eu.kanade.tachiyomi.util.storage.DiskUtil
@Composable
fun DiskUtil.RequestStoragePermission() {
val permissionState = rememberPermissionState(
permission = Manifest.permission.WRITE_EXTERNAL_STORAGE
permission = Manifest.permission.WRITE_EXTERNAL_STORAGE,
)
LaunchedEffect(Unit) {
permissionState.launchPermissionRequest()

View file

@ -64,7 +64,7 @@ fun HistoryDeleteDialog(
TextButton(onClick = {
onDelete(removeEverything)
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_remove))
}
},
@ -93,7 +93,7 @@ fun HistoryDeleteAllDialog(
TextButton(onClick = {
onDelete()
onDismissRequest()
},) {
}) {
Text(text = stringResource(R.string.action_ok))
}
},

View file

@ -9,11 +9,11 @@ import eu.kanade.domain.ui.UiPreferences
import eu.kanade.presentation.components.RelativeDateHeader
import eu.kanade.presentation.history.anime.AnimeHistoryItem
import eu.kanade.presentation.history.anime.AnimeHistoryUiModel
import java.text.DateFormat
import tachiyomi.domain.history.anime.model.AnimeHistoryWithRelations
import tachiyomi.presentation.core.components.FastScrollLazyColumn
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DateFormat
@Composable
fun AnimeHistoryContent(

View file

@ -43,7 +43,7 @@ fun AnimeHistoryItem(
.height(HISTORY_ITEM_HEIGHT)
.padding(
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small
vertical = MaterialTheme.padding.small,
),
verticalAlignment = Alignment.CenterVertically,
) {

View file

@ -9,11 +9,11 @@ import androidx.compose.ui.Modifier
import eu.kanade.presentation.animehistory.components.AnimeHistoryContent
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.history.anime.AnimeHistoryScreenModel
import java.util.Date
import tachiyomi.domain.history.anime.model.AnimeHistoryWithRelations
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen
import java.util.Date
@Composable
fun AnimeHistoryScreen(
@ -47,9 +47,11 @@ fun AnimeHistoryScreen(
contentPadding = contentPadding,
onClickCover = { history -> onClickCover(history.animeId) },
onClickResume = { history -> onClickResume(history.animeId, history.episodeId) },
onClickDelete = { item -> onDialogChange(
AnimeHistoryScreenModel.Dialog.Delete(item)
) },
onClickDelete = { item ->
onDialogChange(
AnimeHistoryScreenModel.Dialog.Delete(item),
)
},
)
}
}

View file

@ -7,11 +7,11 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import eu.kanade.domain.ui.UiPreferences
import eu.kanade.presentation.components.RelativeDateHeader
import java.text.DateFormat
import tachiyomi.domain.history.manga.model.MangaHistoryWithRelations
import tachiyomi.presentation.core.components.FastScrollLazyColumn
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DateFormat
@Composable
fun MangaHistoryContent(

View file

@ -43,7 +43,7 @@ fun MangaHistoryItem(
.height(HISTORY_ITEM_HEIGHT)
.padding(
horizontal = MaterialTheme.padding.medium,
vertical = MaterialTheme.padding.small
vertical = MaterialTheme.padding.small,
),
verticalAlignment = Alignment.CenterVertically,
) {

View file

@ -8,11 +8,11 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.history.manga.MangaHistoryScreenModel
import java.util.Date
import tachiyomi.domain.history.manga.model.MangaHistoryWithRelations
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen
import java.util.Date
@Composable
fun MangaHistoryScreen(
@ -46,9 +46,11 @@ fun MangaHistoryScreen(
contentPadding = contentPadding,
onClickCover = { history -> onClickCover(history.mangaId) },
onClickResume = { history -> onClickResume(history.mangaId, history.chapterId) },
onClickDelete = { item -> onDialogChange(
MangaHistoryScreenModel.Dialog.Delete(item)
) },
onClickDelete = { item ->
onDialogChange(
MangaHistoryScreenModel.Dialog.Delete(item),
)
},
)
}
}

View file

@ -24,10 +24,12 @@ fun LibraryTabs(
ScrollableTabRow(
selectedTabIndex = pagerState.currentPage,
edgePadding = 0.dp,
indicator = { TabIndicator(
it[pagerState.currentPage],
pagerState.currentPageOffsetFraction
) },
indicator = {
TabIndicator(
it[pagerState.currentPage],
pagerState.currentPageOffsetFraction,
)
},
// TODO: use default when width is fixed upstream
// https://issuetracker.google.com/issues/242879624
divider = {},

View file

@ -18,13 +18,13 @@ import androidx.compose.ui.platform.LocalLayoutDirection
import eu.kanade.core.preference.PreferenceMutableState
import eu.kanade.presentation.library.LibraryTabs
import eu.kanade.tachiyomi.ui.library.anime.AnimeLibraryItem
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import tachiyomi.domain.category.model.Category
import tachiyomi.domain.library.anime.LibraryAnime
import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.presentation.core.components.material.PullRefresh
import kotlin.time.Duration.Companion.seconds
@Composable
fun AnimeLibraryContent(

View file

@ -116,7 +116,7 @@ private fun ColumnScope.FilterPage(
1 -> {
val service = trackServices[0]
val filterTracker by screenModel.libraryPreferences.filterTrackedAnime(
service.id.toInt()
service.id.toInt(),
).collectAsState()
TriStateItem(
label = stringResource(R.string.action_filter_tracked),
@ -128,7 +128,7 @@ private fun ColumnScope.FilterPage(
HeadingItem(R.string.action_filter_tracked)
trackServices.map { service ->
val filterTracker by screenModel.libraryPreferences.filterTrackedAnime(
service.id.toInt()
service.id.toInt(),
).collectAsState()
TriStateItem(
label = service.name,

View file

@ -18,13 +18,13 @@ import androidx.compose.ui.platform.LocalLayoutDirection
import eu.kanade.core.preference.PreferenceMutableState
import eu.kanade.presentation.library.LibraryTabs
import eu.kanade.tachiyomi.ui.library.manga.MangaLibraryItem
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import tachiyomi.domain.category.model.Category
import tachiyomi.domain.library.manga.LibraryManga
import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.presentation.core.components.material.PullRefresh
import kotlin.time.Duration.Companion.seconds
@Composable
fun MangaLibraryContent(

View file

@ -116,7 +116,7 @@ private fun ColumnScope.FilterPage(
1 -> {
val service = trackServices[0]
val filterTracker by screenModel.libraryPreferences.filterTrackedManga(
service.id.toInt()
service.id.toInt(),
).collectAsState()
TriStateItem(
label = stringResource(R.string.action_filter_tracked),
@ -128,7 +128,7 @@ private fun ColumnScope.FilterPage(
HeadingItem(R.string.action_filter_tracked)
trackServices.map { service ->
val filterTracker by screenModel.libraryPreferences.filterTrackedManga(
service.id.toInt()
service.id.toInt(),
).collectAsState()
TriStateItem(
label = service.name,

View file

@ -63,7 +63,7 @@ fun MoreScreen(
Column(
modifier = Modifier.windowInsetsPadding(
WindowInsets.systemBars.only(
WindowInsetsSides.Top + WindowInsetsSides.Horizontal
WindowInsetsSides.Top + WindowInsetsSides.Horizontal,
),
),
) {
@ -72,7 +72,7 @@ fun MoreScreen(
textRes = R.string.fdroid_warning,
modifier = Modifier.clickable {
uriHandler.openUri(
"https://aniyomi.org/help/faq/#how-do-i-migrate-from-the-f-droid-version"
"https://aniyomi.org/help/faq/#how-do-i-migrate-from-the-f-droid-version",
)
},
)
@ -153,7 +153,7 @@ fun MoreScreen(
pluralStringResource(
id = R.plurals.download_queue_summary,
count = pending,
pending
pending,
)
}
},

View file

@ -74,7 +74,7 @@ sealed class Preference {
) : PreferenceItem<T>() {
internal fun internalSet(newValue: Any) = pref.set(newValue as T)
internal suspend fun internalOnValueChanged(newValue: Any) = onValueChanged(
newValue as T
newValue as T,
)
@Composable

View file

@ -13,9 +13,9 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastForEachIndexed
import eu.kanade.presentation.more.settings.screen.SearchableSettings
import eu.kanade.presentation.more.settings.widget.PreferenceGroupHeader
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.delay
import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import kotlin.time.Duration.Companion.seconds
/**
* Preference Screen composable which contains a list of [Preference] items

View file

@ -31,9 +31,11 @@ fun getCategoriesLabel(
val includedItemsText = when {
// Some selected, but not all
includedCategories.isNotEmpty() && includedCategories.size != allCategories.size -> includedCategories.joinToString { it.visualName(
context
) }
includedCategories.isNotEmpty() && includedCategories.size != allCategories.size -> includedCategories.joinToString {
it.visualName(
context,
)
}
// All explicitly selected
includedCategories.size == allCategories.size -> stringResource(R.string.all)
allExcluded -> stringResource(R.string.none)

View file

@ -62,7 +62,6 @@ import eu.kanade.tachiyomi.util.system.isShizukuInstalled
import eu.kanade.tachiyomi.util.system.powerManager
import eu.kanade.tachiyomi.util.system.setDefaultSettings
import eu.kanade.tachiyomi.util.system.toast
import java.io.File
import kotlinx.coroutines.launch
import logcat.LogPriority
import okhttp3.Headers
@ -74,6 +73,7 @@ import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.File
object SettingsAdvancedScreen : SearchableSettings {
@ -176,7 +176,7 @@ object SettingsAdvancedScreen : SearchableSettings {
context.startActivity(intent)
} catch (e: ActivityNotFoundException) {
context.toast(
R.string.battery_optimization_setting_activity_not_found
R.string.battery_optimization_setting_activity_not_found,
)
}
} else {
@ -214,7 +214,7 @@ object SettingsAdvancedScreen : SearchableSettings {
subtitle = stringResource(
R.string.used_cache_both,
readableAnimeSize,
readableSize
readableSize,
),
onClick = {
scope.launchNonCancellable {
@ -222,7 +222,7 @@ object SettingsAdvancedScreen : SearchableSettings {
val deletedFiles = chapterCache.clear() + episodeCache.clear()
withUIContext {
context.toast(
context.getString(R.string.cache_deleted, deletedFiles)
context.getString(R.string.cache_deleted, deletedFiles),
)
readableSizeSema++
}
@ -363,11 +363,11 @@ object SettingsAdvancedScreen : SearchableSettings {
onClick = {
MangaLibraryUpdateJob.startNow(
context,
target = MangaLibraryUpdateJob.Target.COVERS
target = MangaLibraryUpdateJob.Target.COVERS,
)
AnimeLibraryUpdateJob.startNow(
context,
target = AnimeLibraryUpdateJob.Target.COVERS
target = AnimeLibraryUpdateJob.Target.COVERS,
)
},
),
@ -378,11 +378,11 @@ object SettingsAdvancedScreen : SearchableSettings {
onClick = {
MangaLibraryUpdateJob.startNow(
context,
target = MangaLibraryUpdateJob.Target.TRACKING
target = MangaLibraryUpdateJob.Target.TRACKING,
)
AnimeLibraryUpdateJob.startNow(
context,
target = AnimeLibraryUpdateJob.Target.TRACKING
target = AnimeLibraryUpdateJob.Target.TRACKING,
)
},
),
@ -421,9 +421,11 @@ object SettingsAdvancedScreen : SearchableSettings {
AlertDialog(
onDismissRequest = dismiss,
title = { Text(text = stringResource(R.string.ext_installer_shizuku)) },
text = { Text(
text = stringResource(R.string.ext_installer_shizuku_unavailable_dialog)
) },
text = {
Text(
text = stringResource(R.string.ext_installer_shizuku_unavailable_dialog),
)
},
dismissButton = {
TextButton(onClick = dismiss) {
Text(text = stringResource(R.string.action_cancel))

View file

@ -26,7 +26,6 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.home.HomeScreen
import eu.kanade.tachiyomi.util.system.LocaleHelper
import eu.kanade.tachiyomi.util.system.toast
import java.util.Date
import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.flow.drop
import kotlinx.coroutines.flow.merge
@ -35,6 +34,7 @@ import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.util.Date
object SettingsAppearanceScreen : SearchableSettings {
@ -122,9 +122,11 @@ object SettingsAppearanceScreen : SearchableSettings {
uiPreferences: UiPreferences,
): Preference.PreferenceGroup {
val langs = remember { getLangs(context) }
var currentLanguage by remember { mutableStateOf(
AppCompatDelegate.getApplicationLocales().get(0)?.toLanguageTag() ?: ""
) }
var currentLanguage by remember {
mutableStateOf(
AppCompatDelegate.getApplicationLocales().get(0)?.toLanguageTag() ?: "",
)
}
val now = remember { Date().time }
LaunchedEffect(currentLanguage) {

View file

@ -199,12 +199,12 @@ object SettingsBackupScreen : SearchableSettings {
}
if (!state.isScrolledToStart()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.TopCenter)
modifier = Modifier.align(Alignment.TopCenter),
)
}
if (!state.isScrolledToEnd()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.BottomCenter)
modifier = Modifier.align(Alignment.BottomCenter),
)
}
}
@ -291,7 +291,7 @@ object SettingsBackupScreen : SearchableSettings {
append(stringResource(R.string.backup_restore_content_full))
if (err.sources.isNotEmpty()) {
append("\n\n").append(
stringResource(R.string.backup_restore_missing_sources)
stringResource(R.string.backup_restore_missing_sources),
)
err.sources.joinTo(
this,
@ -301,7 +301,7 @@ object SettingsBackupScreen : SearchableSettings {
}
if (err.trackers.isNotEmpty()) {
append("\n\n").append(
stringResource(R.string.backup_restore_missing_trackers)
stringResource(R.string.backup_restore_missing_trackers),
)
err.trackers.joinTo(
this,
@ -335,7 +335,7 @@ object SettingsBackupScreen : SearchableSettings {
val intent = super.createIntent(context, input)
return Intent.createChooser(
intent,
context.getString(R.string.file_select_backup)
context.getString(R.string.file_select_backup),
)
}
},
@ -356,7 +356,7 @@ object SettingsBackupScreen : SearchableSettings {
error = MissingRestoreComponents(
it,
results.missingSources,
results.missingTrackers
results.missingTrackers,
)
}
}

View file

@ -53,7 +53,7 @@ object SettingsBrowseScreen : SearchableSettings {
},
),
Preference.PreferenceItem.InfoPreference(
stringResource(R.string.parental_controls_info)
stringResource(R.string.parental_controls_info),
),
),
),

View file

@ -24,7 +24,6 @@ import eu.kanade.presentation.category.visualName
import eu.kanade.presentation.more.settings.Preference
import eu.kanade.presentation.more.settings.widget.TriStateListDialog
import eu.kanade.tachiyomi.R
import java.io.File
import kotlinx.coroutines.runBlocking
import tachiyomi.domain.category.anime.interactor.GetAnimeCategories
import tachiyomi.domain.category.manga.interactor.GetMangaCategories
@ -33,6 +32,7 @@ import tachiyomi.domain.download.service.DownloadPreferences
import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.io.File
object SettingsDownloadScreen : SearchableSettings {
@ -45,11 +45,11 @@ object SettingsDownloadScreen : SearchableSettings {
override fun getPreferences(): List<Preference> {
val getCategories = remember { Injekt.get<GetMangaCategories>() }
val allCategories by getCategories.subscribe().collectAsState(
initial = runBlocking { getCategories.await() }
initial = runBlocking { getCategories.await() },
)
val getAnimeCategories = remember { Injekt.get<GetAnimeCategories>() }
val allAnimeCategories by getAnimeCategories.subscribe().collectAsState(
initial = runBlocking { getAnimeCategories.await() }
initial = runBlocking { getAnimeCategories.await() },
)
val downloadPreferences = remember { Injekt.get<DownloadPreferences>() }
@ -88,7 +88,7 @@ object SettingsDownloadScreen : SearchableSettings {
getDownloadAheadGroup(downloadPreferences = downloadPreferences),
getExternalDownloaderGroup(
downloadPreferences = downloadPreferences,
basePreferences = basePreferences
basePreferences = basePreferences,
),
)
}
@ -244,10 +244,10 @@ object SettingsDownloadScreen : SearchableSettings {
onDismissRequest = { showAnimeDialog = false },
onValueChanged = { newIncluded, newExcluded ->
downloadNewEpisodeCategoriesPref.set(
newIncluded.fastMap { it.id.toString() }.toSet()
newIncluded.fastMap { it.id.toString() }.toSet(),
)
downloadNewEpisodeCategoriesExcludePref.set(
newExcluded.fastMap { it.id.toString() }.toSet()
newExcluded.fastMap { it.id.toString() }.toSet(),
)
showAnimeDialog = false
},
@ -274,10 +274,10 @@ object SettingsDownloadScreen : SearchableSettings {
onDismissRequest = { showDialog = false },
onValueChanged = { newIncluded, newExcluded ->
downloadNewChapterCategoriesPref.set(
newIncluded.fastMap { it.id.toString() }.toSet()
newIncluded.fastMap { it.id.toString() }.toSet(),
)
downloadNewChapterCategoriesExcludePref.set(
newExcluded.fastMap { it.id.toString() }.toSet()
newExcluded.fastMap { it.id.toString() }.toSet(),
)
showDialog = false
},
@ -336,7 +336,7 @@ object SettingsDownloadScreen : SearchableSettings {
pluralStringResource(
id = R.plurals.next_unread_chapters,
count = it,
it
it,
)
}
},
@ -351,13 +351,13 @@ object SettingsDownloadScreen : SearchableSettings {
pluralStringResource(
id = R.plurals.next_unseen_episodes,
count = it,
it
it,
)
}
},
),
Preference.PreferenceItem.InfoPreference(
stringResource(R.string.download_ahead_info)
stringResource(R.string.download_ahead_info),
),
),
)
@ -366,7 +366,7 @@ object SettingsDownloadScreen : SearchableSettings {
@Composable
private fun getExternalDownloaderGroup(
downloadPreferences: DownloadPreferences,
basePreferences: BasePreferences
basePreferences: BasePreferences,
): Preference.PreferenceGroup {
val useExternalDownloader = downloadPreferences.useExternalDownloader()
val externalDownloaderPreference = downloadPreferences.externalDownloaderSelection()

View file

@ -296,14 +296,14 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_library_update_manga_restriction),
entries = mapOf(
ENTRY_HAS_UNVIEWED to stringResource(
R.string.pref_update_only_completely_read
R.string.pref_update_only_completely_read,
),
ENTRY_NON_VIEWED to stringResource(R.string.pref_update_only_started),
ENTRY_NON_COMPLETED to stringResource(
R.string.pref_update_only_non_completed
R.string.pref_update_only_non_completed,
),
ENTRY_OUTSIDE_RELEASE_PERIOD to stringResource(
R.string.pref_update_only_in_release_period
R.string.pref_update_only_in_release_period,
),
),
),
@ -327,16 +327,16 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_chapter_swipe_start),
entries = mapOf(
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(
R.string.action_disable
R.string.action_disable,
),
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(
R.string.action_bookmark
R.string.action_bookmark,
),
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(
R.string.action_mark_as_read
R.string.action_mark_as_read,
),
LibraryPreferences.ChapterSwipeAction.Download to stringResource(
R.string.action_download
R.string.action_download,
),
),
),
@ -345,16 +345,16 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_chapter_swipe_end),
entries = mapOf(
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(
R.string.action_disable
R.string.action_disable,
),
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(
R.string.action_bookmark
R.string.action_bookmark,
),
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(
R.string.action_mark_as_read
R.string.action_mark_as_read,
),
LibraryPreferences.ChapterSwipeAction.Download to stringResource(
R.string.action_download
R.string.action_download,
),
),
),
@ -374,16 +374,16 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_episode_swipe_start),
entries = mapOf(
LibraryPreferences.EpisodeSwipeAction.Disabled to stringResource(
R.string.action_disable
R.string.action_disable,
),
LibraryPreferences.EpisodeSwipeAction.ToggleBookmark to stringResource(
R.string.action_bookmark_episode
R.string.action_bookmark_episode,
),
LibraryPreferences.EpisodeSwipeAction.ToggleSeen to stringResource(
R.string.action_mark_as_seen
R.string.action_mark_as_seen,
),
LibraryPreferences.EpisodeSwipeAction.Download to stringResource(
R.string.action_download
R.string.action_download,
),
),
),
@ -392,16 +392,16 @@ object SettingsLibraryScreen : SearchableSettings {
title = stringResource(R.string.pref_episode_swipe_end),
entries = mapOf(
LibraryPreferences.EpisodeSwipeAction.Disabled to stringResource(
R.string.action_disable
R.string.action_disable,
),
LibraryPreferences.EpisodeSwipeAction.ToggleBookmark to stringResource(
R.string.action_bookmark_episode
R.string.action_bookmark_episode,
),
LibraryPreferences.EpisodeSwipeAction.ToggleSeen to stringResource(
R.string.action_mark_as_seen
R.string.action_mark_as_seen,
),
LibraryPreferences.EpisodeSwipeAction.Download to stringResource(
R.string.action_download
R.string.action_download,
),
),
),

View file

@ -40,7 +40,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import androidx.core.graphics.ColorUtils
import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.currentOrThrow
@ -53,6 +52,7 @@ import eu.kanade.presentation.util.LocalBackPress
import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import tachiyomi.presentation.core.components.material.Scaffold
import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen
object SettingsMainScreen : Screen() {
@Composable
@ -147,7 +147,7 @@ object SettingsMainScreen : Screen() {
.then(
if (selected) {
Modifier.background(
MaterialTheme.colorScheme.surfaceVariant
MaterialTheme.colorScheme.surfaceVariant,
)
} else {
Modifier
@ -250,7 +250,7 @@ object SettingsMainScreen : Screen() {
subtitleRes = 0,
formatSubtitle = {
"${stringResource(R.string.app_name)} ${AboutScreen.getVersionName(
withBuildDate = false
withBuildDate = false,
)}"
},
icon = Icons.Outlined.Info,

View file

@ -79,7 +79,7 @@ object SettingsPlayerScreen : SearchableSettings {
if (deviceSupportsPip) getPipGroup(playerPreferences = playerPreferences) else null,
getExternalPlayerGroup(
playerPreferences = playerPreferences,
basePreferences = basePreferences
basePreferences = basePreferences,
),
)
}
@ -151,25 +151,25 @@ object SettingsPlayerScreen : SearchableSettings {
title = stringResource(R.string.pref_default_player_orientation),
entries = mapOf(
ActivityInfo.SCREEN_ORIENTATION_FULL_SENSOR to stringResource(
R.string.rotation_free
R.string.rotation_free,
),
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT to stringResource(
R.string.rotation_portrait
R.string.rotation_portrait,
),
ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT to stringResource(
R.string.rotation_reverse_portrait
R.string.rotation_reverse_portrait,
),
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE to stringResource(
R.string.rotation_landscape
R.string.rotation_landscape,
),
ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE to stringResource(
R.string.rotation_reverse_landscape
R.string.rotation_reverse_landscape,
),
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT to stringResource(
R.string.rotation_sensor_portrait
R.string.rotation_sensor_portrait,
),
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE to stringResource(
R.string.rotation_sensor_landscape
R.string.rotation_sensor_landscape,
),
),
),
@ -182,13 +182,13 @@ object SettingsPlayerScreen : SearchableSettings {
title = stringResource(R.string.pref_default_portrait_orientation),
entries = mapOf(
ActivityInfo.SCREEN_ORIENTATION_PORTRAIT to stringResource(
R.string.rotation_portrait
R.string.rotation_portrait,
),
ActivityInfo.SCREEN_ORIENTATION_REVERSE_PORTRAIT to stringResource(
R.string.rotation_reverse_portrait
R.string.rotation_reverse_portrait,
),
ActivityInfo.SCREEN_ORIENTATION_SENSOR_PORTRAIT to stringResource(
R.string.rotation_sensor_portrait
R.string.rotation_sensor_portrait,
),
),
),
@ -197,13 +197,13 @@ object SettingsPlayerScreen : SearchableSettings {
title = stringResource(R.string.pref_default_landscape_orientation),
entries = mapOf(
ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE to stringResource(
R.string.rotation_landscape
R.string.rotation_landscape,
),
ActivityInfo.SCREEN_ORIENTATION_REVERSE_LANDSCAPE to stringResource(
R.string.rotation_reverse_landscape
R.string.rotation_reverse_landscape,
),
ActivityInfo.SCREEN_ORIENTATION_SENSOR_LANDSCAPE to stringResource(
R.string.rotation_sensor_landscape
R.string.rotation_sensor_landscape,
),
),
),
@ -340,7 +340,7 @@ object SettingsPlayerScreen : SearchableSettings {
@Composable
private fun getExternalPlayerGroup(
playerPreferences: PlayerPreferences,
basePreferences: BasePreferences
basePreferences: BasePreferences,
): Preference.PreferenceGroup {
val alwaysUseExternalPlayer = playerPreferences.alwaysUseExternalPlayer()
val externalPlayerPreference = playerPreferences.externalPlayerPreference()

View file

@ -14,10 +14,10 @@ import eu.kanade.tachiyomi.ui.reader.setting.OrientationType
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
import eu.kanade.tachiyomi.ui.reader.setting.ReadingModeType
import eu.kanade.tachiyomi.util.system.isReleaseBuildType
import java.text.NumberFormat
import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.NumberFormat
object SettingsReaderScreen : SearchableSettings {
@ -177,13 +177,13 @@ object SettingsReaderScreen : SearchableSettings {
entries = mapOf(
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none),
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(
R.string.tapping_inverted_horizontal
R.string.tapping_inverted_horizontal,
),
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(
R.string.tapping_inverted_vertical
R.string.tapping_inverted_vertical,
),
ReaderPreferences.TappingInvertMode.BOTH to stringResource(
R.string.tapping_inverted_both
R.string.tapping_inverted_both,
),
),
enabled = navMode != 5,
@ -275,13 +275,13 @@ object SettingsReaderScreen : SearchableSettings {
entries = mapOf(
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none),
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(
R.string.tapping_inverted_horizontal
R.string.tapping_inverted_horizontal,
),
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(
R.string.tapping_inverted_vertical
R.string.tapping_inverted_vertical,
),
ReaderPreferences.TappingInvertMode.BOTH to stringResource(
R.string.tapping_inverted_both
R.string.tapping_inverted_both,
),
),
enabled = navMode != 5,
@ -302,16 +302,16 @@ object SettingsReaderScreen : SearchableSettings {
title = stringResource(R.string.pref_hide_threshold),
entries = mapOf(
ReaderPreferences.ReaderHideThreshold.HIGHEST to stringResource(
R.string.pref_highest
R.string.pref_highest,
),
ReaderPreferences.ReaderHideThreshold.HIGH to stringResource(
R.string.pref_high
R.string.pref_high,
),
ReaderPreferences.ReaderHideThreshold.LOW to stringResource(
R.string.pref_low
R.string.pref_low,
),
ReaderPreferences.ReaderHideThreshold.LOWEST to stringResource(
R.string.pref_lowest
R.string.pref_lowest,
),
),
),

View file

@ -48,7 +48,6 @@ import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen
import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.components.UpIcon
@ -58,6 +57,7 @@ import eu.kanade.tachiyomi.R
import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.util.runOnEnterKeyPressed
import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen
class SettingsSearchScreen : Screen() {
@Composable
@ -87,9 +87,11 @@ class SettingsSearchScreen : Screen() {
focusRequester.requestFocus()
}
var textFieldValue by rememberSaveable(stateSaver = TextFieldValue.Saver) { mutableStateOf(
TextFieldValue()
) }
var textFieldValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
mutableStateOf(
TextFieldValue(),
)
}
Scaffold(
topBar = {
Column {
@ -115,7 +117,7 @@ class SettingsSearchScreen : Screen() {
singleLine = true,
keyboardOptions = KeyboardOptions(imeAction = ImeAction.Search),
keyboardActions = KeyboardActions(
onSearch = { focusManager.clearFocus() }
onSearch = { focusManager.clearFocus() },
),
cursorBrush = SolidColor(MaterialTheme.colorScheme.primary),
decorationBox = {
@ -208,7 +210,7 @@ private fun SearchResult(
breadcrumbs = getLocalizedBreadcrumb(
path = settingsData.title,
node = categoryTitle,
isLtr = isLtr
isLtr = isLtr,
),
highlightKey = p.title,
)

View file

@ -57,7 +57,7 @@ object SettingsSecurityScreen : SearchableSettings {
else -> pluralStringResource(
id = R.plurals.lock_after_mins,
count = it,
it
it,
)
}
},

View file

@ -139,19 +139,23 @@ object SettingsTrackingScreen : SearchableSettings {
Preference.PreferenceItem.TrackingPreference(
title = trackManager.myAnimeList.name,
service = trackManager.myAnimeList,
login = { context.openInBrowser(
MyAnimeListApi.authUrl(),
forceDefaultBrowser = true
) },
login = {
context.openInBrowser(
MyAnimeListApi.authUrl(),
forceDefaultBrowser = true,
)
},
logout = { dialog = LogoutDialog(trackManager.myAnimeList) },
),
Preference.PreferenceItem.TrackingPreference(
title = trackManager.aniList.name,
service = trackManager.aniList,
login = { context.openInBrowser(
AnilistApi.authUrl(),
forceDefaultBrowser = true
) },
login = {
context.openInBrowser(
AnilistApi.authUrl(),
forceDefaultBrowser = true,
)
},
logout = { dialog = LogoutDialog(trackManager.aniList) },
),
Preference.PreferenceItem.TrackingPreference(
@ -169,28 +173,34 @@ object SettingsTrackingScreen : SearchableSettings {
Preference.PreferenceItem.TrackingPreference(
title = trackManager.shikimori.name,
service = trackManager.shikimori,
login = { context.openInBrowser(
ShikimoriApi.authUrl(),
forceDefaultBrowser = true
) },
login = {
context.openInBrowser(
ShikimoriApi.authUrl(),
forceDefaultBrowser = true,
)
},
logout = { dialog = LogoutDialog(trackManager.shikimori) },
),
Preference.PreferenceItem.TrackingPreference(
title = trackManager.simkl.name,
service = trackManager.simkl,
login = { context.openInBrowser(
SimklApi.authUrl(),
forceDefaultBrowser = true
) },
login = {
context.openInBrowser(
SimklApi.authUrl(),
forceDefaultBrowser = true,
)
},
logout = { dialog = LogoutDialog(trackManager.simkl) },
),
Preference.PreferenceItem.TrackingPreference(
title = trackManager.bangumi.name,
service = trackManager.bangumi,
login = { context.openInBrowser(
BangumiApi.authUrl(),
forceDefaultBrowser = true
) },
login = {
context.openInBrowser(
BangumiApi.authUrl(),
forceDefaultBrowser = true,
)
},
logout = { dialog = LogoutDialog(trackManager.bangumi) },
),
Preference.PreferenceItem.InfoPreference(stringResource(R.string.tracking_info)),

View file

@ -42,10 +42,6 @@ import eu.kanade.tachiyomi.util.CrashLogUtil
import eu.kanade.tachiyomi.util.lang.toDateTimestampString
import eu.kanade.tachiyomi.util.system.copyToClipboard
import eu.kanade.tachiyomi.util.system.toast
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.TimeZone
import kotlinx.coroutines.launch
import logcat.LogPriority
import tachiyomi.core.util.lang.withIOContext
@ -57,6 +53,10 @@ import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold
import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get
import java.text.DateFormat
import java.text.SimpleDateFormat
import java.util.Locale
import java.util.TimeZone
object AboutScreen : Screen() {
@ -147,9 +147,11 @@ object AboutScreen : Screen() {
item {
TextPreferenceWidget(
title = stringResource(R.string.help_translate),
onPreferenceClick = { uriHandler.openUri(
"https://aniyomi.org/help/contribution/#translation"
) },
onPreferenceClick = {
uriHandler.openUri(
"https://aniyomi.org/help/contribution/#translation",
)
},
)
}
@ -211,10 +213,14 @@ object AboutScreen : Screen() {
val updateChecker = AppUpdateChecker()
withUIContext {
try {
when (val result = withIOContext { updateChecker.checkForUpdate(
context,
forceCheck = true
) }) {
when (
val result = withIOContext {
updateChecker.checkForUpdate(
context,
forceCheck = true,
)
}
) {
is GetApplicationRelease.Result.NewUpdate -> {
onAvailableUpdate(result)
}
@ -278,7 +284,7 @@ object AboutScreen : Screen() {
outputDf.timeZone = TimeZone.getDefault()
buildTime!!.toDateTimestampString(
UiPreferences.dateFormat(Injekt.get<UiPreferences>().dateFormat().get())
UiPreferences.dateFormat(Injekt.get<UiPreferences>().dateFormat().get()),
)
} catch (e: Exception) {
BuildConfig.BUILD_TIME

View file

@ -144,9 +144,11 @@ class ClearAnimeDatabaseScreen : Screen() {
source = sourceWithCount.source,
count = sourceWithCount.count,
isSelected = s.selection.contains(sourceWithCount.id),
onClickSelect = { model.toggleSelection(
sourceWithCount.source
) },
onClickSelect = {
model.toggleSelection(
sourceWithCount.source,
)
},
)
}
}
@ -208,7 +210,7 @@ class ClearAnimeDatabaseScreen : Screen() {
}
private class ClearAnimeDatabaseScreenModel : StateScreenModel<ClearAnimeDatabaseScreenModel.State>(
State.Loading
State.Loading,
) {
private val getSourcesWithNonLibraryAnime: GetAnimeSourcesWithNonLibraryAnime = Injekt.get()
private val database: AnimeDatabase = Injekt.get()

View file

@ -144,9 +144,11 @@ class ClearDatabaseScreen : Screen() {
source = sourceWithCount.source,
count = sourceWithCount.count,
isSelected = s.selection.contains(sourceWithCount.id),
onClickSelect = { model.toggleSelection(
sourceWithCount.source
) },
onClickSelect = {
model.toggleSelection(
sourceWithCount.source,
)
},
)
}
}
@ -208,7 +210,7 @@ class ClearDatabaseScreen : Screen() {
}
private class ClearDatabaseScreenModel : StateScreenModel<ClearDatabaseScreenModel.State>(
State.Loading
State.Loading,
) {
private val getSourcesWithNonLibraryManga: GetMangaSourcesWithNonLibraryManga = Injekt.get()
private val database: Database = Injekt.get()

View file

@ -39,9 +39,11 @@ class BackupSchemaScreen : Screen() {
val context = LocalContext.current
val navigator = LocalNavigator.currentOrThrow
val schema = remember { ProtoBufSchemaGenerator.generateSchemaText(
Backup.serializer().descriptor
) }
val schema = remember {
ProtoBufSchemaGenerator.generateSchemaText(
Backup.serializer().descriptor,
)
}
Scaffold(
topBar = {

View file

@ -77,7 +77,7 @@ class WorkerInfoScreen : Screen() {
onClick = {
context.copyToClipboard(
title,
enqueued + finished + running
enqueued + finished + running,
)
},
),
@ -130,8 +130,8 @@ class WorkerInfoScreen : Screen() {
WorkQuery.fromStates(
WorkInfo.State.SUCCEEDED,
WorkInfo.State.FAILED,
WorkInfo.State.CANCELLED
)
WorkInfo.State.CANCELLED,
),
)
.asFlow()
.map(::constructString)

View file

@ -32,8 +32,8 @@ import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import eu.kanade.presentation.more.settings.LocalPreferenceHighlighted
import eu.kanade.presentation.more.settings.LocalPreferenceMinHeight
import kotlin.time.Duration.Companion.seconds
import kotlinx.coroutines.delay
import kotlin.time.Duration.Companion.seconds
@Composable
internal fun BasePreferenceWidget(

View file

@ -71,12 +71,12 @@ fun <T> ListPreferenceWidget(
}
if (!state.isScrolledToStart()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.TopCenter)
modifier = Modifier.align(Alignment.TopCenter),
)
}
if (!state.isScrolledToEnd()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.BottomCenter)
modifier = Modifier.align(Alignment.BottomCenter),
)
}
}

View file

@ -117,12 +117,12 @@ fun <T> TriStateListDialog(
if (!listState.isScrolledToStart()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.TopCenter)
modifier = Modifier.align(Alignment.TopCenter),
)
}
if (!listState.isScrolledToEnd()) {
HorizontalDivider(
modifier = Modifier.align(Alignment.BottomCenter)
modifier = Modifier.align(Alignment.BottomCenter),
)
}
}

View file

@ -20,10 +20,10 @@ import eu.kanade.presentation.more.stats.components.StatsSection
import eu.kanade.presentation.more.stats.data.StatsData
import eu.kanade.presentation.util.toDurationString
import eu.kanade.tachiyomi.R
import tachiyomi.presentation.core.components.material.padding
import java.util.Locale
import kotlin.time.DurationUnit
import kotlin.time.toDuration
import tachiyomi.presentation.core.components.material.padding
@Composable
fun AnimeStatsScreenContent(

View file

@ -20,10 +20,10 @@ import eu.kanade.presentation.more.stats.components.StatsSection
import eu.kanade.presentation.more.stats.data.StatsData
import eu.kanade.presentation.util.toDurationString
import eu.kanade.tachiyomi.R
import tachiyomi.presentation.core.components.material.padding
import java.util.Locale
import kotlin.time.DurationUnit
import kotlin.time.toDuration
import tachiyomi.presentation.core.components.material.padding
@Composable
fun MangaStatsScreenContent(

View file

@ -19,10 +19,10 @@ import androidx.compose.ui.tooling.preview.Devices
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import eu.kanade.presentation.util.isTabletUi
import kotlin.random.Random
import tachiyomi.domain.category.model.Category
import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.screens.LoadingScreen
import kotlin.random.Random
@Composable
fun StorageScreenContent(

View file

@ -55,7 +55,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickCropBorder) {
Icon(
painter = painterResource(
if (cropEnabled) R.drawable.ic_crop_24dp else R.drawable.ic_crop_off_24dp
if (cropEnabled) R.drawable.ic_crop_24dp else R.drawable.ic_crop_off_24dp,
),
contentDescription = stringResource(R.string.pref_crop_borders),
)

View file

@ -78,7 +78,7 @@ fun ChapterNavigator(
Icon(
imageVector = Icons.Outlined.SkipPrevious,
contentDescription = stringResource(
if (isRtl) R.string.action_next_chapter else R.string.action_previous_chapter
if (isRtl) R.string.action_next_chapter else R.string.action_previous_chapter,
),
)
}
@ -131,7 +131,7 @@ fun ChapterNavigator(
Icon(
imageVector = Icons.Outlined.SkipNext,
contentDescription = stringResource(
if (isRtl) R.string.action_previous_chapter else R.string.action_next_chapter
if (isRtl) R.string.action_previous_chapter else R.string.action_next_chapter,
),
)
}

Some files were not shown because too many files have changed in this diff Show more