Finish migration to moko resources

This commit is contained in:
Jobobby04 2023-12-23 22:40:54 -05:00
parent 82098460ff
commit 16d433973c
175 changed files with 2061 additions and 1946 deletions

View File

@ -35,7 +35,8 @@ class GetEnabledSources(
) { pinnedSourceIds, ) { pinnedSourceIds,
(enabledLanguages, disabledSources, lastUsedSource), (enabledLanguages, disabledSources, lastUsedSource),
(excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter), (excludedFromDataSaver, sourcesInCategories, sourceCategoriesFilter),
sources -> sources,
->
val sourcesAndCategories = sourcesInCategories.map { val sourcesAndCategories = sourcesInCategories.map {
it.split('|').let { (source, test) -> source.toLong() to test } it.split('|').let { (source, test) -> source.toLong() to test }

View File

@ -104,7 +104,7 @@ fun BrowseSourceContent(
// SY --> // SY -->
if (onWebViewClick != null) { if (onWebViewClick != null) {
EmptyScreenAction( EmptyScreenAction(
stringResId = R.string.action_open_in_web_view, MR.strings.action_open_in_web_view,
icon = Icons.Outlined.Public, icon = Icons.Outlined.Public,
onClick = onWebViewClick, onClick = onWebViewClick,
) )
@ -113,7 +113,7 @@ fun BrowseSourceContent(
}, },
if (onHelpClick != null) { if (onHelpClick != null) {
EmptyScreenAction( EmptyScreenAction(
stringResId = R.string.label_help, MR.strings.label_help,
icon = Icons.AutoMirrored.Outlined.HelpOutline, icon = Icons.AutoMirrored.Outlined.HelpOutline,
onClick = onHelpClick, onClick = onHelpClick,
) )

View File

@ -4,11 +4,11 @@ import androidx.compose.material3.SnackbarHost
import androidx.compose.material3.SnackbarHostState import androidx.compose.material3.SnackbarHostState
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.TabContent import eu.kanade.presentation.components.TabContent
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun BrowseTabWrapper(tab: TabContent) { fun BrowseTabWrapper(tab: TabContent) {

View File

@ -39,7 +39,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.TextStyle import androidx.compose.ui.text.TextStyle
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.text.style.TextAlign
@ -51,15 +50,17 @@ import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.components.WarningBanner
import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.presentation.more.settings.widget.TrailingWidgetBuffer import eu.kanade.presentation.more.settings.widget.TrailingWidgetBuffer
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsScreenModel import eu.kanade.tachiyomi.ui.browse.extension.details.ExtensionDetailsScreenModel
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
@Composable @Composable
@ -78,7 +79,7 @@ fun ExtensionDetailsScreen(
Scaffold( Scaffold(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
title = stringResource(R.string.label_extension_info), title = stringResource(MR.strings.label_extension_info),
navigateUp = navigateUp, navigateUp = navigateUp,
actions = { actions = {
AppBarActions( AppBarActions(
@ -87,14 +88,14 @@ fun ExtensionDetailsScreen(
if (state.extension?.isUnofficial == false) { if (state.extension?.isUnofficial == false) {
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.whats_new), title = stringResource(MR.strings.whats_new),
icon = Icons.Outlined.History, icon = Icons.Outlined.History,
onClick = onClickWhatsNew, onClick = onClickWhatsNew,
), ),
) )
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_faq_and_guides), title = stringResource(MR.strings.action_faq_and_guides),
icon = Icons.AutoMirrored.Outlined.HelpOutline, icon = Icons.AutoMirrored.Outlined.HelpOutline,
onClick = onClickReadme, onClick = onClickReadme,
), ),
@ -103,15 +104,15 @@ fun ExtensionDetailsScreen(
addAll( addAll(
listOf( listOf(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_enable_all), title = stringResource(MR.strings.action_enable_all),
onClick = onClickEnableAll, onClick = onClickEnableAll,
), ),
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_disable_all), title = stringResource(MR.strings.action_disable_all),
onClick = onClickDisableAll, onClick = onClickDisableAll,
), ),
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.pref_clear_cookies), title = stringResource(MR.strings.pref_clear_cookies),
onClick = onClickClearCookies, onClick = onClickClearCookies,
), ),
), ),
@ -126,7 +127,7 @@ fun ExtensionDetailsScreen(
) { paddingValues -> ) { paddingValues ->
if (state.extension == null) { if (state.extension == null) {
EmptyScreen( EmptyScreen(
textResource = R.string.empty_screen, MR.strings.empty_screen,
modifier = Modifier.padding(paddingValues), modifier = Modifier.padding(paddingValues),
) )
return@Scaffold return@Scaffold
@ -162,13 +163,13 @@ private fun ExtensionDetails(
// SY --> // SY -->
extension.isRedundant -> extension.isRedundant ->
item { item {
WarningBanner(R.string.redundant_extension_message) WarningBanner(SYMR.strings.redundant_extension_message)
} }
extension.isRepoSource -> extension.isRepoSource ->
item { item {
val uriHandler = LocalUriHandler.current val uriHandler = LocalUriHandler.current
WarningBanner( WarningBanner(
R.string.repo_extension_message, SYMR.strings.repo_extension_message,
modifier = Modifier.clickable { modifier = Modifier.clickable {
extension.repoUrl ?: return@clickable extension.repoUrl ?: return@clickable
uriHandler.openUri( uriHandler.openUri(
@ -182,11 +183,11 @@ private fun ExtensionDetails(
// SY <-- // SY <--
extension.isUnofficial -> extension.isUnofficial ->
item { item {
WarningBanner(R.string.unofficial_extension_message) WarningBanner(MR.strings.unofficial_extension_message)
} }
extension.isObsolete -> extension.isObsolete ->
item { item {
WarningBanner(R.string.obsolete_extension_message) WarningBanner(MR.strings.obsolete_extension_message)
} }
} }
@ -282,7 +283,7 @@ private fun DetailsHeader(
InfoText( InfoText(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
primaryText = extension.versionName, primaryText = extension.versionName,
secondaryText = stringResource(R.string.ext_info_version), secondaryText = stringResource(MR.strings.ext_info_version),
) )
InfoDivider() InfoDivider()
@ -290,7 +291,7 @@ private fun DetailsHeader(
InfoText( InfoText(
modifier = Modifier.weight(if (extension.isNsfw) 1.5f else 1f), modifier = Modifier.weight(if (extension.isNsfw) 1.5f else 1f),
primaryText = LocaleHelper.getSourceDisplayName(extension.lang, context), primaryText = LocaleHelper.getSourceDisplayName(extension.lang, context),
secondaryText = stringResource(R.string.ext_info_language), secondaryText = stringResource(MR.strings.ext_info_language),
) )
if (extension.isNsfw) { if (extension.isNsfw) {
@ -298,12 +299,12 @@ private fun DetailsHeader(
InfoText( InfoText(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
primaryText = stringResource(R.string.ext_nsfw_short), primaryText = stringResource(MR.strings.ext_nsfw_short),
primaryTextStyle = MaterialTheme.typography.bodyLarge.copy( primaryTextStyle = MaterialTheme.typography.bodyLarge.copy(
color = MaterialTheme.colorScheme.error, color = MaterialTheme.colorScheme.error,
fontWeight = FontWeight.Medium, fontWeight = FontWeight.Medium,
), ),
secondaryText = stringResource(R.string.ext_info_age_rating), secondaryText = stringResource(MR.strings.ext_info_age_rating),
onClick = onClickAgeRating, onClick = onClickAgeRating,
) )
} }
@ -322,7 +323,7 @@ private fun DetailsHeader(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
onClick = onClickUninstall, onClick = onClickUninstall,
) { ) {
Text(stringResource(R.string.ext_uninstall)) Text(stringResource(MR.strings.ext_uninstall))
} }
if (onClickAppInfo != null) { if (onClickAppInfo != null) {
@ -331,7 +332,7 @@ private fun DetailsHeader(
onClick = onClickAppInfo, onClick = onClickAppInfo,
) { ) {
Text( Text(
text = stringResource(R.string.ext_app_info), text = stringResource(MR.strings.ext_app_info),
color = MaterialTheme.colorScheme.onPrimary, color = MaterialTheme.colorScheme.onPrimary,
) )
} }
@ -409,7 +410,7 @@ private fun SourceSwitchPreference(
IconButton(onClick = { onClickSourcePreferences(source.source.id) }) { IconButton(onClick = { onClickSourcePreferences(source.source.id) }) {
Icon( Icon(
imageVector = Icons.Outlined.Settings, imageVector = Icons.Outlined.Settings,
contentDescription = stringResource(R.string.label_settings), contentDescription = stringResource(MR.strings.label_settings),
tint = MaterialTheme.colorScheme.onSurface, tint = MaterialTheme.colorScheme.onSurface,
) )
} }
@ -432,11 +433,11 @@ private fun NsfwWarningDialog(
) { ) {
AlertDialog( AlertDialog(
text = { text = {
Text(text = stringResource(R.string.ext_nsfw_warning)) Text(text = stringResource(MR.strings.ext_nsfw_warning))
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onClickConfirm) { TextButton(onClick = onClickConfirm) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
onDismissRequest = onClickConfirm, onDismissRequest = onClickConfirm,

View File

@ -1,6 +1,5 @@
package eu.kanade.presentation.browse package eu.kanade.presentation.browse
import androidx.annotation.StringRes
import androidx.compose.animation.core.animateDpAsState import androidx.compose.animation.core.animateDpAsState
import androidx.compose.foundation.combinedClickable import androidx.compose.foundation.combinedClickable
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
@ -34,13 +33,12 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.browse.components.BaseBrowseItem import eu.kanade.presentation.browse.components.BaseBrowseItem
import eu.kanade.presentation.browse.components.ExtensionIcon import eu.kanade.presentation.browse.components.ExtensionIcon
import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText import eu.kanade.presentation.manga.components.DotSeparatorNoSpaceText
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension
import eu.kanade.tachiyomi.extension.model.InstallStep import eu.kanade.tachiyomi.extension.model.InstallStep
import eu.kanade.tachiyomi.source.ConfigurableSource import eu.kanade.tachiyomi.source.ConfigurableSource
@ -48,10 +46,13 @@ import eu.kanade.tachiyomi.ui.browse.extension.ExtensionUiModel
import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsScreenModel import eu.kanade.tachiyomi.ui.browse.extension.ExtensionsScreenModel
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import exh.source.anyIs import exh.source.anyIs
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.FastScrollLazyColumn import tachiyomi.presentation.core.components.FastScrollLazyColumn
import tachiyomi.presentation.core.components.material.PullRefresh import tachiyomi.presentation.core.components.material.PullRefresh
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.theme.header import tachiyomi.presentation.core.theme.header
@ -82,12 +83,12 @@ fun ExtensionScreen(
state.isLoading -> LoadingScreen(Modifier.padding(contentPadding)) state.isLoading -> LoadingScreen(Modifier.padding(contentPadding))
state.isEmpty -> { state.isEmpty -> {
val msg = if (!searchQuery.isNullOrEmpty()) { val msg = if (!searchQuery.isNullOrEmpty()) {
R.string.no_results_found MR.strings.no_results_found
} else { } else {
R.string.empty_screen MR.strings.empty_screen
} }
EmptyScreen( EmptyScreen(
textResource = msg, msg,
modifier = Modifier.padding(contentPadding), modifier = Modifier.padding(contentPadding),
) )
} }
@ -135,11 +136,11 @@ private fun ExtensionContent(
when (header) { when (header) {
is ExtensionUiModel.Header.Resource -> { is ExtensionUiModel.Header.Resource -> {
val action: @Composable RowScope.() -> Unit = val action: @Composable RowScope.() -> Unit =
if (header.textRes == R.string.ext_updates_pending) { if (header.textRes == MR.strings.ext_updates_pending) {
{ {
Button(onClick = { onClickUpdateAll() }) { Button(onClick = { onClickUpdateAll() }) {
Text( Text(
text = stringResource(R.string.ext_update_all), text = stringResource(MR.strings.ext_update_all),
style = LocalTextStyle.current.copy( style = LocalTextStyle.current.copy(
color = MaterialTheme.colorScheme.onPrimary, color = MaterialTheme.colorScheme.onPrimary,
), ),
@ -304,15 +305,15 @@ private fun ExtensionItemContent(
} }
val warning = when { val warning = when {
extension is Extension.Untrusted -> R.string.ext_untrusted extension is Extension.Untrusted -> MR.strings.ext_untrusted
// SY --> // SY -->
extension is Extension.Installed && extension.isRepoSource -> R.string.repo_source extension is Extension.Installed && extension.isRepoSource -> SYMR.strings.repo_source
extension is Extension.Available && extension.isRepoSource -> R.string.repo_source extension is Extension.Available && extension.isRepoSource -> SYMR.strings.repo_source
// SY <-- // SY <--
extension is Extension.Installed && extension.isUnofficial -> R.string.ext_unofficial extension is Extension.Installed && extension.isUnofficial -> MR.strings.ext_unofficial
extension is Extension.Installed && extension.isObsolete -> R.string.ext_obsolete extension is Extension.Installed && extension.isObsolete -> MR.strings.ext_obsolete
extension is Extension.Installed && extension.isRedundant -> R.string.ext_redundant extension is Extension.Installed && extension.isRedundant -> SYMR.strings.ext_redundant
extension.isNsfw -> R.string.ext_nsfw_short extension.isNsfw -> MR.strings.ext_nsfw_short
else -> null else -> null
} }
if (warning != null) { if (warning != null) {
@ -328,9 +329,9 @@ private fun ExtensionItemContent(
DotSeparatorNoSpaceText() DotSeparatorNoSpaceText()
Text( Text(
text = when (installStep) { text = when (installStep) {
InstallStep.Pending -> stringResource(R.string.ext_pending) InstallStep.Pending -> stringResource(MR.strings.ext_pending)
InstallStep.Downloading -> stringResource(R.string.ext_downloading) InstallStep.Downloading -> stringResource(MR.strings.ext_downloading)
InstallStep.Installing -> stringResource(R.string.ext_installing) InstallStep.Installing -> stringResource(MR.strings.ext_installing)
else -> error("Must not show non-install process text") else -> error("Must not show non-install process text")
}, },
) )
@ -364,19 +365,19 @@ private fun ExtensionItemActions(
) { ) {
Text( Text(
text = when (installStep) { text = when (installStep) {
InstallStep.Installed -> stringResource(R.string.ext_installed) InstallStep.Installed -> stringResource(MR.strings.ext_installed)
InstallStep.Error -> stringResource(R.string.action_retry) InstallStep.Error -> stringResource(MR.strings.action_retry)
InstallStep.Idle -> { InstallStep.Idle -> {
when (extension) { when (extension) {
is Extension.Installed -> { is Extension.Installed -> {
if (extension.hasUpdate) { if (extension.hasUpdate) {
stringResource(R.string.ext_update) stringResource(MR.strings.ext_update)
} else { } else {
stringResource(R.string.action_settings) stringResource(MR.strings.action_settings)
} }
} }
is Extension.Untrusted -> stringResource(R.string.ext_trust) is Extension.Untrusted -> stringResource(MR.strings.ext_trust)
is Extension.Available -> stringResource(R.string.ext_install) is Extension.Available -> stringResource(MR.strings.ext_install)
} }
} }
else -> error("Must not show install process text") else -> error("Must not show install process text")
@ -387,7 +388,7 @@ private fun ExtensionItemActions(
IconButton(onClick = { onClickItemCancel(extension) }) { IconButton(onClick = { onClickItemCancel(extension) }) {
Icon( Icon(
imageVector = Icons.Outlined.Close, imageVector = Icons.Outlined.Close,
contentDescription = stringResource(R.string.action_cancel), contentDescription = stringResource(MR.strings.action_cancel),
) )
} }
} }
@ -396,7 +397,7 @@ private fun ExtensionItemActions(
@Composable @Composable
private fun ExtensionHeader( private fun ExtensionHeader(
@StringRes textRes: Int, textRes: StringResource,
modifier: Modifier = Modifier, modifier: Modifier = Modifier,
action: @Composable RowScope.() -> Unit = {}, action: @Composable RowScope.() -> Unit = {},
) { ) {
@ -436,19 +437,19 @@ private fun ExtensionTrustDialog(
) { ) {
AlertDialog( AlertDialog(
title = { title = {
Text(text = stringResource(R.string.untrusted_extension)) Text(text = stringResource(MR.strings.untrusted_extension))
}, },
text = { text = {
Text(text = stringResource(R.string.untrusted_extension_message)) Text(text = stringResource(MR.strings.untrusted_extension_message))
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onClickConfirm) { TextButton(onClick = onClickConfirm) {
Text(text = stringResource(R.string.ext_trust)) Text(text = stringResource(MR.strings.ext_trust))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onClickDismiss) { TextButton(onClick = onClickDismiss) {
Text(text = stringResource(R.string.ext_uninstall)) Text(text = stringResource(MR.strings.ext_uninstall))
} }
}, },
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,

View File

@ -27,22 +27,26 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.browse.components.GlobalSearchCardRow import eu.kanade.presentation.browse.components.GlobalSearchCardRow
import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem
import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem
import eu.kanade.presentation.browse.components.GlobalSearchResultItem import eu.kanade.presentation.browse.components.GlobalSearchResultItem
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.ui.browse.feed.FeedScreenState import eu.kanade.tachiyomi.ui.browse.feed.FeedScreenState
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import tachiyomi.core.i18n.stringResource
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.model.FeedSavedSearch import tachiyomi.domain.source.model.FeedSavedSearch
import tachiyomi.domain.source.model.SavedSearch import tachiyomi.domain.source.model.SavedSearch
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.PullRefresh import tachiyomi.presentation.core.components.material.PullRefresh
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -71,7 +75,7 @@ fun FeedScreen(
when { when {
state.isLoading -> LoadingScreen() state.isLoading -> LoadingScreen()
state.isEmpty -> EmptyScreen( state.isEmpty -> EmptyScreen(
textResource = R.string.feed_tab_empty, SYMR.strings.feed_tab_empty,
modifier = Modifier.padding(contentPadding), modifier = Modifier.padding(contentPadding),
) )
else -> { else -> {
@ -137,7 +141,7 @@ fun FeedItem(
GlobalSearchLoadingResultItem() GlobalSearchLoadingResultItem()
} }
item.results.isEmpty() -> { item.results.isEmpty() -> {
GlobalSearchErrorResultItem(message = stringResource(R.string.no_results_found)) GlobalSearchErrorResultItem(message = stringResource(MR.strings.no_results_found))
} }
else -> { else -> {
GlobalSearchCardRow( GlobalSearchCardRow(
@ -152,14 +156,14 @@ fun FeedItem(
@Composable @Composable
fun FeedAddDialog( fun FeedAddDialog(
sources: List<CatalogueSource>, sources: ImmutableList<CatalogueSource>,
onDismiss: () -> Unit, onDismiss: () -> Unit,
onClickAdd: (CatalogueSource?) -> Unit, onClickAdd: (CatalogueSource?) -> Unit,
) { ) {
var selected by remember { mutableStateOf<Int?>(null) } var selected by remember { mutableStateOf<Int?>(null) }
AlertDialog( AlertDialog(
title = { title = {
Text(text = stringResource(R.string.feed)) Text(text = stringResource(SYMR.strings.feed))
}, },
text = { text = {
RadioSelector(options = sources, selected = selected) { RadioSelector(options = sources, selected = selected) {
@ -169,7 +173,7 @@ fun FeedAddDialog(
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
confirmButton = { confirmButton = {
TextButton(onClick = { onClickAdd(selected?.let { sources[it] }) }) { TextButton(onClick = { onClickAdd(selected?.let { sources[it] }) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
@ -178,7 +182,7 @@ fun FeedAddDialog(
@Composable @Composable
fun FeedAddSearchDialog( fun FeedAddSearchDialog(
source: CatalogueSource, source: CatalogueSource,
savedSearches: List<SavedSearch?>, savedSearches: ImmutableList<SavedSearch?>,
onDismiss: () -> Unit, onDismiss: () -> Unit,
onClickAdd: (CatalogueSource, SavedSearch?) -> Unit, onClickAdd: (CatalogueSource, SavedSearch?) -> Unit,
) { ) {
@ -191,8 +195,8 @@ fun FeedAddSearchDialog(
val context = LocalContext.current val context = LocalContext.current
val savedSearchStrings = remember { val savedSearchStrings = remember {
savedSearches.map { savedSearches.map {
it?.name ?: context.getString(R.string.latest) it?.name ?: context.stringResource(MR.strings.latest)
} }.toImmutableList()
} }
RadioSelector( RadioSelector(
options = savedSearches, options = savedSearches,
@ -205,7 +209,7 @@ fun FeedAddSearchDialog(
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
confirmButton = { confirmButton = {
TextButton(onClick = { onClickAdd(source, selected?.let { savedSearches[it] }) }) { TextButton(onClick = { onClickAdd(source, selected?.let { savedSearches[it] }) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
@ -213,8 +217,8 @@ fun FeedAddSearchDialog(
@Composable @Composable
fun <T> RadioSelector( fun <T> RadioSelector(
options: List<T>, options: ImmutableList<T>,
optionStrings: List<String> = remember { options.map { it.toString() } }, optionStrings: ImmutableList<String> = remember { options.map { it.toString() }.toImmutableList() },
selected: Int?, selected: Int?,
onSelectOption: (Int) -> Unit, onSelectOption: (Int) -> Unit,
) { ) {
@ -243,15 +247,15 @@ fun FeedDeleteConfirmDialog(
) { ) {
AlertDialog( AlertDialog(
title = { title = {
Text(text = stringResource(R.string.feed)) Text(text = stringResource(SYMR.strings.feed))
}, },
text = { text = {
Text(text = stringResource(R.string.feed_delete)) Text(text = stringResource(SYMR.strings.feed_delete))
}, },
onDismissRequest = onDismiss, onDismissRequest = onDismiss,
confirmButton = { confirmButton = {
TextButton(onClick = { onClickDeleteConfirm(feed) }) { TextButton(onClick = { onClickDeleteConfirm(feed) }) {
Text(text = stringResource(R.string.action_delete)) Text(text = stringResource(MR.strings.action_delete))
} }
}, },
) )

View File

@ -14,6 +14,7 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchItemResult
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SearchScreenModel
import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SourceFilter import eu.kanade.tachiyomi.ui.browse.source.globalsearch.SourceFilter
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.collections.immutable.ImmutableMap
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
@ -60,7 +61,7 @@ fun GlobalSearchScreen(
@Composable @Composable
internal fun GlobalSearchContent( internal fun GlobalSearchContent(
items: Map<CatalogueSource, SearchItemResult>, items: ImmutableMap<CatalogueSource, SearchItemResult>,
contentPadding: PaddingValues, contentPadding: PaddingValues,
getManga: @Composable (Manga) -> State<Manga>, getManga: @Composable (Manga) -> State<Manga>,
onClickSource: (CatalogueSource) -> Unit, onClickSource: (CatalogueSource) -> Unit,

View File

@ -180,7 +180,7 @@ private fun MigrateSourceItem(
// SY --> // SY -->
TextButton(onClick = onClickAll) { TextButton(onClick = onClickAll) {
Text( Text(
text = stringResource(id = R.string.all), text = stringResource(MR.strings.all),
style = LocalTextStyle.current.copy( style = LocalTextStyle.current.copy(
color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.primary,
), ),

View File

@ -9,6 +9,7 @@ import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.ArrowForward
import androidx.compose.material.icons.outlined.ArrowForward import androidx.compose.material.icons.outlined.ArrowForward
import androidx.compose.material.icons.outlined.ContentCopy import androidx.compose.material.icons.outlined.ContentCopy
import androidx.compose.material.icons.outlined.CopyAll import androidx.compose.material.icons.outlined.CopyAll
@ -21,26 +22,28 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState import androidx.compose.runtime.produceState
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.browse.components.MigrationActionIcon import eu.kanade.presentation.browse.components.MigrationActionIcon
import eu.kanade.presentation.browse.components.MigrationItem import eu.kanade.presentation.browse.components.MigrationItem
import eu.kanade.presentation.browse.components.MigrationItemResult import eu.kanade.presentation.browse.components.MigrationItemResult
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@Composable @Composable
fun MigrationListScreen( fun MigrationListScreen(
items: List<MigratingManga>, items: ImmutableList<MigratingManga>,
migrationDone: Boolean, migrationDone: Boolean,
unfinishedCount: Int, unfinishedCount: Int,
getManga: suspend (MigratingManga.SearchResult.Result) -> Manga?, getManga: suspend (MigratingManga.SearchResult.Result) -> Manga?,
@ -55,7 +58,7 @@ fun MigrationListScreen(
) { ) {
Scaffold( Scaffold(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
val titleString = stringResource(R.string.migration) val titleString = stringResource(SYMR.strings.migration)
val title by produceState(initialValue = titleString, items, unfinishedCount, titleString) { val title by produceState(initialValue = titleString, items, unfinishedCount, titleString) {
withIOContext { withIOContext {
value = "$titleString ($unfinishedCount/${items.size})" value = "$titleString ($unfinishedCount/${items.size})"
@ -67,13 +70,13 @@ fun MigrationListScreen(
AppBarActions( AppBarActions(
persistentListOf( persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.copy), title = stringResource(MR.strings.copy),
icon = if (items.size == 1) Icons.Outlined.ContentCopy else Icons.Outlined.CopyAll, icon = if (items.size == 1) Icons.Outlined.ContentCopy else Icons.Outlined.CopyAll,
onClick = { openMigrationDialog(false) }, onClick = { openMigrationDialog(false) },
enabled = migrationDone, enabled = migrationDone,
), ),
AppBar.Action( AppBar.Action(
title = stringResource(R.string.migrate), title = stringResource(MR.strings.migrate),
icon = if (items.size == 1) Icons.Outlined.Done else Icons.Outlined.DoneAll, icon = if (items.size == 1) Icons.Outlined.Done else Icons.Outlined.DoneAll,
onClick = { openMigrationDialog(false) }, onClick = { openMigrationDialog(false) },
enabled = migrationDone, enabled = migrationDone,
@ -112,8 +115,8 @@ fun MigrationListScreen(
) )
Icon( Icon(
Icons.Outlined.ArrowForward, Icons.AutoMirrored.Outlined.ArrowForward,
contentDescription = stringResource(R.string.migrating_to), contentDescription = stringResource(SYMR.strings.migrating_to),
modifier = Modifier.weight(0.2f), modifier = Modifier.weight(0.2f),
) )

View File

@ -8,7 +8,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.State import androidx.compose.runtime.State
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.browse.components.BrowseSourceFloatingActionButton import eu.kanade.presentation.browse.components.BrowseSourceFloatingActionButton
import eu.kanade.presentation.browse.components.GlobalSearchCardRow import eu.kanade.presentation.browse.components.GlobalSearchCardRow
import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem import eu.kanade.presentation.browse.components.GlobalSearchErrorResultItem
@ -16,13 +15,15 @@ import eu.kanade.presentation.browse.components.GlobalSearchLoadingResultItem
import eu.kanade.presentation.browse.components.GlobalSearchResultItem import eu.kanade.presentation.browse.components.GlobalSearchResultItem
import eu.kanade.presentation.components.AppBarTitle import eu.kanade.presentation.components.AppBarTitle
import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.components.SearchToolbar
import eu.kanade.tachiyomi.R import kotlinx.collections.immutable.ImmutableList
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.model.FeedSavedSearch import tachiyomi.domain.source.model.FeedSavedSearch
import tachiyomi.domain.source.model.SavedSearch import tachiyomi.domain.source.model.SavedSearch
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -43,7 +44,7 @@ sealed class SourceFeedUI {
override val title: String override val title: String
@Composable @Composable
@ReadOnlyComposable @ReadOnlyComposable
get() = stringResource(R.string.latest) get() = stringResource(MR.strings.latest)
override fun withResults(results: List<Manga>?): SourceFeedUI { override fun withResults(results: List<Manga>?): SourceFeedUI {
return copy(results = results) return copy(results = results)
@ -54,7 +55,7 @@ sealed class SourceFeedUI {
override val title: String override val title: String
@Composable @Composable
@ReadOnlyComposable @ReadOnlyComposable
get() = stringResource(R.string.browse) get() = stringResource(MR.strings.browse)
override fun withResults(results: List<Manga>?): SourceFeedUI { override fun withResults(results: List<Manga>?): SourceFeedUI {
return copy(results = results) return copy(results = results)
@ -83,7 +84,7 @@ sealed class SourceFeedUI {
fun SourceFeedScreen( fun SourceFeedScreen(
name: String, name: String,
isLoading: Boolean, isLoading: Boolean,
items: List<SourceFeedUI>, items: ImmutableList<SourceFeedUI>,
hasFilters: Boolean, hasFilters: Boolean,
onFabClick: () -> Unit, onFabClick: () -> Unit,
onClickBrowse: () -> Unit, onClickBrowse: () -> Unit,
@ -113,7 +114,7 @@ fun SourceFeedScreen(
) )
}, },
) { paddingValues -> ) { paddingValues ->
Crossfade(targetState = isLoading) { state -> Crossfade(targetState = isLoading, label = "source_feed") { state ->
when (state) { when (state) {
true -> LoadingScreen() true -> LoadingScreen()
false -> { false -> {
@ -135,7 +136,7 @@ fun SourceFeedScreen(
@Composable @Composable
fun SourceFeedList( fun SourceFeedList(
items: List<SourceFeedUI>, items: ImmutableList<SourceFeedUI>,
paddingValues: PaddingValues, paddingValues: PaddingValues,
getMangaState: @Composable ((Manga) -> State<Manga>), getMangaState: @Composable ((Manga) -> State<Manga>),
onClickBrowse: () -> Unit, onClickBrowse: () -> Unit,
@ -192,7 +193,7 @@ fun SourceFeedItem(
GlobalSearchLoadingResultItem() GlobalSearchLoadingResultItem()
} }
results.isEmpty() -> { results.isEmpty() -> {
GlobalSearchErrorResultItem(message = stringResource(R.string.no_results_found)) GlobalSearchErrorResultItem(message = stringResource(MR.strings.no_results_found))
} }
else -> { else -> {
GlobalSearchCardRow( GlobalSearchCardRow(
@ -220,6 +221,6 @@ fun SourceFeedToolbar(
onSearch = onClickSearch, onSearch = onClickSearch,
onClickCloseSearch = { onSearchQueryChange(null) }, onClickCloseSearch = { onSearchQueryChange(null) },
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
placeholderText = stringResource(R.string.action_search_hint), placeholderText = stringResource(MR.strings.action_search_hint),
) )
} }

View File

@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.ui.browse.source.SourcesFilterScreenModel
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import tachiyomi.domain.source.model.Source import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.FastScrollLazyColumn import tachiyomi.presentation.core.components.FastScrollLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@ -141,7 +142,7 @@ fun SourcesFilterToggle(
) { ) {
SwitchPreferenceWidget( SwitchPreferenceWidget(
modifier = modifier, modifier = modifier,
title = stringResource(R.string.pref_category_all_sources), title = stringResource(SYMR.strings.pref_category_all_sources),
checked = isEnabled, checked = isEnabled,
onCheckedChanged = { onClickItem() }, onCheckedChanged = { onClickItem() },
) )

View File

@ -23,20 +23,22 @@ import androidx.compose.runtime.mutableStateListOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.browse.components.BaseSourceItem import eu.kanade.presentation.browse.components.BaseSourceItem
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.source.SourcesScreenModel import eu.kanade.tachiyomi.ui.browse.source.SourcesScreenModel
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreenModel.Listing import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreenModel.Listing
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.domain.source.model.Pin import tachiyomi.domain.source.model.Pin
import tachiyomi.domain.source.model.Source import tachiyomi.domain.source.model.Source
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.SecondaryItemAlpha import tachiyomi.presentation.core.components.material.SecondaryItemAlpha
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.theme.header import tachiyomi.presentation.core.theme.header
@ -54,7 +56,7 @@ fun SourcesScreen(
when { when {
state.isLoading -> LoadingScreen(Modifier.padding(contentPadding)) state.isLoading -> LoadingScreen(Modifier.padding(contentPadding))
state.isEmpty -> EmptyScreen( state.isEmpty -> EmptyScreen(
textResource = R.string.source_empty_screen, MR.strings.source_empty_screen,
modifier = Modifier.padding(contentPadding), modifier = Modifier.padding(contentPadding),
) )
else -> { else -> {
@ -146,7 +148,7 @@ private fun SourceItem(
if (source.supportsLatest /* SY --> */ && showLatest /* SY <-- */) { if (source.supportsLatest /* SY --> */ && showLatest /* SY <-- */) {
TextButton(onClick = { onClickItem(source, Listing.Latest) }) { TextButton(onClick = { onClickItem(source, Listing.Latest) }) {
Text( Text(
text = stringResource(R.string.latest), text = stringResource(MR.strings.latest),
style = LocalTextStyle.current.copy( style = LocalTextStyle.current.copy(
color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.primary,
), ),
@ -178,7 +180,7 @@ private fun SourcePinButton(
alpha = SecondaryItemAlpha, alpha = SecondaryItemAlpha,
) )
} }
val description = if (isPinned) R.string.action_unpin else R.string.action_pin val description = if (isPinned) MR.strings.action_unpin else MR.strings.action_pin
IconButton(onClick = onClick) { IconButton(onClick = onClick) {
Icon( Icon(
imageVector = icon, imageVector = icon,
@ -205,7 +207,7 @@ fun SourceOptionsDialog(
}, },
text = { text = {
Column { Column {
val textId = if (Pin.Pinned in source.pin) R.string.action_unpin else R.string.action_pin val textId = if (Pin.Pinned in source.pin) MR.strings.action_unpin else MR.strings.action_pin
Text( Text(
text = stringResource(textId), text = stringResource(textId),
modifier = Modifier modifier = Modifier
@ -215,7 +217,7 @@ fun SourceOptionsDialog(
) )
if (!source.isLocal()) { if (!source.isLocal()) {
Text( Text(
text = stringResource(R.string.action_disable), text = stringResource(MR.strings.action_disable),
modifier = Modifier modifier = Modifier
.clickable(onClick = onClickDisable) .clickable(onClick = onClickDisable)
.fillMaxWidth() .fillMaxWidth()
@ -225,7 +227,7 @@ fun SourceOptionsDialog(
// SY --> // SY -->
if (onClickSetCategories != null) { if (onClickSetCategories != null) {
Text( Text(
text = stringResource(id = R.string.categories), text = stringResource(MR.strings.categories),
modifier = Modifier modifier = Modifier
.clickable(onClick = onClickSetCategories) .clickable(onClick = onClickSetCategories)
.fillMaxWidth() .fillMaxWidth()
@ -235,9 +237,9 @@ fun SourceOptionsDialog(
if (onClickToggleDataSaver != null) { if (onClickToggleDataSaver != null) {
Text( Text(
text = if (source.isExcludedFromDataSaver) { text = if (source.isExcludedFromDataSaver) {
stringResource(id = R.string.data_saver_stop_exclude) stringResource(SYMR.strings.data_saver_stop_exclude)
} else { } else {
stringResource(id = R.string.data_saver_exclude) stringResource(SYMR.strings.data_saver_exclude)
}, },
modifier = Modifier modifier = Modifier
.clickable(onClick = onClickToggleDataSaver) .clickable(onClick = onClickToggleDataSaver)
@ -262,7 +264,7 @@ sealed interface SourceUiModel {
@Composable @Composable
fun SourceCategoriesDialog( fun SourceCategoriesDialog(
source: Source, source: Source,
categories: List<String>, categories: ImmutableList<String>,
onClickCategories: (List<String>) -> Unit, onClickCategories: (List<String>) -> Unit,
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
) { ) {
@ -293,7 +295,7 @@ fun SourceCategoriesDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = { onClickCategories(newCategories.toList()) }) { TextButton(onClick = { onClickCategories(newCategories.toList()) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )

View File

@ -11,7 +11,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.paging.LoadState import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.LazyPagingItems
@ -24,6 +23,7 @@ import kotlinx.coroutines.flow.StateFlow
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.manga.model.MangaCover import tachiyomi.domain.manga.model.MangaCover
import tachiyomi.presentation.core.components.Badge import tachiyomi.presentation.core.components.Badge
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@Composable @Composable
@ -114,7 +114,7 @@ private fun BrowseSourceComfortableGridItem(
} }
metadata.relation?.let { metadata.relation?.let {
Badge( Badge(
text = stringResource(it.resId), text = stringResource(it.res),
color = MaterialTheme.colorScheme.tertiary, color = MaterialTheme.colorScheme.tertiary,
textColor = MaterialTheme.colorScheme.onTertiary, textColor = MaterialTheme.colorScheme.onTertiary,
) )

View File

@ -11,7 +11,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.paging.LoadState import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.LazyPagingItems
@ -24,6 +23,7 @@ import kotlinx.coroutines.flow.StateFlow
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.manga.model.MangaCover import tachiyomi.domain.manga.model.MangaCover
import tachiyomi.presentation.core.components.Badge import tachiyomi.presentation.core.components.Badge
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@Composable @Composable
@ -114,7 +114,7 @@ private fun BrowseSourceCompactGridItem(
} }
metadata.relation?.let { metadata.relation?.let {
Badge( Badge(
text = stringResource(it.resId), text = stringResource(it.res),
color = MaterialTheme.colorScheme.tertiary, color = MaterialTheme.colorScheme.tertiary,
textColor = MaterialTheme.colorScheme.onTertiary, textColor = MaterialTheme.colorScheme.onTertiary,
) )

View File

@ -12,13 +12,13 @@ import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
@ -63,7 +63,7 @@ fun SavedSearchDeleteDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
dismissButton = { dismissButton = {
@ -73,14 +73,14 @@ fun SavedSearchDeleteDialog(
onDismissRequest() onDismissRequest()
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.save_search_delete)) Text(text = stringResource(SYMR.strings.save_search_delete))
}, },
text = { text = {
Text(text = stringResource(R.string.save_search_delete_message, name)) Text(text = stringResource(SYMR.strings.save_search_delete_message, name))
}, },
) )
} }
@ -88,7 +88,7 @@ fun SavedSearchDeleteDialog(
@Composable @Composable
fun SavedSearchCreateDialog( fun SavedSearchCreateDialog(
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
currentSavedSearches: List<String>, currentSavedSearches: ImmutableList<String>,
saveSearch: (String) -> Unit, saveSearch: (String) -> Unit,
) { ) {
var textFieldValue by rememberSaveable(stateSaver = TextFieldValue.Saver) { var textFieldValue by rememberSaveable(stateSaver = TextFieldValue.Saver) {
@ -97,7 +97,7 @@ fun SavedSearchCreateDialog(
val context = LocalContext.current val context = LocalContext.current
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.save_search)) }, title = { Text(text = stringResource(SYMR.strings.save_search)) },
text = { text = {
OutlinedTextField( OutlinedTextField(
value = textFieldValue, value = textFieldValue,
@ -105,7 +105,7 @@ fun SavedSearchCreateDialog(
singleLine = true, singleLine = true,
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
placeholder = { placeholder = {
Text(text = stringResource(R.string.save_search_hint)) Text(text = stringResource(SYMR.strings.save_search_hint))
}, },
) )
}, },
@ -120,16 +120,16 @@ fun SavedSearchCreateDialog(
saveSearch(searchName) saveSearch(searchName)
onDismissRequest() onDismissRequest()
} else { } else {
context.toast(R.string.save_search_invalid_name) context.toast(SYMR.strings.save_search_invalid_name)
} }
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )

View File

@ -25,7 +25,6 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawWithContent import androidx.compose.ui.draw.drawWithContent
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
@ -33,8 +32,8 @@ import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.LazyPagingItems
import com.gowtham.ratingbar.RatingBar import com.gowtham.ratingbar.RatingBar
import com.gowtham.ratingbar.RatingBarConfig import com.gowtham.ratingbar.RatingBarConfig
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.manga.components.MangaCover import eu.kanade.presentation.manga.components.MangaCover
import eu.kanade.tachiyomi.R
import exh.metadata.MetadataUtil import exh.metadata.MetadataUtil
import exh.metadata.metadata.EHentaiSearchMetadata import exh.metadata.metadata.EHentaiSearchMetadata
import exh.metadata.metadata.RaisedSearchMetadata import exh.metadata.metadata.RaisedSearchMetadata
@ -42,11 +41,15 @@ import exh.util.SourceTagsUtil
import exh.util.SourceTagsUtil.GenreColor import exh.util.SourceTagsUtil.GenreColor
import exh.util.floor import exh.util.floor
import kotlinx.coroutines.flow.StateFlow import kotlinx.coroutines.flow.StateFlow
import tachiyomi.core.i18n.pluralStringResource
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.Badge import tachiyomi.presentation.core.components.Badge
import tachiyomi.presentation.core.components.BadgeGroup import tachiyomi.presentation.core.components.BadgeGroup
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
import java.util.Date import java.util.Date
@Composable @Composable
@ -100,7 +103,7 @@ fun BrowseSourceEHentaiListItem(
if (metadata !is EHentaiSearchMetadata) return if (metadata !is EHentaiSearchMetadata) return
val overlayColor = MaterialTheme.colorScheme.background.copy(alpha = 0.66f) val overlayColor = MaterialTheme.colorScheme.background.copy(alpha = 0.66f)
val resources = LocalContext.current.resources val context = LocalContext.current
val languageText by produceState("", metadata) { val languageText by produceState("", metadata) {
value = withIOContext { value = withIOContext {
val locale = SourceTagsUtil.getLocaleSourceUtil( val locale = SourceTagsUtil.getLocaleSourceUtil(
@ -110,14 +113,14 @@ fun BrowseSourceEHentaiListItem(
) )
val pageCount = metadata.length val pageCount = metadata.length
if (locale != null && pageCount != null) { if (locale != null && pageCount != null) {
resources.getQuantityString( context.pluralStringResource(
R.plurals.browse_language_and_pages, SYMR.plurals.browse_language_and_pages,
pageCount, pageCount,
pageCount, pageCount,
locale.toLanguageTag().uppercase() locale.toLanguageTag().uppercase(),
) )
} else if (pageCount != null) { } else if (pageCount != null) {
resources.getQuantityString(R.plurals.num_pages, pageCount, pageCount) context.pluralStringResource(SYMR.plurals.num_pages, pageCount, pageCount)
} else { } else {
locale?.toLanguageTag()?.uppercase().orEmpty() locale?.toLanguageTag()?.uppercase().orEmpty()
} }
@ -130,19 +133,19 @@ fun BrowseSourceEHentaiListItem(
.orEmpty() .orEmpty()
} }
} }
val genre by produceState<Pair<GenreColor, Int>?>(null, metadata) { val genre by produceState<Pair<GenreColor, StringResource>?>(null, metadata) {
value = withIOContext { value = withIOContext {
when (metadata.genre) { when (metadata.genre) {
"doujinshi" -> GenreColor.DOUJINSHI_COLOR to R.string.doujinshi "doujinshi" -> GenreColor.DOUJINSHI_COLOR to SYMR.strings.doujinshi
"manga" -> GenreColor.MANGA_COLOR to R.string.entry_type_manga "manga" -> GenreColor.MANGA_COLOR to SYMR.strings.entry_type_manga
"artistcg" -> GenreColor.ARTIST_CG_COLOR to R.string.artist_cg "artistcg" -> GenreColor.ARTIST_CG_COLOR to SYMR.strings.artist_cg
"gamecg" -> GenreColor.GAME_CG_COLOR to R.string.game_cg "gamecg" -> GenreColor.GAME_CG_COLOR to SYMR.strings.game_cg
"western" -> GenreColor.WESTERN_COLOR to R.string.western "western" -> GenreColor.WESTERN_COLOR to SYMR.strings.western
"non-h" -> GenreColor.NON_H_COLOR to R.string.non_h "non-h" -> GenreColor.NON_H_COLOR to SYMR.strings.non_h
"imageset" -> GenreColor.IMAGE_SET_COLOR to R.string.image_set "imageset" -> GenreColor.IMAGE_SET_COLOR to SYMR.strings.image_set
"cosplay" -> GenreColor.COSPLAY_COLOR to R.string.cosplay "cosplay" -> GenreColor.COSPLAY_COLOR to SYMR.strings.cosplay
"asianporn" -> GenreColor.ASIAN_PORN_COLOR to R.string.asian_porn "asianporn" -> GenreColor.ASIAN_PORN_COLOR to SYMR.strings.asian_porn
"misc" -> GenreColor.MISC_COLOR to R.string.misc "misc" -> GenreColor.MISC_COLOR to SYMR.strings.misc
else -> null else -> null
} }
} }
@ -182,7 +185,7 @@ fun BrowseSourceEHentaiListItem(
.padding(4.dp) .padding(4.dp)
.align(Alignment.TopStart), .align(Alignment.TopStart),
) { ) {
Badge(stringResource(R.string.in_library)) Badge(stringResource(MR.strings.in_library))
} }
} }
} }

View File

@ -6,9 +6,10 @@ import androidx.compose.material3.Icon
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import tachiyomi.i18n.MR
import eu.kanade.tachiyomi.R import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun BrowseSourceFloatingActionButton( fun BrowseSourceFloatingActionButton(
@ -21,9 +22,9 @@ fun BrowseSourceFloatingActionButton(
text = { text = {
Text( Text(
text = if (isVisible) { text = if (isVisible) {
stringResource(R.string.action_filter) stringResource(MR.strings.action_filter)
} else { } else {
stringResource(R.string.saved_searches) stringResource(SYMR.strings.saved_searches)
}, },
) )
}, },

View File

@ -8,7 +8,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.paging.LoadState import androidx.paging.LoadState
import androidx.paging.compose.LazyPagingItems import androidx.paging.compose.LazyPagingItems
@ -21,6 +20,7 @@ import kotlinx.coroutines.flow.StateFlow
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.manga.model.MangaCover import tachiyomi.domain.manga.model.MangaCover
import tachiyomi.presentation.core.components.Badge import tachiyomi.presentation.core.components.Badge
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@Composable @Composable
@ -105,7 +105,7 @@ private fun BrowseSourceListItem(
} }
metadata.relation?.let { metadata.relation?.let {
Badge( Badge(
text = stringResource(it.resId), text = stringResource(it.res),
color = MaterialTheme.colorScheme.tertiary, color = MaterialTheme.colorScheme.tertiary,
textColor = MaterialTheme.colorScheme.onTertiary, textColor = MaterialTheme.colorScheme.onTertiary,
) )

View File

@ -12,13 +12,13 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.DropdownMenu import eu.kanade.presentation.components.DropdownMenu
import eu.kanade.tachiyomi.R
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun BrowseSourceSimpleToolbar( fun BrowseSourceSimpleToolbar(
@ -37,7 +37,7 @@ fun BrowseSourceSimpleToolbar(
// SY --> // SY -->
actions = persistentListOf( actions = persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(id = R.string.action_display_mode), title = stringResource(MR.strings.action_display_mode),
icon = Icons.Outlined.ViewModule, icon = Icons.Outlined.ViewModule,
onClick = { selectingDisplayMode = true }, onClick = { selectingDisplayMode = true },
), ),
@ -48,7 +48,7 @@ fun BrowseSourceSimpleToolbar(
onDismissRequest = { selectingDisplayMode = false }, onDismissRequest = { selectingDisplayMode = false },
) { ) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(text = stringResource(id = R.string.action_display_comfortable_grid)) }, text = { Text(text = stringResource(MR.strings.action_display_comfortable_grid)) },
onClick = { onDisplayModeChange(LibraryDisplayMode.ComfortableGrid) }, onClick = { onDisplayModeChange(LibraryDisplayMode.ComfortableGrid) },
trailingIcon = { trailingIcon = {
if (displayMode == LibraryDisplayMode.ComfortableGrid) { if (displayMode == LibraryDisplayMode.ComfortableGrid) {
@ -60,7 +60,7 @@ fun BrowseSourceSimpleToolbar(
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(text = stringResource(id = R.string.action_display_grid)) }, text = { Text(text = stringResource(MR.strings.action_display_grid)) },
onClick = { onDisplayModeChange(LibraryDisplayMode.CompactGrid) }, onClick = { onDisplayModeChange(LibraryDisplayMode.CompactGrid) },
trailingIcon = { trailingIcon = {
if (displayMode == LibraryDisplayMode.CompactGrid) { if (displayMode == LibraryDisplayMode.CompactGrid) {
@ -72,7 +72,7 @@ fun BrowseSourceSimpleToolbar(
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(text = stringResource(id = R.string.action_display_list)) }, text = { Text(text = stringResource(MR.strings.action_display_list)) },
onClick = { onDisplayModeChange(LibraryDisplayMode.List) }, onClick = { onDisplayModeChange(LibraryDisplayMode.List) },
trailingIcon = { trailingIcon = {
if (displayMode == LibraryDisplayMode.List) { if (displayMode == LibraryDisplayMode.List) {

View File

@ -24,7 +24,7 @@ import exh.source.anyIs
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.domain.library.model.LibraryDisplayMode import tachiyomi.domain.library.model.LibraryDisplayMode
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.localize import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.source.local.LocalSource import tachiyomi.source.local.LocalSource
@Composable @Composable
@ -62,7 +62,7 @@ fun BrowseSourceToolbar(
if (displayMode != null) { if (displayMode != null) {
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_display_mode), title = stringResource(MR.strings.action_display_mode),
icon = if (displayMode == LibraryDisplayMode.List) { icon = if (displayMode == LibraryDisplayMode.List) {
Icons.AutoMirrored.Filled.ViewList Icons.AutoMirrored.Filled.ViewList
} else { } else {
@ -76,14 +76,14 @@ fun BrowseSourceToolbar(
if (isConfigurableSource && displayMode != null) { if (isConfigurableSource && displayMode != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.label_help), title = stringResource(MR.strings.label_help),
onClick = onHelpClick, onClick = onHelpClick,
), ),
) )
} else { } else {
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.label_help), title = stringResource(MR.strings.label_help),
icon = Icons.Outlined.Help, icon = Icons.Outlined.Help,
onClick = onHelpClick, onClick = onHelpClick,
), ),
@ -93,17 +93,17 @@ fun BrowseSourceToolbar(
if (isConfigurableSource && displayMode != null) { if (isConfigurableSource && displayMode != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_web_view), title = stringResource(MR.strings.action_web_view),
onClick = onWebViewClick, onClick = onWebViewClick,
) ),
) )
} else { } else {
add( add(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_web_view), title = stringResource(MR.strings.action_web_view),
icon = Icons.Outlined.Public, icon = Icons.Outlined.Public,
onClick = onWebViewClick, onClick = onWebViewClick,
) ),
) )
} }
} }
@ -111,7 +111,7 @@ fun BrowseSourceToolbar(
if (isConfigurableSource) { if (isConfigurableSource) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = localize(MR.strings.action_settings), title = stringResource(MR.strings.action_settings),
onClick = onSettingsClick, onClick = onSettingsClick,
), ),
) )
@ -125,21 +125,21 @@ fun BrowseSourceToolbar(
onDismissRequest = { selectingDisplayMode = false }, onDismissRequest = { selectingDisplayMode = false },
) { ) {
RadioMenuItem( RadioMenuItem(
text = { Text(text = localize(MR.strings.action_display_comfortable_grid)) }, text = { Text(text = stringResource(MR.strings.action_display_comfortable_grid)) },
isChecked = displayMode == LibraryDisplayMode.ComfortableGrid, isChecked = displayMode == LibraryDisplayMode.ComfortableGrid,
) { ) {
selectingDisplayMode = false selectingDisplayMode = false
onDisplayModeChange(LibraryDisplayMode.ComfortableGrid) onDisplayModeChange(LibraryDisplayMode.ComfortableGrid)
} }
RadioMenuItem( RadioMenuItem(
text = { Text(text = localize(MR.strings.action_display_grid)) }, text = { Text(text = stringResource(MR.strings.action_display_grid)) },
isChecked = displayMode == LibraryDisplayMode.CompactGrid, isChecked = displayMode == LibraryDisplayMode.CompactGrid,
) { ) {
selectingDisplayMode = false selectingDisplayMode = false
onDisplayModeChange(LibraryDisplayMode.CompactGrid) onDisplayModeChange(LibraryDisplayMode.CompactGrid)
} }
RadioMenuItem( RadioMenuItem(
text = { Text(text = localize(MR.strings.action_display_list)) }, text = { Text(text = stringResource(MR.strings.action_display_list)) },
isChecked = displayMode == LibraryDisplayMode.List, isChecked = displayMode == LibraryDisplayMode.List,
) { ) {
selectingDisplayMode = false selectingDisplayMode = false

View File

@ -15,11 +15,12 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.DpOffset import androidx.compose.ui.unit.DpOffset
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationActionIcon( fun MigrationActionIcon(
@ -38,14 +39,14 @@ fun MigrationActionIcon(
IconButton(onClick = skipManga) { IconButton(onClick = skipManga) {
Icon( Icon(
imageVector = Icons.Outlined.Close, imageVector = Icons.Outlined.Close,
contentDescription = stringResource(R.string.action_stop), contentDescription = stringResource(SYMR.strings.action_stop),
) )
} }
} else if (result is MigratingManga.SearchResult.Result || result is MigratingManga.SearchResult.NotFound) { } else if (result is MigratingManga.SearchResult.Result || result is MigratingManga.SearchResult.NotFound) {
IconButton(onClick = { moreExpanded = !moreExpanded }) { IconButton(onClick = { moreExpanded = !moreExpanded }) {
Icon( Icon(
imageVector = Icons.Outlined.MoreVert, imageVector = Icons.Outlined.MoreVert,
contentDescription = stringResource(R.string.abc_action_menu_overflow_description), contentDescription = stringResource(MR.strings.action_menu_overflow_description),
) )
} }
DropdownMenu( DropdownMenu(
@ -54,14 +55,14 @@ fun MigrationActionIcon(
offset = DpOffset(8.dp, (-56).dp), offset = DpOffset(8.dp, (-56).dp),
) { ) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_search_manually)) }, text = { Text(stringResource(SYMR.strings.action_search_manually)) },
onClick = { onClick = {
searchManually() searchManually()
closeMenu() closeMenu()
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_skip_entry)) }, text = { Text(stringResource(SYMR.strings.action_skip_entry)) },
onClick = { onClick = {
skipManga() skipManga()
closeMenu() closeMenu()
@ -69,14 +70,14 @@ fun MigrationActionIcon(
) )
if (result is MigratingManga.SearchResult.Result) { if (result is MigratingManga.SearchResult.Result) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_migrate_now)) }, text = { Text(stringResource(SYMR.strings.action_migrate_now)) },
onClick = { onClick = {
migrateNow() migrateNow()
closeMenu() closeMenu()
}, },
) )
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_copy_now)) }, text = { Text(stringResource(SYMR.strings.action_copy_now)) },
onClick = { onClick = {
copyNow() copyNow()
closeMenu() closeMenu()

View File

@ -4,8 +4,9 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource import tachiyomi.i18n.MR
import eu.kanade.tachiyomi.R import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationExitDialog( fun MigrationExitDialog(
@ -16,16 +17,16 @@ fun MigrationExitDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = exitMigration) { TextButton(onClick = exitMigration) {
Text(text = stringResource(R.string.action_stop)) Text(text = stringResource(SYMR.strings.action_stop))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.stop_migrating)) Text(text = stringResource(SYMR.strings.stop_migrating))
}, },
) )
} }

View File

@ -22,17 +22,17 @@ import androidx.compose.ui.graphics.Brush
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shadow import androidx.compose.ui.graphics.Shadow
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import eu.kanade.presentation.manga.components.MangaCover import eu.kanade.presentation.manga.components.MangaCover
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.Badge import tachiyomi.presentation.core.components.Badge
import tachiyomi.presentation.core.components.BadgeGroup import tachiyomi.presentation.core.components.BadgeGroup
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationItem( fun MigrationItem(
@ -77,7 +77,7 @@ fun MigrationItem(
modifier = Modifier modifier = Modifier
.padding(8.dp) .padding(8.dp)
.align(Alignment.BottomStart), .align(Alignment.BottomStart),
text = manga.title.ifBlank { stringResource(R.string.unknown) }, text = manga.title.ifBlank { stringResource(MR.strings.unknown) },
fontSize = 12.sp, fontSize = 12.sp,
lineHeight = 18.sp, lineHeight = 18.sp,
maxLines = 2, maxLines = 2,

View File

@ -20,7 +20,6 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.manga.components.MangaCover import eu.kanade.presentation.manga.components.MangaCover
import eu.kanade.presentation.util.rememberResourceBitmapPainter import eu.kanade.presentation.util.rememberResourceBitmapPainter
@ -28,6 +27,8 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigratingManga
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationItemResult( fun MigrationItemResult(
@ -66,7 +67,7 @@ fun MigrationItemResult(
contentScale = ContentScale.Crop, contentScale = ContentScale.Crop,
) )
Text( Text(
text = stringResource(R.string.no_alternatives_found), text = stringResource(SYMR.strings.no_alternatives_found),
modifier = Modifier.padding(top = 4.dp, bottom = 1.dp, start = 8.dp), modifier = Modifier.padding(top = 4.dp, bottom = 1.dp, start = 8.dp),
style = MaterialTheme.typography.titleSmall, style = MaterialTheme.typography.titleSmall,
) )

View File

@ -4,9 +4,10 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.res.pluralStringResource import tachiyomi.i18n.MR
import androidx.compose.ui.res.stringResource import tachiyomi.i18n.sy.SYMR
import eu.kanade.tachiyomi.R import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationMangaDialog( fun MigrationMangaDialog(
@ -29,21 +30,21 @@ fun MigrationMangaDialog(
} }
}, },
) { ) {
Text(text = stringResource(if (copy) R.string.copy else R.string.migrate)) Text(text = stringResource(if (copy) MR.strings.copy else MR.strings.migrate))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
text = { text = {
Text( Text(
text = pluralStringResource( text = pluralStringResource(
if (copy) R.plurals.copy_entry else R.plurals.migrate_entry, if (copy) SYMR.plurals.copy_entry else SYMR.plurals.migrate_entry,
count = mangaSet, count = mangaSet,
mangaSet, mangaSet,
(if (mangaSkipped > 0) " " + stringResource(R.string.skipping_, mangaSkipped) else ""), (if (mangaSkipped > 0) " " + stringResource(SYMR.strings.skipping_, mangaSkipped) else ""),
), ),
) )
}, },

View File

@ -8,9 +8,9 @@ import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MigrationProgressDialog( fun MigrationProgressDialog(
@ -21,7 +21,7 @@ fun MigrationProgressDialog(
onDismissRequest = {}, onDismissRequest = {},
confirmButton = { confirmButton = {
TextButton(onClick = exitMigration) { TextButton(onClick = exitMigration) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
text = { text = {
@ -29,8 +29,11 @@ fun MigrationProgressDialog(
val progressAnimated by animateFloatAsState( val progressAnimated by animateFloatAsState(
targetValue = progress, targetValue = progress,
animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec,
label = "migration_progress",
)
LinearProgressIndicator(
progress = { progressAnimated },
) )
LinearProgressIndicator(progressAnimated)
} }
}, },
properties = DialogProperties( properties = DialogProperties(

View File

@ -4,8 +4,9 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource import tachiyomi.i18n.MR
import eu.kanade.tachiyomi.R import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun SourceFeedAddDialog( fun SourceFeedAddDialog(
@ -17,19 +18,19 @@ fun SourceFeedAddDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = addFeed) { TextButton(onClick = addFeed) {
Text(text = stringResource(R.string.action_add)) Text(text = stringResource(MR.strings.action_add))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.feed)) Text(text = stringResource(SYMR.strings.feed))
}, },
text = { text = {
Text(text = stringResource(R.string.feed_add, name)) Text(text = stringResource(SYMR.strings.feed_add, name))
}, },
) )
} }
@ -43,19 +44,19 @@ fun SourceFeedDeleteDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = deleteFeed) { TextButton(onClick = deleteFeed) {
Text(text = stringResource(R.string.action_delete)) Text(text = stringResource(MR.strings.action_delete))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.feed)) Text(text = stringResource(SYMR.strings.feed))
}, },
text = { text = {
Text(text = stringResource(R.string.feed_delete)) Text(text = stringResource(SYMR.strings.feed_delete))
}, },
) )
} }

View File

@ -6,16 +6,16 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.category.components.CategoryFloatingActionButton import eu.kanade.presentation.category.components.CategoryFloatingActionButton
import eu.kanade.presentation.category.components.biometric.BiometricTimesContent import eu.kanade.presentation.category.components.biometric.BiometricTimesContent
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.biometric.BiometricTimesScreenState import eu.kanade.tachiyomi.ui.category.biometric.BiometricTimesScreenState
import eu.kanade.tachiyomi.ui.category.biometric.TimeRangeItem import eu.kanade.tachiyomi.ui.category.biometric.TimeRangeItem
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -31,7 +31,7 @@ fun BiometricTimesScreen(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
navigateUp = navigateUp, navigateUp = navigateUp,
title = stringResource(R.string.biometric_lock_times), title = stringResource(SYMR.strings.biometric_lock_times),
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
}, },
@ -44,7 +44,7 @@ fun BiometricTimesScreen(
) { paddingValues -> ) { paddingValues ->
if (state.isEmpty) { if (state.isEmpty) {
EmptyScreen( EmptyScreen(
textResource = R.string.biometric_lock_times_empty, SYMR.strings.biometric_lock_times_empty,
modifier = Modifier.padding(paddingValues), modifier = Modifier.padding(paddingValues),
) )
return@Scaffold return@Scaffold

View File

@ -17,6 +17,7 @@ import eu.kanade.presentation.category.components.CategoryListItem
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.tachiyomi.ui.category.CategoryScreenState import eu.kanade.tachiyomi.ui.category.CategoryScreenState
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.Category
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
@ -88,7 +89,7 @@ fun CategoryScreen(
@Composable @Composable
private fun CategoryContent( private fun CategoryContent(
categories: List<Category>, categories: ImmutableList<Category>,
lazyListState: LazyListState, lazyListState: LazyListState,
paddingValues: PaddingValues, paddingValues: PaddingValues,
onClickRename: (Category) -> Unit, onClickRename: (Category) -> Unit,

View File

@ -6,15 +6,15 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.category.components.CategoryFloatingActionButton import eu.kanade.presentation.category.components.CategoryFloatingActionButton
import eu.kanade.presentation.category.components.genre.SortTagContent import eu.kanade.presentation.category.components.genre.SortTagContent
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.genre.SortTagScreenState import eu.kanade.tachiyomi.ui.category.genre.SortTagScreenState
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -32,7 +32,7 @@ fun SortTagScreen(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
navigateUp = navigateUp, navigateUp = navigateUp,
title = stringResource(R.string.action_edit_tags), title = stringResource(SYMR.strings.action_edit_tags),
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
}, },
@ -45,7 +45,7 @@ fun SortTagScreen(
) { paddingValues -> ) { paddingValues ->
if (state.isEmpty) { if (state.isEmpty) {
EmptyScreen( EmptyScreen(
textResource = R.string.information_empty_tags, SYMR.strings.information_empty_tags,
modifier = Modifier.padding(paddingValues), modifier = Modifier.padding(paddingValues),
) )
return@Scaffold return@Scaffold

View File

@ -6,15 +6,16 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.category.components.CategoryFloatingActionButton import eu.kanade.presentation.category.components.CategoryFloatingActionButton
import eu.kanade.presentation.category.components.sources.SourceCategoryContent import eu.kanade.presentation.category.components.sources.SourceCategoryContent
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.sources.SourceCategoryScreenState import eu.kanade.tachiyomi.ui.category.sources.SourceCategoryScreenState
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -31,7 +32,7 @@ fun SourceCategoryScreen(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
navigateUp = navigateUp, navigateUp = navigateUp,
title = stringResource(R.string.action_edit_categories), title = stringResource(MR.strings.action_edit_categories),
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
}, },
@ -44,7 +45,7 @@ fun SourceCategoryScreen(
) { paddingValues -> ) { paddingValues ->
if (state.isEmpty) { if (state.isEmpty) {
EmptyScreen( EmptyScreen(
textResource = R.string.no_source_categories, SYMR.strings.no_source_categories,
modifier = Modifier.padding(paddingValues), modifier = Modifier.padding(paddingValues),
) )
return@Scaffold return@Scaffold

View File

@ -6,15 +6,15 @@ import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.category.components.CategoryFloatingActionButton import eu.kanade.presentation.category.components.CategoryFloatingActionButton
import eu.kanade.presentation.category.components.repo.SourceRepoContent import eu.kanade.presentation.category.components.repo.SourceRepoContent
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.repos.RepoScreenState import eu.kanade.tachiyomi.ui.category.repos.RepoScreenState
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.components.material.topSmallPaddingValues import tachiyomi.presentation.core.components.material.topSmallPaddingValues
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.util.plus import tachiyomi.presentation.core.util.plus
@ -30,7 +30,7 @@ fun SourceRepoScreen(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
navigateUp = navigateUp, navigateUp = navigateUp,
title = stringResource(R.string.action_edit_repos), title = stringResource(SYMR.strings.action_edit_repos),
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
}, },
@ -43,7 +43,7 @@ fun SourceRepoScreen(
) { paddingValues -> ) { paddingValues ->
if (state.isEmpty) { if (state.isEmpty) {
EmptyScreen( EmptyScreen(
textResource = R.string.information_empty_repos, SYMR.strings.information_empty_repos,
modifier = Modifier.padding(paddingValues), modifier = Modifier.padding(paddingValues),
) )
return@Scaffold return@Scaffold

View File

@ -25,14 +25,17 @@ import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.res.stringResource import dev.icerock.moko.resources.StringResource
import eu.kanade.core.preference.asToggleableState import eu.kanade.core.preference.asToggleableState
import eu.kanade.presentation.category.visualName import eu.kanade.presentation.category.visualName
import eu.kanade.tachiyomi.R import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import tachiyomi.core.preference.CheckboxState import tachiyomi.core.preference.CheckboxState
import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.Category
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
import kotlin.time.Duration.Companion.seconds import kotlin.time.Duration.Companion.seconds
@Composable @Composable
@ -40,10 +43,10 @@ fun CategoryCreateDialog(
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
onCreate: (String) -> Unit, onCreate: (String) -> Unit,
// SY --> // SY -->
categories: List<String>, categories: ImmutableList<String>,
title: String, title: String,
extraMessage: String? = null, extraMessage: String? = null,
alreadyExistsError: Int = R.string.error_category_exists, alreadyExistsError: StringResource = MR.strings.error_category_exists,
// SY <-- // SY <--
) { ) {
var name by remember { mutableStateOf("") } var name by remember { mutableStateOf("") }
@ -61,12 +64,12 @@ fun CategoryCreateDialog(
onDismissRequest() onDismissRequest()
}, },
) { ) {
Text(text = stringResource(R.string.action_add)) Text(text = stringResource(MR.strings.action_add))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
@ -85,13 +88,13 @@ fun CategoryCreateDialog(
value = name, value = name,
onValueChange = { name = it }, onValueChange = { name = it },
label = { label = {
Text(text = stringResource(R.string.name)) Text(text = stringResource(MR.strings.name))
}, },
supportingText = { supportingText = {
val msgRes = if (name.isNotEmpty() && nameAlreadyExists) { val msgRes = if (name.isNotEmpty() && nameAlreadyExists) {
alreadyExistsError alreadyExistsError
} else { } else {
R.string.information_required_plain MR.strings.information_required_plain
} }
Text(text = stringResource(msgRes)) Text(text = stringResource(msgRes))
}, },
@ -116,9 +119,9 @@ fun CategoryRenameDialog(
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
onRename: (String) -> Unit, onRename: (String) -> Unit,
// SY --> // SY -->
categories: List<String>, categories: ImmutableList<String>,
category: String, category: String,
alreadyExistsError: Int = R.string.error_category_exists, alreadyExistsError: StringResource = MR.strings.error_category_exists,
// SY <-- // SY <--
) { ) {
var name by remember { mutableStateOf(category) } var name by remember { mutableStateOf(category) }
@ -136,16 +139,16 @@ fun CategoryRenameDialog(
onDismissRequest() onDismissRequest()
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.action_rename_category)) Text(text = stringResource(MR.strings.action_rename_category))
}, },
text = { text = {
OutlinedTextField( OutlinedTextField(
@ -155,12 +158,12 @@ fun CategoryRenameDialog(
valueHasChanged = name != it valueHasChanged = name != it
name = it name = it
}, },
label = { Text(text = stringResource(R.string.name)) }, label = { Text(text = stringResource(MR.strings.name)) },
supportingText = { supportingText = {
val msgRes = if (valueHasChanged && nameAlreadyExists) { val msgRes = if (valueHasChanged && nameAlreadyExists) {
alreadyExistsError alreadyExistsError
} else { } else {
R.string.information_required_plain MR.strings.information_required_plain
} }
Text(text = stringResource(msgRes)) Text(text = stringResource(msgRes))
}, },
@ -193,12 +196,12 @@ fun CategoryDeleteDialog(
onDelete() onDelete()
onDismissRequest() onDismissRequest()
}) { }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
@ -222,26 +225,26 @@ fun CategorySortAlphabeticallyDialog(
onSort() onSort()
onDismissRequest() onDismissRequest()
}) { }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.action_sort_category)) Text(text = stringResource(MR.strings.action_sort_category))
}, },
text = { text = {
Text(text = stringResource(R.string.sort_category_confirmation)) Text(text = stringResource(MR.strings.sort_category_confirmation))
}, },
) )
} }
@Composable @Composable
fun ChangeCategoryDialog( fun ChangeCategoryDialog(
initialSelection: List<CheckboxState<Category>>, initialSelection: ImmutableList<CheckboxState<Category>>,
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
onEditCategories: () -> Unit, onEditCategories: () -> Unit,
onConfirm: (List<Long>, List<Long>) -> Unit, onConfirm: (List<Long>, List<Long>) -> Unit,
@ -256,14 +259,14 @@ fun ChangeCategoryDialog(
onEditCategories() onEditCategories()
}, },
) { ) {
Text(text = stringResource(R.string.action_edit_categories)) Text(text = stringResource(MR.strings.action_edit_categories))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.action_move_category)) Text(text = stringResource(MR.strings.action_move_category))
}, },
text = { text = {
Text(text = stringResource(R.string.information_empty_category_dialog)) Text(text = stringResource(MR.strings.information_empty_category_dialog))
}, },
) )
return return
@ -277,11 +280,11 @@ fun ChangeCategoryDialog(
onDismissRequest() onDismissRequest()
onEditCategories() onEditCategories()
}) { }) {
Text(text = stringResource(R.string.action_edit)) Text(text = stringResource(MR.strings.action_edit))
} }
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
tachiyomi.presentation.core.components.material.TextButton(onClick = onDismissRequest) { tachiyomi.presentation.core.components.material.TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
tachiyomi.presentation.core.components.material.TextButton( tachiyomi.presentation.core.components.material.TextButton(
onClick = { onClick = {
@ -296,12 +299,12 @@ fun ChangeCategoryDialog(
) )
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
} }
}, },
title = { title = {
Text(text = stringResource(R.string.action_move_category)) Text(text = stringResource(MR.strings.action_move_category))
}, },
text = { text = {
Column( Column(
@ -313,7 +316,7 @@ fun ChangeCategoryDialog(
if (index != -1) { if (index != -1) {
val mutableList = selection.toMutableList() val mutableList = selection.toMutableList()
mutableList[index] = it.next() mutableList[index] = it.next()
selection = mutableList.toList() selection = mutableList.toList().toImmutableList()
} }
} }
Row( Row(

View File

@ -9,11 +9,12 @@ import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import eu.kanade.tachiyomi.ui.category.biometric.TimeRangeItem import eu.kanade.tachiyomi.ui.category.biometric.TimeRangeItem
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun BiometricTimesContent( fun BiometricTimesContent(
timeRanges: List<TimeRangeItem>, timeRanges: ImmutableList<TimeRangeItem>,
lazyListState: LazyListState, lazyListState: LazyListState,
paddingValues: PaddingValues, paddingValues: PaddingValues,
onClickDelete: (TimeRangeItem) -> Unit, onClickDelete: (TimeRangeItem) -> Unit,

View File

@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Label
import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Label import androidx.compose.material.icons.outlined.Label
import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ElevatedCard
@ -33,11 +34,11 @@ fun BiometricTimesListItem(
.padding( .padding(
start = MaterialTheme.padding.medium, start = MaterialTheme.padding.medium,
top = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium,
end = MaterialTheme.padding.medium end = MaterialTheme.padding.medium,
), ),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon(imageVector = Icons.Outlined.Label, contentDescription = "") Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = "")
Text(text = timeRange.formattedString, modifier = Modifier.padding(start = MaterialTheme.padding.medium)) Text(text = timeRange.formattedString, modifier = Modifier.padding(start = MaterialTheme.padding.medium))
} }
Row { Row {

View File

@ -8,11 +8,12 @@ import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun SortTagContent( fun SortTagContent(
tags: List<String>, tags: ImmutableList<String>,
lazyListState: LazyListState, lazyListState: LazyListState,
paddingValues: PaddingValues, paddingValues: PaddingValues,
onClickDelete: (String) -> Unit, onClickDelete: (String) -> Unit,

View File

@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Label
import androidx.compose.material.icons.outlined.ArrowDropDown import androidx.compose.material.icons.outlined.ArrowDropDown
import androidx.compose.material.icons.outlined.ArrowDropUp import androidx.compose.material.icons.outlined.ArrowDropUp
import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Delete
@ -38,11 +39,11 @@ fun SortTagListItem(
.padding( .padding(
start = MaterialTheme.padding.medium, start = MaterialTheme.padding.medium,
top = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium,
end = MaterialTheme.padding.medium end = MaterialTheme.padding.medium,
), ),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon(imageVector = Icons.Outlined.Label, contentDescription = "") Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = "")
Text(text = tag, modifier = Modifier.padding(start = MaterialTheme.padding.medium)) Text(text = tag, modifier = Modifier.padding(start = MaterialTheme.padding.medium))
} }
Row { Row {

View File

@ -8,11 +8,12 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun SourceRepoContent( fun SourceRepoContent(
repos: List<String>, repos: ImmutableList<String>,
lazyListState: LazyListState, lazyListState: LazyListState,
paddingValues: PaddingValues, paddingValues: PaddingValues,
onClickDelete: (String) -> Unit, onClickDelete: (String) -> Unit,

View File

@ -5,6 +5,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Label
import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Label import androidx.compose.material.icons.outlined.Label
import androidx.compose.material3.ElevatedCard import androidx.compose.material3.ElevatedCard
@ -32,11 +33,11 @@ fun SourceRepoListItem(
.padding( .padding(
start = MaterialTheme.padding.medium, start = MaterialTheme.padding.medium,
top = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium,
end = MaterialTheme.padding.medium end = MaterialTheme.padding.medium,
), ),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon(imageVector = Icons.Outlined.Label, contentDescription = "") Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = "")
Text(text = repo, modifier = Modifier.padding(start = MaterialTheme.padding.medium)) Text(text = repo, modifier = Modifier.padding(start = MaterialTheme.padding.medium))
} }
Row { Row {

View File

@ -8,11 +8,12 @@ import androidx.compose.foundation.lazy.items
import androidx.compose.material3.MaterialTheme import androidx.compose.material3.MaterialTheme
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
@Composable @Composable
fun SourceCategoryContent( fun SourceCategoryContent(
categories: List<String>, categories: ImmutableList<String>,
lazyListState: LazyListState, lazyListState: LazyListState,
paddingValues: PaddingValues, paddingValues: PaddingValues,
onClickRename: (String) -> Unit, onClickRename: (String) -> Unit,

View File

@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Label
import androidx.compose.material.icons.outlined.Delete import androidx.compose.material.icons.outlined.Delete
import androidx.compose.material.icons.outlined.Edit import androidx.compose.material.icons.outlined.Edit
import androidx.compose.material.icons.outlined.Label import androidx.compose.material.icons.outlined.Label
@ -36,11 +37,11 @@ fun SourceCategoryListItem(
.padding( .padding(
start = MaterialTheme.padding.medium, start = MaterialTheme.padding.medium,
top = MaterialTheme.padding.medium, top = MaterialTheme.padding.medium,
end = MaterialTheme.padding.medium end = MaterialTheme.padding.medium,
), ),
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Icon(imageVector = Icons.Outlined.Label, contentDescription = "") Icon(imageVector = Icons.AutoMirrored.Outlined.Label, contentDescription = "")
Text(text = category, modifier = Modifier.padding(start = MaterialTheme.padding.medium)) Text(text = category, modifier = Modifier.padding(start = MaterialTheme.padding.medium))
} }
Row { Row {

View File

@ -43,7 +43,6 @@ import androidx.compose.ui.graphics.SolidColor
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalFocusManager import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalSoftwareKeyboardController import androidx.compose.ui.platform.LocalSoftwareKeyboardController
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.VisualTransformation import androidx.compose.ui.text.input.VisualTransformation

View File

@ -11,10 +11,10 @@ import androidx.compose.ui.util.fastMaxBy
@Composable @Composable
fun AroundLayout( fun AroundLayout(
modifier: Modifier = Modifier,
startLayout: @Composable () -> Unit, startLayout: @Composable () -> Unit,
endLayout: @Composable () -> Unit, endLayout: @Composable () -> Unit,
content: @Composable () -> Unit, content: @Composable () -> Unit,
modifier: Modifier = Modifier,
) { ) {
SubcomposeLayout(modifier) { constraints -> SubcomposeLayout(modifier) { constraints ->
val layoutWidth = constraints.maxWidth val layoutWidth = constraints.maxWidth

View File

@ -21,6 +21,7 @@ import eu.kanade.presentation.components.SearchToolbar
import eu.kanade.presentation.history.components.HistoryItem import eu.kanade.presentation.history.components.HistoryItem
import eu.kanade.presentation.theme.TachiyomiTheme import eu.kanade.presentation.theme.TachiyomiTheme
import eu.kanade.tachiyomi.ui.history.HistoryScreenModel import eu.kanade.tachiyomi.ui.history.HistoryScreenModel
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.core.preference.InMemoryPreferenceStore import tachiyomi.core.preference.InMemoryPreferenceStore
import tachiyomi.domain.history.model.HistoryWithRelations import tachiyomi.domain.history.model.HistoryWithRelations
@ -97,7 +98,7 @@ fun HistoryScreen(
@Composable @Composable
private fun HistoryScreenContent( private fun HistoryScreenContent(
history: List<HistoryUiModel>, history: ImmutableList<HistoryUiModel>,
contentPadding: PaddingValues, contentPadding: PaddingValues,
onClickCover: (HistoryWithRelations) -> Unit, onClickCover: (HistoryWithRelations) -> Unit,
onClickResume: (HistoryWithRelations) -> Unit, onClickResume: (HistoryWithRelations) -> Unit,

View File

@ -2,6 +2,8 @@ package eu.kanade.presentation.history
import androidx.compose.ui.tooling.preview.PreviewParameterProvider import androidx.compose.ui.tooling.preview.PreviewParameterProvider
import eu.kanade.tachiyomi.ui.history.HistoryScreenModel import eu.kanade.tachiyomi.ui.history.HistoryScreenModel
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import tachiyomi.domain.history.model.HistoryWithRelations import tachiyomi.domain.history.model.HistoryWithRelations
import tachiyomi.domain.manga.model.MangaCover import tachiyomi.domain.manga.model.MangaCover
import java.time.Instant import java.time.Instant
@ -14,20 +16,20 @@ class HistoryScreenModelStateProvider : PreviewParameterProvider<HistoryScreenMo
private val multiPage = HistoryScreenModel.State( private val multiPage = HistoryScreenModel.State(
searchQuery = null, searchQuery = null,
list = list =
listOf(HistoryUiModelExamples.headerToday) persistentListOf(HistoryUiModelExamples.headerToday)
.asSequence() .asSequence()
.plus(HistoryUiModelExamples.items().take(3)) .plus(HistoryUiModelExamples.items().take(3))
.plus(HistoryUiModelExamples.header { it.minus(1, ChronoUnit.DAYS) }) .plus(HistoryUiModelExamples.header { it.minus(1, ChronoUnit.DAYS) })
.plus(HistoryUiModelExamples.items().take(1)) .plus(HistoryUiModelExamples.items().take(1))
.plus(HistoryUiModelExamples.header { it.minus(2, ChronoUnit.DAYS) }) .plus(HistoryUiModelExamples.header { it.minus(2, ChronoUnit.DAYS) })
.plus(HistoryUiModelExamples.items().take(7)) .plus(HistoryUiModelExamples.items().take(7))
.toList(), .toImmutableList(),
dialog = null, dialog = null,
) )
private val shortRecent = HistoryScreenModel.State( private val shortRecent = HistoryScreenModel.State(
searchQuery = null, searchQuery = null,
list = listOf( list = persistentListOf(
HistoryUiModelExamples.headerToday, HistoryUiModelExamples.headerToday,
HistoryUiModelExamples.items().first(), HistoryUiModelExamples.items().first(),
), ),
@ -36,7 +38,7 @@ class HistoryScreenModelStateProvider : PreviewParameterProvider<HistoryScreenMo
private val shortFuture = HistoryScreenModel.State( private val shortFuture = HistoryScreenModel.State(
searchQuery = null, searchQuery = null,
list = listOf( list = persistentListOf(
HistoryUiModelExamples.headerTomorrow, HistoryUiModelExamples.headerTomorrow,
HistoryUiModelExamples.items().first(), HistoryUiModelExamples.items().first(),
), ),
@ -45,7 +47,7 @@ class HistoryScreenModelStateProvider : PreviewParameterProvider<HistoryScreenMo
private val empty = HistoryScreenModel.State( private val empty = HistoryScreenModel.State(
searchQuery = null, searchQuery = null,
list = listOf(), list = persistentListOf(),
dialog = null, dialog = null,
) )

View File

@ -15,13 +15,14 @@ import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.res.painterResource import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.util.fastForEach import androidx.compose.ui.util.fastForEach
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.components.TabbedDialog import eu.kanade.presentation.components.TabbedDialog
import eu.kanade.presentation.components.TabbedDialogPaddings import eu.kanade.presentation.components.TabbedDialogPaddings
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.library.LibrarySettingsScreenModel import eu.kanade.tachiyomi.ui.library.LibrarySettingsScreenModel
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.flow.map import kotlinx.coroutines.flow.map
import tachiyomi.core.preference.TriState import tachiyomi.core.preference.TriState
import tachiyomi.domain.category.model.Category import tachiyomi.domain.category.model.Category
@ -30,6 +31,8 @@ import tachiyomi.domain.library.model.LibraryGroup
import tachiyomi.domain.library.model.LibrarySort import tachiyomi.domain.library.model.LibrarySort
import tachiyomi.domain.library.model.sort import tachiyomi.domain.library.model.sort
import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.HeadingItem import tachiyomi.presentation.core.components.HeadingItem
import tachiyomi.presentation.core.components.IconItem import tachiyomi.presentation.core.components.IconItem
@ -37,6 +40,7 @@ import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.components.SliderItem import tachiyomi.presentation.core.components.SliderItem
import tachiyomi.presentation.core.components.SortItem import tachiyomi.presentation.core.components.SortItem
import tachiyomi.presentation.core.components.TriStateItem import tachiyomi.presentation.core.components.TriStateItem
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
@Composable @Composable
@ -51,11 +55,11 @@ fun LibrarySettingsDialog(
TabbedDialog( TabbedDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
tabTitles = persistentListOf( tabTitles = persistentListOf(
stringResource(R.string.action_filter), stringResource(MR.strings.action_filter),
stringResource(R.string.action_sort), stringResource(MR.strings.action_sort),
stringResource(R.string.action_display), stringResource(MR.strings.action_display),
// SY --> // SY -->
stringResource(R.string.group), stringResource(SYMR.strings.group),
// SY <-- // SY <--
), ),
) { page -> ) { page ->
@ -93,7 +97,7 @@ private fun ColumnScope.FilterPage(
val filterDownloaded by screenModel.libraryPreferences.filterDownloaded().collectAsState() val filterDownloaded by screenModel.libraryPreferences.filterDownloaded().collectAsState()
val downloadedOnly by screenModel.preferences.downloadedOnly().collectAsState() val downloadedOnly by screenModel.preferences.downloadedOnly().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.label_downloaded), label = stringResource(MR.strings.label_downloaded),
state = if (downloadedOnly) { state = if (downloadedOnly) {
TriState.ENABLED_IS TriState.ENABLED_IS
} else { } else {
@ -104,32 +108,32 @@ private fun ColumnScope.FilterPage(
) )
val filterUnread by screenModel.libraryPreferences.filterUnread().collectAsState() val filterUnread by screenModel.libraryPreferences.filterUnread().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.action_filter_unread), label = stringResource(MR.strings.action_filter_unread),
state = filterUnread, state = filterUnread,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterUnread) }, onClick = { screenModel.toggleFilter(LibraryPreferences::filterUnread) },
) )
val filterStarted by screenModel.libraryPreferences.filterStarted().collectAsState() val filterStarted by screenModel.libraryPreferences.filterStarted().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.label_started), label = stringResource(MR.strings.label_started),
state = filterStarted, state = filterStarted,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterStarted) }, onClick = { screenModel.toggleFilter(LibraryPreferences::filterStarted) },
) )
val filterBookmarked by screenModel.libraryPreferences.filterBookmarked().collectAsState() val filterBookmarked by screenModel.libraryPreferences.filterBookmarked().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.action_filter_bookmarked), label = stringResource(MR.strings.action_filter_bookmarked),
state = filterBookmarked, state = filterBookmarked,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterBookmarked) }, onClick = { screenModel.toggleFilter(LibraryPreferences::filterBookmarked) },
) )
val filterCompleted by screenModel.libraryPreferences.filterCompleted().collectAsState() val filterCompleted by screenModel.libraryPreferences.filterCompleted().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.completed), label = stringResource(MR.strings.completed),
state = filterCompleted, state = filterCompleted,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterCompleted) }, onClick = { screenModel.toggleFilter(LibraryPreferences::filterCompleted) },
) )
// SY --> // SY -->
val filterLewd by screenModel.libraryPreferences.filterLewd().collectAsState() val filterLewd by screenModel.libraryPreferences.filterLewd().collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.lewd), label = stringResource(SYMR.strings.lewd),
state = filterLewd, state = filterLewd,
onClick = { screenModel.toggleFilter(LibraryPreferences::filterLewd) }, onClick = { screenModel.toggleFilter(LibraryPreferences::filterLewd) },
) )
@ -144,13 +148,13 @@ private fun ColumnScope.FilterPage(
val service = trackers[0] val service = trackers[0]
val filterTracker by screenModel.libraryPreferences.filterTracking(service.id.toInt()).collectAsState() val filterTracker by screenModel.libraryPreferences.filterTracking(service.id.toInt()).collectAsState()
TriStateItem( TriStateItem(
label = stringResource(R.string.action_filter_tracked), label = stringResource(MR.strings.action_filter_tracked),
state = filterTracker, state = filterTracker,
onClick = { screenModel.toggleTracker(service.id.toInt()) }, onClick = { screenModel.toggleTracker(service.id.toInt()) },
) )
} }
else -> { else -> {
HeadingItem(R.string.action_filter_tracked) HeadingItem(MR.strings.action_filter_tracked)
trackers.map { service -> trackers.map { service ->
val filterTracker by screenModel.libraryPreferences.filterTracking(service.id.toInt()).collectAsState() val filterTracker by screenModel.libraryPreferences.filterTracking(service.id.toInt()).collectAsState()
TriStateItem( TriStateItem(
@ -190,21 +194,21 @@ private fun ColumnScope.SortPage(
if (screenModel.trackers.isEmpty()) { if (screenModel.trackers.isEmpty()) {
emptyList() emptyList()
} else { } else {
listOf(R.string.action_sort_tracker_score to LibrarySort.Type.TrackerMean) listOf(MR.strings.action_sort_tracker_score to LibrarySort.Type.TrackerMean)
} }
listOfNotNull( listOfNotNull(
R.string.action_sort_alpha to LibrarySort.Type.Alphabetical, MR.strings.action_sort_alpha to LibrarySort.Type.Alphabetical,
R.string.action_sort_total to LibrarySort.Type.TotalChapters, MR.strings.action_sort_total to LibrarySort.Type.TotalChapters,
R.string.action_sort_last_read to LibrarySort.Type.LastRead, MR.strings.action_sort_last_read to LibrarySort.Type.LastRead,
R.string.action_sort_last_manga_update to LibrarySort.Type.LastUpdate, MR.strings.action_sort_last_manga_update to LibrarySort.Type.LastUpdate,
R.string.action_sort_unread_count to LibrarySort.Type.UnreadCount, MR.strings.action_sort_unread_count to LibrarySort.Type.UnreadCount,
R.string.action_sort_latest_chapter to LibrarySort.Type.LatestChapter, MR.strings.action_sort_latest_chapter to LibrarySort.Type.LatestChapter,
R.string.action_sort_chapter_fetch_date to LibrarySort.Type.ChapterFetchDate, MR.strings.action_sort_chapter_fetch_date to LibrarySort.Type.ChapterFetchDate,
R.string.action_sort_date_added to LibrarySort.Type.DateAdded, MR.strings.action_sort_date_added to LibrarySort.Type.DateAdded,
// SY --> // SY -->
if (hasSortTags) { if (hasSortTags) {
R.string.tag_sorting to LibrarySort.Type.TagList SYMR.strings.tag_sorting to LibrarySort.Type.TagList
} else { } else {
null null
}, },
@ -230,10 +234,10 @@ private fun ColumnScope.SortPage(
} }
private val displayModes = listOf( private val displayModes = listOf(
R.string.action_display_grid to LibraryDisplayMode.CompactGrid, MR.strings.action_display_grid to LibraryDisplayMode.CompactGrid,
R.string.action_display_comfortable_grid to LibraryDisplayMode.ComfortableGrid, MR.strings.action_display_comfortable_grid to LibraryDisplayMode.ComfortableGrid,
R.string.action_display_cover_only_grid to LibraryDisplayMode.CoverOnlyGrid, MR.strings.action_display_cover_only_grid to LibraryDisplayMode.CoverOnlyGrid,
R.string.action_display_list to LibraryDisplayMode.List, MR.strings.action_display_list to LibraryDisplayMode.List,
) )
@Composable @Composable
@ -241,7 +245,7 @@ private fun ColumnScope.DisplayPage(
screenModel: LibrarySettingsScreenModel, screenModel: LibrarySettingsScreenModel,
) { ) {
val displayMode by screenModel.libraryPreferences.displayMode().collectAsState() val displayMode by screenModel.libraryPreferences.displayMode().collectAsState()
SettingsChipRow(R.string.action_display_mode) { SettingsChipRow(MR.strings.action_display_mode) {
displayModes.map { (titleRes, mode) -> displayModes.map { (titleRes, mode) ->
FilterChip( FilterChip(
selected = displayMode == mode, selected = displayMode == mode,
@ -263,43 +267,43 @@ private fun ColumnScope.DisplayPage(
val columns by columnPreference.collectAsState() val columns by columnPreference.collectAsState()
SliderItem( SliderItem(
label = stringResource(R.string.pref_library_columns), label = stringResource(MR.strings.pref_library_columns),
max = 10, max = 10,
value = columns, value = columns,
valueText = if (columns > 0) { valueText = if (columns > 0) {
stringResource(R.string.pref_library_columns_per_row, columns) stringResource(MR.strings.pref_library_columns_per_row, columns)
} else { } else {
stringResource(R.string.label_default) stringResource(MR.strings.label_default)
}, },
onChange = columnPreference::set, onChange = columnPreference::set,
) )
} }
HeadingItem(R.string.overlay_header) HeadingItem(MR.strings.overlay_header)
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_download_badge), label = stringResource(MR.strings.action_display_download_badge),
pref = screenModel.libraryPreferences.downloadBadge(), pref = screenModel.libraryPreferences.downloadBadge(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_local_badge), label = stringResource(MR.strings.action_display_local_badge),
pref = screenModel.libraryPreferences.localBadge(), pref = screenModel.libraryPreferences.localBadge(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_language_badge), label = stringResource(MR.strings.action_display_language_badge),
pref = screenModel.libraryPreferences.languageBadge(), pref = screenModel.libraryPreferences.languageBadge(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_show_continue_reading_button), label = stringResource(MR.strings.action_display_show_continue_reading_button),
pref = screenModel.libraryPreferences.showContinueReadingButton(), pref = screenModel.libraryPreferences.showContinueReadingButton(),
) )
HeadingItem(R.string.tabs_header) HeadingItem(MR.strings.tabs_header)
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_show_tabs), label = stringResource(MR.strings.action_display_show_tabs),
pref = screenModel.libraryPreferences.categoryTabs(), pref = screenModel.libraryPreferences.categoryTabs(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.action_display_show_number_of_items), label = stringResource(MR.strings.action_display_show_number_of_items),
pref = screenModel.libraryPreferences.categoryNumberOfItems(), pref = screenModel.libraryPreferences.categoryNumberOfItems(),
) )
} }
@ -307,7 +311,7 @@ private fun ColumnScope.DisplayPage(
// SY --> // SY -->
data class GroupMode( data class GroupMode(
val int: Int, val int: Int,
val nameRes: Int, val nameRes: StringResource,
val drawableRes: Int, val drawableRes: Int,
) )
@ -343,7 +347,7 @@ private fun ColumnScope.GroupPage(
LibraryGroup.groupTypeStringRes(it, hasCategories), LibraryGroup.groupTypeStringRes(it, hasCategories),
groupTypeDrawableRes(it), groupTypeDrawableRes(it),
) )
} }.toImmutableList()
} }
groups.fastForEach { groups.fastForEach {

View File

@ -21,6 +21,7 @@ import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.components.SearchToolbar import eu.kanade.presentation.components.SearchToolbar
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.Pill import tachiyomi.presentation.core.components.Pill
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.theme.active import tachiyomi.presentation.core.theme.active
@ -130,9 +131,9 @@ private fun LibraryRegularToolbar(
if (onClickSyncExh != null) { if (onClickSyncExh != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.sync_favorites), title = stringResource(SYMR.strings.sync_favorites),
onClick = onClickSyncExh, onClick = onClickSyncExh,
) ),
) )
} }
// SY <-- // SY <--

View File

@ -1,57 +0,0 @@
package eu.kanade.presentation.library.components
import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.Surface
import androidx.compose.material3.Icon
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R
@Composable
fun StartReadingButton(
modifier: Modifier = Modifier,
onOpenReader: () -> Unit,
) {
Box(
modifier then Modifier
.size(50.dp)
.clip(CircleShape),
contentAlignment = Alignment.Center,
) {
Box(
Modifier
.size(32.dp)
.clip(CircleShape)
.background(Color(0xAD212121))
.clickable(onClick = onOpenReader),
)
Icon(
painter = painterResource(R.drawable.ic_start_reading_24dp),
contentDescription = stringResource(R.string.action_start_reading),
tint = Color.White,
modifier = Modifier
.size(24.dp)
.padding(3.dp),
)
}
}
@Preview
@Composable
fun StartReadingPreview() {
Surface {
StartReadingButton {}
}
}

View File

@ -4,9 +4,10 @@ import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun SyncFavoritesConfirmDialog( fun SyncFavoritesConfirmDialog(
@ -17,19 +18,19 @@ fun SyncFavoritesConfirmDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = onAccept) { TextButton(onClick = onAccept) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(stringResource(R.string.favorites_sync)) Text(stringResource(SYMR.strings.favorites_sync))
}, },
text = { text = {
Text(text = stringResource(R.string.favorites_sync_conformation_message)) Text(text = stringResource(SYMR.strings.favorites_sync_conformation_message))
}, },
properties = DialogProperties(dismissOnClickOutside = false), properties = DialogProperties(dismissOnClickOutside = false),
) )

View File

@ -12,10 +12,12 @@ import androidx.compose.runtime.produceState
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R
import exh.favorites.FavoritesSyncStatus import exh.favorites.FavoritesSyncStatus
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import tachiyomi.core.i18n.stringResource
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import kotlin.time.Duration.Companion.seconds import kotlin.time.Duration.Companion.seconds
data class SyncFavoritesProgressProperties( data class SyncFavoritesProgressProperties(
@ -38,42 +40,42 @@ fun SyncFavoritesProgressDialog(
val properties by produceState<SyncFavoritesProgressProperties?>(initialValue = null, status) { val properties by produceState<SyncFavoritesProgressProperties?>(initialValue = null, status) {
when (status) { when (status) {
is FavoritesSyncStatus.BadLibraryState.MangaInMultipleCategories -> value = SyncFavoritesProgressProperties( is FavoritesSyncStatus.BadLibraryState.MangaInMultipleCategories -> value = SyncFavoritesProgressProperties(
title = context.getString(R.string.favorites_sync_error), title = context.stringResource(SYMR.strings.favorites_sync_error),
text = context.getString(R.string.favorites_sync_bad_library_state, status.message), text = context.stringResource(SYMR.strings.favorites_sync_bad_library_state, status.message),
canDismiss = false, canDismiss = false,
positiveButtonText = context.getString(R.string.show_gallery), positiveButtonText = context.stringResource(SYMR.strings.show_gallery),
positiveButton = { positiveButton = {
openManga(status.manga) openManga(status.manga)
setStatusIdle() setStatusIdle()
}, },
negativeButtonText = context.getString(R.string.action_ok), negativeButtonText = context.stringResource(MR.strings.action_ok),
negativeButton = setStatusIdle, negativeButton = setStatusIdle,
) )
is FavoritesSyncStatus.CompleteWithErrors -> value = SyncFavoritesProgressProperties( is FavoritesSyncStatus.CompleteWithErrors -> value = SyncFavoritesProgressProperties(
title = context.getString(R.string.favorites_sync_done_errors), title = context.stringResource(SYMR.strings.favorites_sync_done_errors),
text = context.getString(R.string.favorites_sync_done_errors_message, status.message), text = context.stringResource(SYMR.strings.favorites_sync_done_errors_message, status.message),
canDismiss = false, canDismiss = false,
positiveButtonText = context.getString(R.string.action_ok), positiveButtonText = context.stringResource(MR.strings.action_ok),
positiveButton = setStatusIdle, positiveButton = setStatusIdle,
) )
is FavoritesSyncStatus.Error -> value = SyncFavoritesProgressProperties( is FavoritesSyncStatus.Error -> value = SyncFavoritesProgressProperties(
title = context.getString(R.string.favorites_sync_error), title = context.stringResource(SYMR.strings.favorites_sync_error),
text = context.getString(R.string.favorites_sync_error_string, status.message), text = context.stringResource(SYMR.strings.favorites_sync_error_string, status.message),
canDismiss = false, canDismiss = false,
positiveButtonText = context.getString(R.string.action_ok), positiveButtonText = context.stringResource(MR.strings.action_ok),
positiveButton = setStatusIdle, positiveButton = setStatusIdle,
) )
is FavoritesSyncStatus.Idle -> value = null is FavoritesSyncStatus.Idle -> value = null
is FavoritesSyncStatus.Initializing, is FavoritesSyncStatus.Processing -> { is FavoritesSyncStatus.Initializing, is FavoritesSyncStatus.Processing -> {
value = SyncFavoritesProgressProperties( value = SyncFavoritesProgressProperties(
title = context.getString(R.string.favorites_syncing), title = context.stringResource(SYMR.strings.favorites_syncing),
text = status.message, text = status.message,
canDismiss = false, canDismiss = false,
) )
if (status is FavoritesSyncStatus.Processing && status.title != null) { if (status is FavoritesSyncStatus.Processing && status.title != null) {
delay(5.seconds) delay(5.seconds)
value = SyncFavoritesProgressProperties( value = SyncFavoritesProgressProperties(
title = context.getString(R.string.favorites_syncing), title = context.stringResource(SYMR.strings.favorites_syncing),
text = status.delayedMessage ?: status.message, text = status.delayedMessage ?: status.message,
canDismiss = false, canDismiss = false,
) )

View File

@ -10,11 +10,13 @@ import androidx.compose.runtime.Composable
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import androidx.core.text.HtmlCompat import androidx.core.text.HtmlCompat
import eu.kanade.tachiyomi.R
import exh.util.toAnnotatedString import exh.util.toAnnotatedString
import tachiyomi.core.i18n.stringResource
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun SyncFavoritesWarningDialog( fun SyncFavoritesWarningDialog(
@ -24,19 +26,19 @@ fun SyncFavoritesWarningDialog(
val context = LocalContext.current val context = LocalContext.current
val text = remember { val text = remember {
HtmlCompat.fromHtml( HtmlCompat.fromHtml(
context.getString(R.string.favorites_sync_notes_message), context.stringResource(SYMR.strings.favorites_sync_notes_message),
HtmlCompat.FROM_HTML_MODE_LEGACY HtmlCompat.FROM_HTML_MODE_LEGACY,
).toAnnotatedString() ).toAnnotatedString()
} }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = onAccept) { TextButton(onClick = onAccept) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
title = { title = {
Text(stringResource(R.string.favorites_sync_notes)) Text(stringResource(SYMR.strings.favorites_sync_notes))
}, },
text = { text = {
Column( Column(

View File

@ -52,7 +52,6 @@ import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.hapticfeedback.HapticFeedbackType import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.platform.LocalConfiguration import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource import androidx.compose.ui.res.vectorResource
import androidx.compose.ui.text.style.TextOverflow import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
@ -65,6 +64,9 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.delay import kotlinx.coroutines.delay
import kotlinx.coroutines.isActive import kotlinx.coroutines.isActive
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
import kotlin.time.Duration.Companion.seconds import kotlin.time.Duration.Companion.seconds
@Composable @Composable
@ -113,7 +115,7 @@ fun MangaBottomActionMenu(
) { ) {
if (onBookmarkClicked != null) { if (onBookmarkClicked != null) {
Button( Button(
title = stringResource(R.string.action_bookmark), title = stringResource(MR.strings.action_bookmark),
icon = Icons.Outlined.BookmarkAdd, icon = Icons.Outlined.BookmarkAdd,
toConfirm = confirm[0], toConfirm = confirm[0],
onLongClick = { onLongClickItem(0) }, onLongClick = { onLongClickItem(0) },
@ -122,7 +124,7 @@ fun MangaBottomActionMenu(
} }
if (onRemoveBookmarkClicked != null) { if (onRemoveBookmarkClicked != null) {
Button( Button(
title = stringResource(R.string.action_remove_bookmark), title = stringResource(MR.strings.action_remove_bookmark),
icon = Icons.Outlined.BookmarkRemove, icon = Icons.Outlined.BookmarkRemove,
toConfirm = confirm[1], toConfirm = confirm[1],
onLongClick = { onLongClickItem(1) }, onLongClick = { onLongClickItem(1) },
@ -131,7 +133,7 @@ fun MangaBottomActionMenu(
} }
if (onMarkAsReadClicked != null) { if (onMarkAsReadClicked != null) {
Button( Button(
title = stringResource(R.string.action_mark_as_read), title = stringResource(MR.strings.action_mark_as_read),
icon = Icons.Outlined.DoneAll, icon = Icons.Outlined.DoneAll,
toConfirm = confirm[2], toConfirm = confirm[2],
onLongClick = { onLongClickItem(2) }, onLongClick = { onLongClickItem(2) },
@ -140,7 +142,7 @@ fun MangaBottomActionMenu(
} }
if (onMarkAsUnreadClicked != null) { if (onMarkAsUnreadClicked != null) {
Button( Button(
title = stringResource(R.string.action_mark_as_unread), title = stringResource(MR.strings.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone, icon = Icons.Outlined.RemoveDone,
toConfirm = confirm[3], toConfirm = confirm[3],
onLongClick = { onLongClickItem(3) }, onLongClick = { onLongClickItem(3) },
@ -149,7 +151,7 @@ fun MangaBottomActionMenu(
} }
if (onMarkPreviousAsReadClicked != null) { if (onMarkPreviousAsReadClicked != null) {
Button( Button(
title = stringResource(R.string.action_mark_previous_as_read), title = stringResource(MR.strings.action_mark_previous_as_read),
icon = ImageVector.vectorResource(R.drawable.ic_done_prev_24dp), icon = ImageVector.vectorResource(R.drawable.ic_done_prev_24dp),
toConfirm = confirm[4], toConfirm = confirm[4],
onLongClick = { onLongClickItem(4) }, onLongClick = { onLongClickItem(4) },
@ -158,7 +160,7 @@ fun MangaBottomActionMenu(
} }
if (onDownloadClicked != null) { if (onDownloadClicked != null) {
Button( Button(
title = stringResource(R.string.action_download), title = stringResource(MR.strings.action_download),
icon = Icons.Outlined.Download, icon = Icons.Outlined.Download,
toConfirm = confirm[5], toConfirm = confirm[5],
onLongClick = { onLongClickItem(5) }, onLongClick = { onLongClickItem(5) },
@ -167,7 +169,7 @@ fun MangaBottomActionMenu(
} }
if (onDeleteClicked != null) { if (onDeleteClicked != null) {
Button( Button(
title = stringResource(R.string.action_delete), title = stringResource(MR.strings.action_delete),
icon = Icons.Outlined.Delete, icon = Icons.Outlined.Delete,
toConfirm = confirm[6], toConfirm = confirm[6],
onLongClick = { onLongClickItem(6) }, onLongClick = { onLongClickItem(6) },
@ -276,7 +278,7 @@ fun LibraryBottomActionMenu(
.padding(horizontal = 8.dp, vertical = 12.dp), .padding(horizontal = 8.dp, vertical = 12.dp),
) { ) {
Button( Button(
title = stringResource(R.string.action_move_category), title = stringResource(MR.strings.action_move_category),
icon = Icons.AutoMirrored.Outlined.Label, icon = Icons.AutoMirrored.Outlined.Label,
toConfirm = confirm[0], toConfirm = confirm[0],
onLongClick = { onLongClickItem(0) }, onLongClick = { onLongClickItem(0) },
@ -285,7 +287,7 @@ fun LibraryBottomActionMenu(
if (onDownloadClicked != null) { if (onDownloadClicked != null) {
var downloadExpanded by remember { mutableStateOf(false) } var downloadExpanded by remember { mutableStateOf(false) }
Button( Button(
title = stringResource(R.string.action_download), title = stringResource(MR.strings.action_download),
icon = Icons.Outlined.Download, icon = Icons.Outlined.Download,
toConfirm = confirm[3], toConfirm = confirm[3],
onLongClick = { onLongClickItem(3) }, onLongClick = { onLongClickItem(3) },
@ -300,7 +302,7 @@ fun LibraryBottomActionMenu(
} }
} }
Button( Button(
title = stringResource(R.string.action_delete), title = stringResource(MR.strings.action_delete),
icon = Icons.Outlined.Delete, icon = Icons.Outlined.Delete,
toConfirm = confirm[4], toConfirm = confirm[4],
onLongClick = { onLongClickItem(4) }, onLongClick = { onLongClickItem(4) },
@ -308,7 +310,7 @@ fun LibraryBottomActionMenu(
) )
// SY --> // SY -->
Button( Button(
title = stringResource(R.string.action_mark_as_read), title = stringResource(MR.strings.action_mark_as_read),
icon = Icons.Outlined.DoneAll, icon = Icons.Outlined.DoneAll,
toConfirm = confirm[1], toConfirm = confirm[1],
onLongClick = { onLongClickItem(1) }, onLongClick = { onLongClickItem(1) },
@ -317,7 +319,7 @@ fun LibraryBottomActionMenu(
if (showOverflow) { if (showOverflow) {
if (!moveMarkPrev) { if (!moveMarkPrev) {
Button( Button(
title = stringResource(R.string.action_mark_as_unread), title = stringResource(MR.strings.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone, icon = Icons.Outlined.RemoveDone,
toConfirm = confirm[2], toConfirm = confirm[2],
onLongClick = { onLongClickItem(2) }, onLongClick = { onLongClickItem(2) },
@ -325,7 +327,7 @@ fun LibraryBottomActionMenu(
) )
} }
Button( Button(
title = stringResource(R.string.label_more), title = stringResource(MR.strings.label_more),
icon = Icons.Outlined.MoreVert, icon = Icons.Outlined.MoreVert,
toConfirm = confirm[5], toConfirm = confirm[5],
onLongClick = { onLongClickItem(5) }, onLongClick = { onLongClickItem(5) },
@ -337,32 +339,32 @@ fun LibraryBottomActionMenu(
) { ) {
if (moveMarkPrev) { if (moveMarkPrev) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_mark_as_unread)) }, text = { Text(stringResource(MR.strings.action_mark_as_unread)) },
onClick = onMarkAsUnreadClicked, onClick = onMarkAsUnreadClicked,
) )
} }
if (onClickCleanTitles != null) { if (onClickCleanTitles != null) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.action_clean_titles)) }, text = { Text(stringResource(SYMR.strings.action_clean_titles)) },
onClick = onClickCleanTitles, onClick = onClickCleanTitles,
) )
} }
if (onClickMigrate != null) { if (onClickMigrate != null) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.migrate)) }, text = { Text(stringResource(MR.strings.migrate)) },
onClick = onClickMigrate, onClick = onClickMigrate,
) )
} }
if (onClickAddToMangaDex != null) { if (onClickAddToMangaDex != null) {
DropdownMenuItem( DropdownMenuItem(
text = { Text(stringResource(R.string.mangadex_add_to_follows)) }, text = { Text(stringResource(SYMR.strings.mangadex_add_to_follows)) },
onClick = onClickAddToMangaDex, onClick = onClickAddToMangaDex,
) )
} }
} }
} else { } else {
Button( Button(
title = stringResource(R.string.action_mark_as_unread), title = stringResource(MR.strings.action_mark_as_unread),
icon = Icons.Outlined.RemoveDone, icon = Icons.Outlined.RemoveDone,
toConfirm = confirm[2], toConfirm = confirm[2],
onLongClick = { onLongClickItem(2) }, onLongClick = { onLongClickItem(2) },
@ -370,7 +372,7 @@ fun LibraryBottomActionMenu(
) )
if (onClickMigrate != null) { if (onClickMigrate != null) {
Button( Button(
title = stringResource(R.string.migrate), title = stringResource(MR.strings.migrate),
icon = Icons.Outlined.SwapCalls, icon = Icons.Outlined.SwapCalls,
toConfirm = confirm[5], toConfirm = confirm[5],
onLongClick = { onLongClickItem(5) }, onLongClick = { onLongClickItem(5) },

View File

@ -189,7 +189,9 @@ fun MangaChapterListItem(
readProgress != null || readProgress != null ||
scanlator != null/* SY --> */ || scanlator != null/* SY --> */ ||
sourceName != null/* SY <-- */ sourceName != null/* SY <-- */
) DotSeparatorText() ) {
DotSeparatorText()
}
} }
if (readProgress != null) { if (readProgress != null) {
Text( Text(

View File

@ -2,28 +2,23 @@ package eu.kanade.presentation.manga.components
import androidx.compose.foundation.layout.BoxWithConstraints import androidx.compose.foundation.layout.BoxWithConstraints
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.material3.TextButton import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.DpSize import androidx.compose.ui.unit.DpSize
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R
import kotlinx.collections.immutable.toImmutableList import kotlinx.collections.immutable.toImmutableList
import tachiyomi.domain.manga.interactor.FetchInterval import tachiyomi.domain.manga.interactor.FetchInterval
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.WheelTextPicker import tachiyomi.presentation.core.components.WheelTextPicker
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun DeleteChaptersDialog( fun DeleteChaptersDialog(
@ -34,7 +29,7 @@ fun DeleteChaptersDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
confirmButton = { confirmButton = {
@ -44,14 +39,14 @@ fun DeleteChaptersDialog(
onConfirm() onConfirm()
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.are_you_sure)) Text(text = stringResource(MR.strings.are_you_sure))
}, },
text = { text = {
Text(text = stringResource(R.string.confirm_delete_chapters)) Text(text = stringResource(MR.strings.confirm_delete_chapters))
}, },
) )
} }
@ -66,7 +61,7 @@ fun SetIntervalDialog(
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.manga_modify_calculated_interval_title)) }, title = { Text(text = stringResource(MR.strings.manga_modify_calculated_interval_title)) },
text = { text = {
BoxWithConstraints( BoxWithConstraints(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -76,7 +71,7 @@ fun SetIntervalDialog(
val items = (0..FetchInterval.MAX_INTERVAL) val items = (0..FetchInterval.MAX_INTERVAL)
.map { .map {
if (it == 0) { if (it == 0) {
stringResource(R.string.label_default) stringResource(MR.strings.label_default)
} else { } else {
it.toString() it.toString()
} }
@ -92,7 +87,7 @@ fun SetIntervalDialog(
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
confirmButton = { confirmButton = {
@ -100,68 +95,8 @@ fun SetIntervalDialog(
onValueChanged(selectedInterval) onValueChanged(selectedInterval)
onDismissRequest() onDismissRequest()
}) { }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
} }
// SY -->
@Composable
fun SelectScanlatorsDialog(
onDismissRequest: () -> Unit,
availableScanlators: List<String>,
initialSelectedScanlators: List<String>,
onSelectScanlators: (List<String>) -> Unit,
) {
val selected = remember {
initialSelectedScanlators.toMutableStateList()
}
AlertDialog(
onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.select_scanlators)) },
text = {
LazyColumn {
availableScanlators.forEach { current ->
item {
val isSelected = selected.contains(current)
LabeledCheckbox(
label = current,
checked = isSelected,
onCheckedChange = {
when (it) {
true -> selected.add(current)
false -> selected.remove(current)
}
},
)
}
}
}
},
properties = DialogProperties(
usePlatformDefaultWidth = true,
),
confirmButton = {
TextButton(
onClick = {
onSelectScanlators(selected.toList())
onDismissRequest()
},
) {
Text(text = stringResource(R.string.action_ok))
}
},
dismissButton = {
TextButton(
onClick = {
onSelectScanlators(availableScanlators)
onDismissRequest()
},
) {
Text(text = stringResource(R.string.action_reset))
}
},
)
}
// SY <--

View File

@ -6,10 +6,10 @@ import androidx.compose.foundation.layout.padding
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Button import tachiyomi.presentation.core.components.material.Button
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MangaInfoButtons( fun MangaInfoButtons(
@ -27,7 +27,7 @@ fun MangaInfoButtons(
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 4.dp), .padding(horizontal = 16.dp, vertical = 4.dp),
) { ) {
Text(stringResource(R.string.merge_with_another_source)) Text(stringResource(SYMR.strings.merge_with_another_source))
} }
} }
if (showRecommendsButton) { if (showRecommendsButton) {
@ -37,7 +37,7 @@ fun MangaInfoButtons(
.fillMaxWidth() .fillMaxWidth()
.padding(horizontal = 16.dp, vertical = 4.dp), .padding(horizontal = 16.dp, vertical = 4.dp),
) { ) {
Text(stringResource(R.string.az_recommends)) Text(stringResource(SYMR.strings.az_recommends))
} }
} }
} }

View File

@ -23,6 +23,7 @@ import androidx.compose.foundation.lazy.LazyRow
import androidx.compose.foundation.lazy.items import androidx.compose.foundation.lazy.items
import androidx.compose.foundation.text.selection.SelectionContainer import androidx.compose.foundation.text.selection.SelectionContainer
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.CallMerge
import androidx.compose.material.icons.filled.Brush import androidx.compose.material.icons.filled.Brush
import androidx.compose.material.icons.filled.Favorite import androidx.compose.material.icons.filled.Favorite
import androidx.compose.material.icons.filled.HourglassEmpty import androidx.compose.material.icons.filled.HourglassEmpty
@ -78,6 +79,7 @@ import eu.kanade.tachiyomi.source.model.SManga
import eu.kanade.tachiyomi.util.system.copyToClipboard import eu.kanade.tachiyomi.util.system.copyToClipboard
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.TextButton import tachiyomi.presentation.core.components.material.TextButton
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.pluralStringResource import tachiyomi.presentation.core.i18n.pluralStringResource
@ -226,8 +228,8 @@ fun MangaActionRow(
// SY --> // SY -->
if (onMergeClicked != null) { if (onMergeClicked != null) {
MangaActionButton( MangaActionButton(
title = stringResource(R.string.merge), title = stringResource(SYMR.strings.merge),
icon = Icons.Outlined.CallMerge, icon = Icons.AutoMirrored.Outlined.CallMerge,
color = defaultActionButtonColor, color = defaultActionButtonColor,
onClick = onMergeClicked, onClick = onMergeClicked,
) )
@ -292,7 +294,7 @@ fun ExpandableMangaDescription(
) )
// SY --> // SY -->
DropdownMenuItem( DropdownMenuItem(
text = { Text(text = stringResource(R.string.action_global_search)) }, text = { Text(text = stringResource(MR.strings.action_global_search)) },
onClick = { onClick = {
doSearch(tagSelected, true) doSearch(tagSelected, true)
showMenu = false showMenu = false

View File

@ -30,6 +30,7 @@ import eu.kanade.presentation.components.UpIcon
import eu.kanade.presentation.manga.DownloadAction import eu.kanade.presentation.manga.DownloadAction
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.theme.active import tachiyomi.presentation.core.theme.active
@ -158,7 +159,7 @@ fun MangaToolbar(
if (onClickMerge != null) { if (onClickMerge != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.merge), title = stringResource(SYMR.strings.merge),
onClick = onClickMerge, onClick = onClickMerge,
), ),
) )
@ -166,7 +167,7 @@ fun MangaToolbar(
if (onClickEditInfo != null) { if (onClickEditInfo != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_edit_info), title = stringResource(SYMR.strings.action_edit_info),
onClick = onClickEditInfo, onClick = onClickEditInfo,
), ),
) )
@ -174,7 +175,7 @@ fun MangaToolbar(
if (onClickRecommend != null) { if (onClickRecommend != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.az_recommends), title = stringResource(SYMR.strings.az_recommends),
onClick = onClickRecommend, onClick = onClickRecommend,
), ),
) )
@ -182,7 +183,7 @@ fun MangaToolbar(
if (onClickMergedSettings != null) { if (onClickMergedSettings != null) {
add( add(
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.merge_settings), title = stringResource(SYMR.strings.merge_settings),
onClick = onClickMergedSettings, onClick = onClickMergedSettings,
), ),
) )

View File

@ -26,16 +26,16 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.layout.ContentScale import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.layout.onGloballyPositioned import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Dp import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import coil.compose.SubcomposeAsyncImage import coil.compose.SubcomposeAsyncImage
import coil.compose.SubcomposeAsyncImageContent import coil.compose.SubcomposeAsyncImageContent
import eu.kanade.domain.manga.model.PagePreview import eu.kanade.domain.manga.model.PagePreview
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.manga.PagePreviewState import eu.kanade.tachiyomi.ui.manga.PagePreviewState
import exh.util.floor import exh.util.floor
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun PagePreviews( fun PagePreviews(
@ -91,7 +91,7 @@ fun PagePreviews(
} }
} }
TextButton(onClick = onMorePreviewsClicked) { TextButton(onClick = onMorePreviewsClicked) {
Text(stringResource(R.string.more_previews)) Text(stringResource(SYMR.strings.more_previews))
} }
} }
} }
@ -122,7 +122,9 @@ fun PagePreview(
if (progress < 0) { if (progress < 0) {
CircularProgressIndicator() CircularProgressIndicator()
} else { } else {
CircularProgressIndicator(progress / 0.01F) CircularProgressIndicator(
progress = { progress / 0.01F },
)
} }
} }
}, },

View File

@ -27,6 +27,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip import androidx.compose.ui.draw.clip
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import kotlinx.collections.immutable.ImmutableSet
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.material.TextButton import tachiyomi.presentation.core.components.material.TextButton
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
@ -36,8 +37,8 @@ import tachiyomi.presentation.core.util.isScrolledToStart
@Composable @Composable
fun ScanlatorFilterDialog( fun ScanlatorFilterDialog(
availableScanlators: Set<String>, availableScanlators: ImmutableSet<String>,
excludedScanlators: Set<String>, excludedScanlators: ImmutableSet<String>,
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
onConfirm: (Set<String>) -> Unit, onConfirm: (Set<String>) -> Unit,
) { ) {

View File

@ -11,6 +11,7 @@ import androidx.compose.foundation.layout.windowInsetsPadding
import androidx.compose.material.icons.Icons import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.HelpOutline import androidx.compose.material.icons.automirrored.outlined.HelpOutline
import androidx.compose.material.icons.automirrored.outlined.Label import androidx.compose.material.icons.automirrored.outlined.Label
import androidx.compose.material.icons.automirrored.outlined.PlaylistAdd
import androidx.compose.material.icons.outlined.CloudOff import androidx.compose.material.icons.outlined.CloudOff
import androidx.compose.material.icons.outlined.GetApp import androidx.compose.material.icons.outlined.GetApp
import androidx.compose.material.icons.outlined.HelpOutline import androidx.compose.material.icons.outlined.HelpOutline
@ -27,8 +28,6 @@ import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.res.vectorResource import androidx.compose.ui.res.vectorResource
import eu.kanade.presentation.components.WarningBanner import eu.kanade.presentation.components.WarningBanner
import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget import eu.kanade.presentation.more.settings.widget.SwitchPreferenceWidget
@ -36,8 +35,12 @@ import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.more.DownloadQueueState import eu.kanade.tachiyomi.ui.more.DownloadQueueState
import tachiyomi.core.Constants import tachiyomi.core.Constants
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun MoreScreen( fun MoreScreen(
@ -72,7 +75,7 @@ fun MoreScreen(
) { ) {
if (isFDroid) { if (isFDroid) {
WarningBanner( WarningBanner(
textRes = R.string.fdroid_warning, textRes = MR.strings.fdroid_warning,
modifier = Modifier.clickable { modifier = Modifier.clickable {
uriHandler.openUri( uriHandler.openUri(
"https://tachiyomi.org/docs/faq/general#how-do-i-update-from-the-f-droid-builds", "https://tachiyomi.org/docs/faq/general#how-do-i-update-from-the-f-droid-builds",
@ -91,8 +94,8 @@ fun MoreScreen(
} }
item { item {
SwitchPreferenceWidget( SwitchPreferenceWidget(
title = stringResource(R.string.label_downloaded_only), title = stringResource(MR.strings.label_downloaded_only),
subtitle = stringResource(R.string.downloaded_only_summary), subtitle = stringResource(MR.strings.downloaded_only_summary),
icon = Icons.Outlined.CloudOff, icon = Icons.Outlined.CloudOff,
checked = downloadedOnly, checked = downloadedOnly,
onCheckedChanged = onDownloadedOnlyChange, onCheckedChanged = onDownloadedOnlyChange,
@ -100,8 +103,8 @@ fun MoreScreen(
} }
item { item {
SwitchPreferenceWidget( SwitchPreferenceWidget(
title = stringResource(R.string.pref_incognito_mode), title = stringResource(MR.strings.pref_incognito_mode),
subtitle = stringResource(R.string.pref_incognito_mode_summary), subtitle = stringResource(MR.strings.pref_incognito_mode_summary),
icon = ImageVector.vectorResource(R.drawable.ic_glasses_24dp), icon = ImageVector.vectorResource(R.drawable.ic_glasses_24dp),
checked = incognitoMode, checked = incognitoMode,
onCheckedChanged = onIncognitoModeChange, onCheckedChanged = onIncognitoModeChange,
@ -114,7 +117,7 @@ fun MoreScreen(
if (!showNavUpdates) { if (!showNavUpdates) {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_recent_updates), title = stringResource(MR.strings.label_recent_updates),
icon = Icons.Outlined.NewReleases, icon = Icons.Outlined.NewReleases,
onPreferenceClick = onClickUpdates, onPreferenceClick = onClickUpdates,
) )
@ -123,7 +126,7 @@ fun MoreScreen(
if (!showNavHistory) { if (!showNavHistory) {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_recent_manga), title = stringResource(MR.strings.label_recent_manga),
icon = Icons.Outlined.History, icon = Icons.Outlined.History,
onPreferenceClick = onClickHistory, onPreferenceClick = onClickHistory,
) )
@ -134,17 +137,17 @@ fun MoreScreen(
item { item {
val downloadQueueState = downloadQueueStateProvider() val downloadQueueState = downloadQueueStateProvider()
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_download_queue), title = stringResource(MR.strings.label_download_queue),
subtitle = when (downloadQueueState) { subtitle = when (downloadQueueState) {
DownloadQueueState.Stopped -> null DownloadQueueState.Stopped -> null
is DownloadQueueState.Paused -> { is DownloadQueueState.Paused -> {
val pending = downloadQueueState.pending val pending = downloadQueueState.pending
if (pending == 0) { if (pending == 0) {
stringResource(R.string.paused) stringResource(MR.strings.paused)
} else { } else {
"${stringResource(R.string.paused)}${ "${stringResource(MR.strings.paused)}${
pluralStringResource( pluralStringResource(
id = R.plurals.download_queue_summary, MR.plurals.download_queue_summary,
count = pending, count = pending,
pending, pending,
) )
@ -153,7 +156,7 @@ fun MoreScreen(
} }
is DownloadQueueState.Downloading -> { is DownloadQueueState.Downloading -> {
val pending = downloadQueueState.pending val pending = downloadQueueState.pending
pluralStringResource(id = R.plurals.download_queue_summary, count = pending, pending) pluralStringResource(MR.plurals.download_queue_summary, count = pending, pending)
} }
}, },
icon = Icons.Outlined.GetApp, icon = Icons.Outlined.GetApp,
@ -162,21 +165,21 @@ fun MoreScreen(
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.categories), title = stringResource(MR.strings.categories),
icon = Icons.AutoMirrored.Outlined.Label, icon = Icons.AutoMirrored.Outlined.Label,
onPreferenceClick = onClickCategories, onPreferenceClick = onClickCategories,
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_stats), title = stringResource(MR.strings.label_stats),
icon = Icons.Outlined.QueryStats, icon = Icons.Outlined.QueryStats,
onPreferenceClick = onClickStats, onPreferenceClick = onClickStats,
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_data_storage), title = stringResource(MR.strings.label_data_storage),
icon = Icons.Outlined.Storage, icon = Icons.Outlined.Storage,
onPreferenceClick = onClickDataAndStorage, onPreferenceClick = onClickDataAndStorage,
) )
@ -184,8 +187,8 @@ fun MoreScreen(
// SY --> // SY -->
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.eh_batch_add), title = stringResource(SYMR.strings.eh_batch_add),
icon = Icons.Outlined.PlaylistAdd, icon = Icons.AutoMirrored.Outlined.PlaylistAdd,
onPreferenceClick = onClickBatchAdd, onPreferenceClick = onClickBatchAdd,
) )
} }
@ -195,21 +198,21 @@ fun MoreScreen(
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_settings), title = stringResource(MR.strings.label_settings),
icon = Icons.Outlined.Settings, icon = Icons.Outlined.Settings,
onPreferenceClick = onClickSettings, onPreferenceClick = onClickSettings,
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.pref_category_about), title = stringResource(MR.strings.pref_category_about),
icon = Icons.Outlined.Info, icon = Icons.Outlined.Info,
onPreferenceClick = onClickAbout, onPreferenceClick = onClickAbout,
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = stringResource(R.string.label_help), title = stringResource(MR.strings.label_help),
icon = Icons.AutoMirrored.Outlined.HelpOutline, icon = Icons.AutoMirrored.Outlined.HelpOutline,
onPreferenceClick = { uriHandler.openUri(Constants.URL_HELP) }, onPreferenceClick = { uriHandler.openUri(Constants.URL_HELP) },
) )

View File

@ -10,9 +10,7 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import exh.log.xLogE import exh.log.xLogE
import exh.uconfig.EHConfigurator import exh.uconfig.EHConfigurator
@ -22,6 +20,9 @@ import kotlinx.coroutines.delay
import kotlinx.coroutines.withContext import kotlinx.coroutines.withContext
import tachiyomi.core.util.lang.launchUI import tachiyomi.core.util.lang.launchUI
import tachiyomi.domain.UnsortedPreferences import tachiyomi.domain.UnsortedPreferences
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import kotlin.time.Duration.Companion.seconds import kotlin.time.Duration.Companion.seconds
@ -61,14 +62,14 @@ fun ConfigureExhDialog(run: Boolean, onRunning: () -> Unit) {
warnDialogOpen = false warnDialogOpen = false
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.settings_profile_note)) Text(text = stringResource(SYMR.strings.settings_profile_note))
}, },
text = { text = {
Text(text = stringResource(R.string.settings_profile_note_message)) Text(text = stringResource(SYMR.strings.settings_profile_note_message))
}, },
) )
} }
@ -80,7 +81,7 @@ fun ConfigureExhDialog(run: Boolean, onRunning: () -> Unit) {
delay(0.2.seconds) delay(0.2.seconds)
EHConfigurator(context).configureAll() EHConfigurator(context).configureAll()
launchUI { launchUI {
context.toast(R.string.eh_settings_successfully_uploaded) context.toast(SYMR.strings.eh_settings_successfully_uploaded)
} }
} catch (e: Exception) { } catch (e: Exception) {
configureFailedDialogOpen = e configureFailedDialogOpen = e
@ -98,10 +99,10 @@ fun ConfigureExhDialog(run: Boolean, onRunning: () -> Unit) {
), ),
confirmButton = {}, confirmButton = {},
title = { title = {
Text(text = stringResource(R.string.eh_settings_uploading_to_server)) Text(text = stringResource(SYMR.strings.eh_settings_uploading_to_server))
}, },
text = { text = {
Text(text = stringResource(R.string.eh_settings_uploading_to_server_message)) Text(text = stringResource(SYMR.strings.eh_settings_uploading_to_server_message))
}, },
) )
} }
@ -110,18 +111,18 @@ fun ConfigureExhDialog(run: Boolean, onRunning: () -> Unit) {
onDismissRequest = { configureFailedDialogOpen = null }, onDismissRequest = { configureFailedDialogOpen = null },
confirmButton = { confirmButton = {
TextButton(onClick = { configureFailedDialogOpen = null }) { TextButton(onClick = { configureFailedDialogOpen = null }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.eh_settings_configuration_failed)) Text(text = stringResource(SYMR.strings.eh_settings_configuration_failed))
}, },
text = { text = {
Text( Text(
text = stringResource( text = stringResource(
R.string.eh_settings_configuration_failed_message, SYMR.strings.eh_settings_configuration_failed_message,
configureFailedDialogOpen?.message.orEmpty() configureFailedDialogOpen?.message.orEmpty(),
) ),
) )
}, },
) )

View File

@ -8,7 +8,6 @@ import android.provider.Settings
import android.webkit.WebStorage import android.webkit.WebStorage
import android.webkit.WebView import android.webkit.WebView
import android.widget.Toast import android.widget.Toast
import androidx.annotation.StringRes
import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -24,7 +23,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.runtime.toMutableStateList import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalUriHandler import androidx.compose.ui.platform.LocalUriHandler
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import androidx.core.net.toUri import androidx.core.net.toUri
import androidx.core.text.HtmlCompat import androidx.core.text.HtmlCompat
@ -73,6 +71,8 @@ import kotlinx.coroutines.Job
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import logcat.LogPriority import logcat.LogPriority
import okhttp3.Headers import okhttp3.Headers
import tachiyomi.core.i18n.pluralStringResource
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.launchNonCancellable
import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.lang.withUIContext
import tachiyomi.core.util.system.logcat import tachiyomi.core.util.system.logcat
@ -81,7 +81,10 @@ import tachiyomi.domain.chapter.interactor.GetChaptersByMangaId
import tachiyomi.domain.manga.interactor.GetAllManga import tachiyomi.domain.manga.interactor.GetAllManga
import tachiyomi.domain.manga.interactor.ResetViewerFlags import tachiyomi.domain.manga.interactor.ResetViewerFlags
import tachiyomi.domain.source.service.SourceManager import tachiyomi.domain.source.service.SourceManager
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -91,8 +94,7 @@ object SettingsAdvancedScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = MR.strings.pref_category_advanced
override fun getTitleRes() = R.string.pref_category_advanced
@Composable @Composable
override fun getPreferences(): List<Preference> { override fun getPreferences(): List<Preference> {
@ -108,13 +110,13 @@ object SettingsAdvancedScreen : SearchableSettings {
listOf( listOf(
/* SY --> Preference.PreferenceItem.SwitchPreference( /* SY --> Preference.PreferenceItem.SwitchPreference(
pref = basePreferences.acraEnabled(), pref = basePreferences.acraEnabled(),
title = stringResource(R.string.pref_enable_acra), title = stringResource(MR.strings.pref_enable_acra),
subtitle = stringResource(R.string.pref_acra_summary), subtitle = stringResource(MR.strings.pref_acra_summary),
enabled = isPreviewBuildType || isReleaseBuildType, enabled = isPreviewBuildType || isReleaseBuildType,
), SY <-- */ ), SY <-- */
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_dump_crash_logs), title = stringResource(MR.strings.pref_dump_crash_logs),
subtitle = stringResource(R.string.pref_dump_crash_logs_summary), subtitle = stringResource(MR.strings.pref_dump_crash_logs_summary),
onClick = { onClick = {
scope.launch { scope.launch {
CrashLogUtil(context).dumpLogs() CrashLogUtil(context).dumpLogs()
@ -123,15 +125,15 @@ object SettingsAdvancedScreen : SearchableSettings {
), ),
/* SY --> Preference.PreferenceItem.SwitchPreference( /* SY --> Preference.PreferenceItem.SwitchPreference(
pref = networkPreferences.verboseLogging(), pref = networkPreferences.verboseLogging(),
title = stringResource(R.string.pref_verbose_logging), title = stringResource(MR.strings.pref_verbose_logging),
subtitle = stringResource(R.string.pref_verbose_logging_summary), subtitle = stringResource(MR.strings.pref_verbose_logging_summary),
onValueChanged = { onValueChanged = {
context.toast(R.string.requires_app_restart) context.toast(MR.strings.requires_app_restart)
true true
}, },
), SY <-- */ ), SY <-- */
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_debug_info), title = stringResource(MR.strings.pref_debug_info),
onClick = { navigator.push(DebugInfoScreen()) }, onClick = { navigator.push(DebugInfoScreen()) },
), ),
), ),
@ -139,7 +141,7 @@ object SettingsAdvancedScreen : SearchableSettings {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
add( add(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_manage_notifications), title = stringResource(MR.strings.pref_manage_notifications),
onClick = { onClick = {
val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply { val intent = Intent(Settings.ACTION_APP_NOTIFICATION_SETTINGS).apply {
putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName) putExtra(Settings.EXTRA_APP_PACKAGE, context.packageName)
@ -172,11 +174,11 @@ object SettingsAdvancedScreen : SearchableSettings {
val uriHandler = LocalUriHandler.current val uriHandler = LocalUriHandler.current
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.label_background_activity), title = stringResource(MR.strings.label_background_activity),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_disable_battery_optimization), title = stringResource(MR.strings.pref_disable_battery_optimization),
subtitle = stringResource(R.string.pref_disable_battery_optimization_summary), subtitle = stringResource(MR.strings.pref_disable_battery_optimization_summary),
onClick = { onClick = {
val packageName: String = context.packageName val packageName: String = context.packageName
if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) { if (!context.powerManager.isIgnoringBatteryOptimizations(packageName)) {
@ -189,16 +191,16 @@ object SettingsAdvancedScreen : SearchableSettings {
} }
context.startActivity(intent) context.startActivity(intent)
} catch (e: ActivityNotFoundException) { } catch (e: ActivityNotFoundException) {
context.toast(R.string.battery_optimization_setting_activity_not_found) context.toast(MR.strings.battery_optimization_setting_activity_not_found)
} }
} else { } else {
context.toast(R.string.battery_optimization_disabled) context.toast(MR.strings.battery_optimization_disabled)
} }
}, },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = "Don't kill my app!", title = "Don't kill my app!",
subtitle = stringResource(R.string.about_dont_kill_my_app), subtitle = stringResource(MR.strings.about_dont_kill_my_app),
onClick = { uriHandler.openUri("https://dontkillmyapp.com/") }, onClick = { uriHandler.openUri("https://dontkillmyapp.com/") },
), ),
), ),
@ -211,19 +213,19 @@ object SettingsAdvancedScreen : SearchableSettings {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.label_data), title = stringResource(MR.strings.label_data),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_invalidate_download_cache), title = stringResource(MR.strings.pref_invalidate_download_cache),
subtitle = stringResource(R.string.pref_invalidate_download_cache_summary), subtitle = stringResource(MR.strings.pref_invalidate_download_cache_summary),
onClick = { onClick = {
Injekt.get<DownloadCache>().invalidateCache() Injekt.get<DownloadCache>().invalidateCache()
context.toast(R.string.download_cache_invalidated) context.toast(MR.strings.download_cache_invalidated)
}, },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_clear_database), title = stringResource(MR.strings.pref_clear_database),
subtitle = stringResource(R.string.pref_clear_database_summary), subtitle = stringResource(MR.strings.pref_clear_database_summary),
onClick = { navigator.push(ClearDatabaseScreen()) }, onClick = { navigator.push(ClearDatabaseScreen()) },
), ),
), ),
@ -241,17 +243,17 @@ object SettingsAdvancedScreen : SearchableSettings {
val userAgent by userAgentPref.collectAsState() val userAgent by userAgentPref.collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.label_network), title = stringResource(MR.strings.label_network),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_clear_cookies), title = stringResource(MR.strings.pref_clear_cookies),
onClick = { onClick = {
networkHelper.cookieJar.removeAll() networkHelper.cookieJar.removeAll()
context.toast(R.string.cookies_cleared) context.toast(MR.strings.cookies_cleared)
}, },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_clear_webview_data), title = stringResource(MR.strings.pref_clear_webview_data),
onClick = { onClick = {
try { try {
WebView(context).run { WebView(context).run {
@ -265,18 +267,18 @@ object SettingsAdvancedScreen : SearchableSettings {
context.applicationInfo?.dataDir?.let { context.applicationInfo?.dataDir?.let {
File("$it/app_webview/").deleteRecursively() File("$it/app_webview/").deleteRecursively()
} }
context.toast(R.string.webview_data_deleted) context.toast(MR.strings.webview_data_deleted)
} catch (e: Throwable) { } catch (e: Throwable) {
logcat(LogPriority.ERROR, e) logcat(LogPriority.ERROR, e)
context.toast(R.string.cache_delete_error) context.toast(MR.strings.cache_delete_error)
} }
}, },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = networkPreferences.dohProvider(), pref = networkPreferences.dohProvider(),
title = stringResource(R.string.pref_dns_over_https), title = stringResource(MR.strings.pref_dns_over_https),
entries = mapOf( entries = mapOf(
-1 to stringResource(R.string.disabled), -1 to stringResource(MR.strings.disabled),
PREF_DOH_CLOUDFLARE to "Cloudflare", PREF_DOH_CLOUDFLARE to "Cloudflare",
PREF_DOH_GOOGLE to "Google", PREF_DOH_GOOGLE to "Google",
PREF_DOH_ADGUARD to "AdGuard", PREF_DOH_ADGUARD to "AdGuard",
@ -291,30 +293,30 @@ object SettingsAdvancedScreen : SearchableSettings {
PREF_DOH_SHECAN to "Shecan", PREF_DOH_SHECAN to "Shecan",
), ),
onValueChanged = { onValueChanged = {
context.toast(R.string.requires_app_restart) context.toast(MR.strings.requires_app_restart)
true true
}, },
), ),
Preference.PreferenceItem.EditTextPreference( Preference.PreferenceItem.EditTextPreference(
pref = userAgentPref, pref = userAgentPref,
title = stringResource(R.string.pref_user_agent_string), title = stringResource(MR.strings.pref_user_agent_string),
onValueChanged = { onValueChanged = {
try { try {
// OkHttp checks for valid values internally // OkHttp checks for valid values internally
Headers.Builder().add("User-Agent", it) Headers.Builder().add("User-Agent", it)
} catch (_: IllegalArgumentException) { } catch (_: IllegalArgumentException) {
context.toast(R.string.error_user_agent_string_invalid) context.toast(MR.strings.error_user_agent_string_invalid)
return@EditTextPreference false return@EditTextPreference false
} }
true true
}, },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_reset_user_agent_string), title = stringResource(MR.strings.pref_reset_user_agent_string),
enabled = remember(userAgent) { userAgent != userAgentPref.defaultValue() }, enabled = remember(userAgent) { userAgent != userAgentPref.defaultValue() },
onClick = { onClick = {
userAgentPref.delete() userAgentPref.delete()
context.toast(R.string.requires_app_restart) context.toast(MR.strings.requires_app_restart)
}, },
), ),
), ),
@ -327,23 +329,23 @@ object SettingsAdvancedScreen : SearchableSettings {
val context = LocalContext.current val context = LocalContext.current
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.label_library), title = stringResource(MR.strings.label_library),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_refresh_library_covers), title = stringResource(MR.strings.pref_refresh_library_covers),
onClick = { LibraryUpdateJob.startNow(context, target = LibraryUpdateJob.Target.COVERS) }, onClick = { LibraryUpdateJob.startNow(context, target = LibraryUpdateJob.Target.COVERS) },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_reset_viewer_flags), title = stringResource(MR.strings.pref_reset_viewer_flags),
subtitle = stringResource(R.string.pref_reset_viewer_flags_summary), subtitle = stringResource(MR.strings.pref_reset_viewer_flags_summary),
onClick = { onClick = {
scope.launchNonCancellable { scope.launchNonCancellable {
val success = Injekt.get<ResetViewerFlags>().await() val success = Injekt.get<ResetViewerFlags>().await()
withUIContext { withUIContext {
val message = if (success) { val message = if (success) {
R.string.pref_reset_viewer_flags_success MR.strings.pref_reset_viewer_flags_success
} else { } else {
R.string.pref_reset_viewer_flags_error MR.strings.pref_reset_viewer_flags_error
} }
context.toast(message) context.toast(message)
} }
@ -367,11 +369,11 @@ object SettingsAdvancedScreen : SearchableSettings {
val dismiss = { shizukuMissing = false } val dismiss = { shizukuMissing = false }
AlertDialog( AlertDialog(
onDismissRequest = dismiss, onDismissRequest = dismiss,
title = { Text(text = stringResource(R.string.ext_installer_shizuku)) }, title = { Text(text = stringResource(MR.strings.ext_installer_shizuku)) },
text = { Text(text = stringResource(R.string.ext_installer_shizuku_unavailable_dialog)) }, text = { Text(text = stringResource(MR.strings.ext_installer_shizuku_unavailable_dialog)) },
dismissButton = { dismissButton = {
TextButton(onClick = dismiss) { TextButton(onClick = dismiss) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
confirmButton = { confirmButton = {
@ -381,19 +383,19 @@ object SettingsAdvancedScreen : SearchableSettings {
uriHandler.openUri("https://shizuku.rikka.app/download") uriHandler.openUri("https://shizuku.rikka.app/download")
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
} }
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.label_extensions), title = stringResource(MR.strings.label_extensions),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = extensionInstallerPref, pref = extensionInstallerPref,
title = stringResource(R.string.ext_installer_pref), title = stringResource(MR.strings.ext_installer_pref),
entries = extensionInstallerPref.entries entries = extensionInstallerPref.entries
.associateWith { stringResource(it.titleResId) }, .associateWith { stringResource(it.titleRes) },
onValueChanged = { onValueChanged = {
if (it == BasePreferences.ExtensionInstaller.SHIZUKU && if (it == BasePreferences.ExtensionInstaller.SHIZUKU &&
!context.isShizukuInstalled !context.isShizukuInstalled
@ -422,7 +424,7 @@ object SettingsAdvancedScreen : SearchableSettings {
} }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.clean_up_downloaded_chapters)) }, title = { Text(text = stringResource(SYMR.strings.clean_up_downloaded_chapters)) },
text = { text = {
LazyColumn { LazyColumn {
options.forEachIndexed { index, option -> options.forEachIndexed { index, option ->
@ -452,12 +454,12 @@ object SettingsAdvancedScreen : SearchableSettings {
onCleanupDownloads(removeRead, removeNonFavorite) onCleanupDownloads(removeRead, removeNonFavorite)
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -474,7 +476,7 @@ object SettingsAdvancedScreen : SearchableSettings {
onCleanupDownloads = { removeRead, removeNonFavorite -> onCleanupDownloads = { removeRead, removeNonFavorite ->
dialogOpen = false dialogOpen = false
if (job?.isActive == true) return@CleanupDownloadsDialog if (job?.isActive == true) return@CleanupDownloadsDialog
context.toast(R.string.starting_cleanup) context.toast(SYMR.strings.starting_cleanup)
job = scope.launchNonCancellable { job = scope.launchNonCancellable {
val mangaList = Injekt.get<GetAllManga>().await() val mangaList = Injekt.get<GetAllManga>().await()
val downloadManager: DownloadManager = Injekt.get() val downloadManager: DownloadManager = Injekt.get()
@ -514,10 +516,10 @@ object SettingsAdvancedScreen : SearchableSettings {
withUIContext { withUIContext {
val cleanupString = val cleanupString =
if (foldersCleared == 0) { if (foldersCleared == 0) {
context.getString(R.string.no_folders_to_cleanup) context.stringResource(SYMR.strings.no_folders_to_cleanup)
} else { } else {
context.resources!!.getQuantityString( context.pluralStringResource(
R.plurals.cleanup_done, SYMR.plurals.cleanup_done,
foldersCleared, foldersCleared,
foldersCleared, foldersCleared,
) )
@ -529,11 +531,11 @@ object SettingsAdvancedScreen : SearchableSettings {
) )
} }
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.download_notifier_downloader_title), title = stringResource(MR.strings.download_notifier_downloader_title),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.clean_up_downloaded_chapters), title = stringResource(SYMR.strings.clean_up_downloaded_chapters),
subtitle = stringResource(R.string.delete_unused_chapters), subtitle = stringResource(SYMR.strings.delete_unused_chapters),
onClick = { dialogOpen = true }, onClick = { dialogOpen = true },
), ),
), ),
@ -545,43 +547,43 @@ object SettingsAdvancedScreen : SearchableSettings {
val sourcePreferences = remember { Injekt.get<SourcePreferences>() } val sourcePreferences = remember { Injekt.get<SourcePreferences>() }
val dataSaver by sourcePreferences.dataSaver().collectAsState() val dataSaver by sourcePreferences.dataSaver().collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.data_saver), title = stringResource(SYMR.strings.data_saver),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = sourcePreferences.dataSaver(), pref = sourcePreferences.dataSaver(),
title = stringResource(R.string.data_saver), title = stringResource(SYMR.strings.data_saver),
subtitle = stringResource(R.string.data_saver_summary), subtitle = stringResource(SYMR.strings.data_saver_summary),
entries = mapOf( entries = mapOf(
DataSaver.NONE to stringResource(R.string.disabled), DataSaver.NONE to stringResource(MR.strings.disabled),
DataSaver.BANDWIDTH_HERO to stringResource(R.string.bandwidth_hero), DataSaver.BANDWIDTH_HERO to stringResource(SYMR.strings.bandwidth_hero),
DataSaver.WSRV_NL to stringResource(R.string.wsrv), DataSaver.WSRV_NL to stringResource(SYMR.strings.wsrv),
), ),
), ),
Preference.PreferenceItem.EditTextPreference( Preference.PreferenceItem.EditTextPreference(
pref = sourcePreferences.dataSaverServer(), pref = sourcePreferences.dataSaverServer(),
title = stringResource(R.string.bandwidth_data_saver_server), title = stringResource(SYMR.strings.bandwidth_data_saver_server),
subtitle = stringResource(R.string.data_saver_server_summary), subtitle = stringResource(SYMR.strings.data_saver_server_summary),
enabled = dataSaver == DataSaver.BANDWIDTH_HERO, enabled = dataSaver == DataSaver.BANDWIDTH_HERO,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.dataSaverDownloader(), pref = sourcePreferences.dataSaverDownloader(),
title = stringResource(R.string.data_saver_downloader), title = stringResource(SYMR.strings.data_saver_downloader),
enabled = dataSaver != DataSaver.NONE, enabled = dataSaver != DataSaver.NONE,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.dataSaverIgnoreJpeg(), pref = sourcePreferences.dataSaverIgnoreJpeg(),
title = stringResource(R.string.data_saver_ignore_jpeg), title = stringResource(SYMR.strings.data_saver_ignore_jpeg),
enabled = dataSaver != DataSaver.NONE, enabled = dataSaver != DataSaver.NONE,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.dataSaverIgnoreGif(), pref = sourcePreferences.dataSaverIgnoreGif(),
title = stringResource(R.string.data_saver_ignore_gif), title = stringResource(SYMR.strings.data_saver_ignore_gif),
enabled = dataSaver != DataSaver.NONE, enabled = dataSaver != DataSaver.NONE,
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = sourcePreferences.dataSaverImageQuality(), pref = sourcePreferences.dataSaverImageQuality(),
title = stringResource(R.string.data_saver_image_quality), title = stringResource(SYMR.strings.data_saver_image_quality),
subtitle = stringResource(R.string.data_saver_image_quality_summary), subtitle = stringResource(SYMR.strings.data_saver_image_quality_summary),
entries = listOf( entries = listOf(
"10%", "10%",
"20%", "20%",
@ -599,18 +601,18 @@ object SettingsAdvancedScreen : SearchableSettings {
.collectAsState() .collectAsState()
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.dataSaverImageFormatJpeg(), pref = sourcePreferences.dataSaverImageFormatJpeg(),
title = stringResource(R.string.data_saver_image_format), title = stringResource(SYMR.strings.data_saver_image_format),
subtitle = if (dataSaverImageFormatJpeg) { subtitle = if (dataSaverImageFormatJpeg) {
stringResource(R.string.data_saver_image_format_summary_on) stringResource(SYMR.strings.data_saver_image_format_summary_on)
} else { } else {
stringResource(R.string.data_saver_image_format_summary_off) stringResource(SYMR.strings.data_saver_image_format_summary_off)
}, },
enabled = dataSaver != DataSaver.NONE, enabled = dataSaver != DataSaver.NONE,
) )
}, },
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.dataSaverColorBW(), pref = sourcePreferences.dataSaverColorBW(),
title = stringResource(R.string.data_saver_color_bw), title = stringResource(SYMR.strings.data_saver_color_bw),
enabled = dataSaver == DataSaver.BANDWIDTH_HERO, enabled = dataSaver == DataSaver.BANDWIDTH_HERO,
), ),
), ),
@ -626,12 +628,12 @@ object SettingsAdvancedScreen : SearchableSettings {
val delegateSourcePreferences = remember { Injekt.get<DelegateSourcePreferences>() } val delegateSourcePreferences = remember { Injekt.get<DelegateSourcePreferences>() }
val securityPreferences = remember { Injekt.get<SecurityPreferences>() } val securityPreferences = remember { Injekt.get<SecurityPreferences>() }
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.developer_tools), title = stringResource(SYMR.strings.developer_tools),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.isHentaiEnabled(), pref = unsortedPreferences.isHentaiEnabled(),
title = stringResource(R.string.toggle_hentai_features), title = stringResource(SYMR.strings.toggle_hentai_features),
subtitle = stringResource(R.string.toggle_hentai_features_summary), subtitle = stringResource(SYMR.strings.toggle_hentai_features_summary),
onValueChanged = { onValueChanged = {
if (it) { if (it) {
BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID BlacklistedSources.HIDDEN_SOURCES += EH_SOURCE_ID
@ -645,30 +647,30 @@ object SettingsAdvancedScreen : SearchableSettings {
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = delegateSourcePreferences.delegateSources(), pref = delegateSourcePreferences.delegateSources(),
title = stringResource(R.string.toggle_delegated_sources), title = stringResource(SYMR.strings.toggle_delegated_sources),
subtitle = stringResource( subtitle = stringResource(
R.string.toggle_delegated_sources_summary, SYMR.strings.toggle_delegated_sources_summary,
stringResource(R.string.app_name), stringResource(MR.strings.app_name),
AndroidSourceManager.DELEGATED_SOURCES.values.map { it.sourceName }.distinct() AndroidSourceManager.DELEGATED_SOURCES.values.map { it.sourceName }.distinct()
.joinToString(), .joinToString(),
), ),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = unsortedPreferences.logLevel(), pref = unsortedPreferences.logLevel(),
title = stringResource(R.string.log_level), title = stringResource(SYMR.strings.log_level),
subtitle = stringResource(R.string.log_level_summary), subtitle = stringResource(SYMR.strings.log_level_summary),
entries = EHLogLevel.values().mapIndexed { index, ehLogLevel -> entries = EHLogLevel.values().mapIndexed { index, ehLogLevel ->
index to "${context.getString(ehLogLevel.nameRes)} (${ index to "${context.stringResource(ehLogLevel.nameRes)} (${
context.getString(ehLogLevel.description) context.stringResource(ehLogLevel.description)
})" })"
}.toMap(), }.toMap(),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.enableSourceBlacklist(), pref = sourcePreferences.enableSourceBlacklist(),
title = stringResource(R.string.enable_source_blacklist), title = stringResource(SYMR.strings.enable_source_blacklist),
subtitle = stringResource( subtitle = stringResource(
R.string.enable_source_blacklist_summary, SYMR.strings.enable_source_blacklist_summary,
stringResource(R.string.app_name), stringResource(MR.strings.app_name),
), ),
), ),
kotlin.run { kotlin.run {
@ -678,20 +680,20 @@ object SettingsAdvancedScreen : SearchableSettings {
val dismiss = { enableEncryptDatabase = false } val dismiss = { enableEncryptDatabase = false }
AlertDialog( AlertDialog(
onDismissRequest = dismiss, onDismissRequest = dismiss,
title = { Text(text = stringResource(R.string.encrypt_database)) }, title = { Text(text = stringResource(SYMR.strings.encrypt_database)) },
text = { text = {
Text( Text(
text = remember { text = remember {
HtmlCompat.fromHtml( HtmlCompat.fromHtml(
context.getString(R.string.encrypt_database_message), context.stringResource(SYMR.strings.encrypt_database_message),
HtmlCompat.FROM_HTML_MODE_COMPACT HtmlCompat.FROM_HTML_MODE_COMPACT,
).toAnnotatedString() ).toAnnotatedString()
}, },
) )
}, },
dismissButton = { dismissButton = {
TextButton(onClick = dismiss) { TextButton(onClick = dismiss) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
confirmButton = { confirmButton = {
@ -701,15 +703,15 @@ object SettingsAdvancedScreen : SearchableSettings {
securityPreferences.encryptDatabase().set(true) securityPreferences.encryptDatabase().set(true)
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
} }
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
title = stringResource(R.string.encrypt_database), title = stringResource(SYMR.strings.encrypt_database),
pref = securityPreferences.encryptDatabase(), pref = securityPreferences.encryptDatabase(),
subtitle = stringResource(R.string.encrypt_database_subtitle), subtitle = stringResource(SYMR.strings.encrypt_database_subtitle),
onValueChanged = { onValueChanged = {
if (it) { if (it) {
enableEncryptDatabase = true enableEncryptDatabase = true
@ -721,11 +723,11 @@ object SettingsAdvancedScreen : SearchableSettings {
) )
}, },
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.open_debug_menu), title = stringResource(SYMR.strings.open_debug_menu),
subtitle = remember { subtitle = remember {
HtmlCompat.fromHtml( HtmlCompat.fromHtml(
context.getString(R.string.open_debug_menu_summary), context.stringResource(SYMR.strings.open_debug_menu_summary),
HtmlCompat.FROM_HTML_MODE_COMPACT HtmlCompat.FROM_HTML_MODE_COMPACT,
).toAnnotatedString() ).toAnnotatedString()
}, },
onClick = { navigator.push(SettingsDebugScreen()) }, onClick = { navigator.push(SettingsDebugScreen()) },

View File

@ -29,6 +29,7 @@ import kotlinx.coroutines.flow.merge
import org.xmlpull.v1.XmlPullParser import org.xmlpull.v1.XmlPullParser
import tachiyomi.core.i18n.stringResource import tachiyomi.core.i18n.stringResource
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -214,21 +215,21 @@ object SettingsAppearanceScreen : SearchableSettings {
@Composable @Composable
fun getForkGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup { fun getForkGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
stringResource(R.string.pref_category_fork), stringResource(SYMR.strings.pref_category_fork),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.expandFilters(), pref = uiPreferences.expandFilters(),
title = stringResource(R.string.toggle_expand_search_filters), title = stringResource(SYMR.strings.toggle_expand_search_filters),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.recommendsInOverflow(), pref = uiPreferences.recommendsInOverflow(),
title = stringResource(R.string.put_recommends_in_overflow), title = stringResource(SYMR.strings.put_recommends_in_overflow),
subtitle = stringResource(R.string.put_recommends_in_overflow_summary), subtitle = stringResource(SYMR.strings.put_recommends_in_overflow_summary),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.mergeInOverflow(), pref = uiPreferences.mergeInOverflow(),
title = stringResource(R.string.put_merge_in_overflow), title = stringResource(SYMR.strings.put_merge_in_overflow),
subtitle = stringResource(R.string.put_merge_in_overflow_summary), subtitle = stringResource(SYMR.strings.put_merge_in_overflow_summary),
), ),
), ),
) )
@ -237,19 +238,19 @@ object SettingsAppearanceScreen : SearchableSettings {
@Composable @Composable
fun getNavbarGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup { fun getNavbarGroup(uiPreferences: UiPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
stringResource(R.string.pref_category_navbar), stringResource(SYMR.strings.pref_category_navbar),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.showNavUpdates(), pref = uiPreferences.showNavUpdates(),
title = stringResource(R.string.pref_hide_updates_button), title = stringResource(SYMR.strings.pref_hide_updates_button),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.showNavHistory(), pref = uiPreferences.showNavHistory(),
title = stringResource(R.string.pref_hide_history_button), title = stringResource(SYMR.strings.pref_hide_history_button),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.bottomBarLabels(), pref = uiPreferences.bottomBarLabels(),
title = stringResource(R.string.pref_show_bottom_bar_labels), title = stringResource(SYMR.strings.pref_show_bottom_bar_labels),
), ),
), ),
) )

View File

@ -1,24 +1,25 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import androidx.annotation.StringRes
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.domain.ui.UiPreferences import eu.kanade.domain.ui.UiPreferences
import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.Preference
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.category.repos.RepoScreen import eu.kanade.tachiyomi.ui.category.repos.RepoScreen
import eu.kanade.tachiyomi.ui.category.sources.SourceCategoryScreen import eu.kanade.tachiyomi.ui.category.sources.SourceCategoryScreen
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate
import tachiyomi.core.i18n.stringResource
import tachiyomi.domain.UnsortedPreferences import tachiyomi.domain.UnsortedPreferences
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -27,8 +28,7 @@ object SettingsBrowseScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = MR.strings.browse
override fun getTitleRes() = R.string.browse
@Composable @Composable
override fun getPreferences(): List<Preference> { override fun getPreferences(): List<Preference> {
@ -41,14 +41,14 @@ object SettingsBrowseScreen : SearchableSettings {
return listOf( return listOf(
// SY --> // SY -->
Preference.PreferenceGroup( Preference.PreferenceGroup(
title = stringResource(R.string.label_sources), title = stringResource(MR.strings.label_sources),
preferenceItems = listOf( preferenceItems = listOf(
kotlin.run { kotlin.run {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
val count by sourcePreferences.sourcesTabCategories().collectAsState() val count by sourcePreferences.sourcesTabCategories().collectAsState()
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.action_edit_categories), title = stringResource(MR.strings.action_edit_categories),
subtitle = pluralStringResource(R.plurals.num_categories, count.size, count.size), subtitle = pluralStringResource(MR.plurals.num_categories, count.size, count.size),
onClick = { onClick = {
navigator.push(SourceCategoryScreen()) navigator.push(SourceCategoryScreen())
}, },
@ -56,40 +56,40 @@ object SettingsBrowseScreen : SearchableSettings {
}, },
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.sourcesTabCategoriesFilter(), pref = sourcePreferences.sourcesTabCategoriesFilter(),
title = stringResource(R.string.pref_source_source_filtering), title = stringResource(SYMR.strings.pref_source_source_filtering),
subtitle = stringResource(R.string.pref_source_source_filtering_summery), subtitle = stringResource(SYMR.strings.pref_source_source_filtering_summery),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.useNewSourceNavigation(), pref = uiPreferences.useNewSourceNavigation(),
title = stringResource(R.string.pref_source_navigation), title = stringResource(SYMR.strings.pref_source_navigation),
subtitle = stringResource(R.string.pref_source_navigation_summery), subtitle = stringResource(SYMR.strings.pref_source_navigation_summery),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.allowLocalSourceHiddenFolders(), pref = unsortedPreferences.allowLocalSourceHiddenFolders(),
title = stringResource(R.string.pref_local_source_hidden_folders), title = stringResource(SYMR.strings.pref_local_source_hidden_folders),
subtitle = stringResource(R.string.pref_local_source_hidden_folders_summery), subtitle = stringResource(SYMR.strings.pref_local_source_hidden_folders_summery),
), ),
), ),
), ),
Preference.PreferenceGroup( Preference.PreferenceGroup(
title = stringResource(R.string.feed), title = stringResource(SYMR.strings.feed),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = uiPreferences.feedTabInFront(), pref = uiPreferences.feedTabInFront(),
title = stringResource(R.string.pref_feed_position), title = stringResource(SYMR.strings.pref_feed_position),
subtitle = stringResource(R.string.pref_feed_position_summery), subtitle = stringResource(SYMR.strings.pref_feed_position_summery),
), ),
), ),
), ),
Preference.PreferenceGroup( Preference.PreferenceGroup(
title = stringResource(R.string.label_extensions), title = stringResource(MR.strings.label_extensions),
preferenceItems = listOf( preferenceItems = listOf(
kotlin.run { kotlin.run {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
val count by unsortedPreferences.extensionRepos().collectAsState() val count by unsortedPreferences.extensionRepos().collectAsState()
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.action_edit_repos), title = stringResource(SYMR.strings.action_edit_repos),
subtitle = pluralStringResource(R.plurals.num_repos, count.size, count.size), subtitle = pluralStringResource(SYMR.plurals.num_repos, count.size, count.size),
onClick = { onClick = {
navigator.push(RepoScreen()) navigator.push(RepoScreen())
}, },
@ -99,28 +99,28 @@ object SettingsBrowseScreen : SearchableSettings {
), ),
// SY <-- // SY <--
Preference.PreferenceGroup( Preference.PreferenceGroup(
title = stringResource(R.string.label_sources), title = stringResource(MR.strings.label_sources),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.hideInLibraryItems(), pref = sourcePreferences.hideInLibraryItems(),
title = stringResource(R.string.pref_hide_in_library_items), title = stringResource(MR.strings.pref_hide_in_library_items),
), ),
), ),
), ),
Preference.PreferenceGroup( Preference.PreferenceGroup(
title = stringResource(R.string.pref_category_nsfw_content), title = stringResource(MR.strings.pref_category_nsfw_content),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = sourcePreferences.showNsfwSource(), pref = sourcePreferences.showNsfwSource(),
title = stringResource(R.string.pref_show_nsfw_source), title = stringResource(MR.strings.pref_show_nsfw_source),
subtitle = stringResource(R.string.requires_app_restart), subtitle = stringResource(MR.strings.requires_app_restart),
onValueChanged = { onValueChanged = {
(context as FragmentActivity).authenticate( (context as FragmentActivity).authenticate(
title = context.getString(R.string.pref_category_nsfw_content), title = context.stringResource(MR.strings.pref_category_nsfw_content),
) )
}, },
), ),
Preference.PreferenceItem.InfoPreference(stringResource(R.string.parental_controls_info)), Preference.PreferenceItem.InfoPreference(stringResource(MR.strings.parental_controls_info)),
), ),
), ),
) )

View File

@ -51,6 +51,7 @@ import tachiyomi.core.util.system.logcat
import tachiyomi.domain.backup.service.BackupPreferences import tachiyomi.domain.backup.service.BackupPreferences
import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.library.service.LibraryPreferences
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -292,19 +293,19 @@ object SettingsDataScreen : SearchableSettings {
), ),
// SY --> // SY -->
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_clear_page_preview_cache), title = stringResource(SYMR.strings.pref_clear_page_preview_cache),
subtitle = stringResource(R.string.used_cache, pagePreviewReadableSize), subtitle = stringResource(MR.strings.used_cache, pagePreviewReadableSize),
onClick = { onClick = {
scope.launchNonCancellable { scope.launchNonCancellable {
try { try {
val deletedFiles = pagePreviewCache.clear() val deletedFiles = pagePreviewCache.clear()
withUIContext { withUIContext {
context.toast(context.getString(R.string.cache_deleted, deletedFiles)) context.toast(context.stringResource(MR.strings.cache_deleted, deletedFiles))
pagePreviewReadableSizeSema++ pagePreviewReadableSizeSema++
} }
} catch (e: Throwable) { } catch (e: Throwable) {
logcat(LogPriority.ERROR, e) logcat(LogPriority.ERROR, e)
withUIContext { context.toast(R.string.cache_delete_error) } withUIContext { context.toast(MR.strings.cache_delete_error) }
} }
} }
}, },

View File

@ -5,7 +5,6 @@ import android.content.Context
import android.widget.Toast import android.widget.Toast
import androidx.activity.compose.rememberLauncherForActivityResult import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts import androidx.activity.result.contract.ActivityResultContracts
import androidx.annotation.StringRes
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
@ -41,14 +40,12 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import androidx.core.content.ContextCompat.startActivity import androidx.core.content.ContextCompat.startActivity
import eu.kanade.presentation.library.components.SyncFavoritesWarningDialog import eu.kanade.presentation.library.components.SyncFavoritesWarningDialog
import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.Preference
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.webview.WebViewActivity import eu.kanade.tachiyomi.ui.webview.WebViewActivity
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import exh.eh.EHentaiUpdateWorker import exh.eh.EHentaiUpdateWorker
@ -59,6 +56,8 @@ import exh.ui.login.EhLoginActivity
import exh.util.nullIfBlank import exh.util.nullIfBlank
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import logcat.LogPriority import logcat.LogPriority
import tachiyomi.core.i18n.pluralStringResource
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchNonCancellable import tachiyomi.core.util.lang.launchNonCancellable
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.lang.withUIContext
@ -69,6 +68,9 @@ import tachiyomi.domain.library.service.LibraryPreferences.Companion.DEVICE_ONLY
import tachiyomi.domain.manga.interactor.DeleteFavoriteEntries import tachiyomi.domain.manga.interactor.DeleteFavoriteEntries
import tachiyomi.domain.manga.interactor.GetExhFavoriteMangaWithMetadata import tachiyomi.domain.manga.interactor.GetExhFavoriteMangaWithMetadata
import tachiyomi.domain.manga.interactor.GetFlatMetadataById import tachiyomi.domain.manga.interactor.GetFlatMetadataById
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -83,8 +85,7 @@ object SettingsEhScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = SYMR.strings.pref_category_eh
override fun getTitleRes() = R.string.pref_category_eh
override fun isEnabled(): Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get() override fun isEnabled(): Boolean = Injekt.get<UnsortedPreferences>().isHentaiEnabled().get()
@ -136,7 +137,7 @@ object SettingsEhScreen : SearchableSettings {
return listOf( return listOf(
Preference.PreferenceGroup( Preference.PreferenceGroup(
stringResource(R.string.ehentai_prefs_account_settings), stringResource(SYMR.strings.ehentai_prefs_account_settings),
preferenceItems = listOf( preferenceItems = listOf(
getLoginPreference(unsortedPreferences, openWarnConfigureDialogController), getLoginPreference(unsortedPreferences, openWarnConfigureDialogController),
useHentaiAtHome(exhentaiEnabled, unsortedPreferences), useHentaiAtHome(exhentaiEnabled, unsortedPreferences),
@ -153,7 +154,7 @@ object SettingsEhScreen : SearchableSettings {
), ),
), ),
Preference.PreferenceGroup( Preference.PreferenceGroup(
stringResource(R.string.favorites_sync), stringResource(SYMR.strings.favorites_sync),
preferenceItems = listOf( preferenceItems = listOf(
readOnlySync(unsortedPreferences), readOnlySync(unsortedPreferences),
syncFavoriteNotes(), syncFavoriteNotes(),
@ -162,7 +163,7 @@ object SettingsEhScreen : SearchableSettings {
), ),
), ),
Preference.PreferenceGroup( Preference.PreferenceGroup(
stringResource(R.string.gallery_update_checker), stringResource(SYMR.strings.gallery_update_checker),
preferenceItems = listOf( preferenceItems = listOf(
updateCheckerFrequency(unsortedPreferences), updateCheckerFrequency(unsortedPreferences),
autoUpdateRequirements(unsortedPreferences), autoUpdateRequirements(unsortedPreferences),
@ -192,9 +193,9 @@ object SettingsEhScreen : SearchableSettings {
val value by unsortedPreferences.enableExhentai().collectAsState() val value by unsortedPreferences.enableExhentai().collectAsState()
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.enableExhentai(), pref = unsortedPreferences.enableExhentai(),
title = stringResource(R.string.enable_exhentai), title = stringResource(SYMR.strings.enable_exhentai),
subtitle = if (!value) { subtitle = if (!value) {
stringResource(R.string.requires_login) stringResource(SYMR.strings.requires_login)
} else { } else {
null null
}, },
@ -217,11 +218,11 @@ object SettingsEhScreen : SearchableSettings {
): Preference.PreferenceItem.ListPreference<Int> { ): Preference.PreferenceItem.ListPreference<Int> {
return Preference.PreferenceItem.ListPreference( return Preference.PreferenceItem.ListPreference(
pref = unsortedPreferences.useHentaiAtHome(), pref = unsortedPreferences.useHentaiAtHome(),
title = stringResource(R.string.use_hentai_at_home), title = stringResource(SYMR.strings.use_hentai_at_home),
subtitle = stringResource(R.string.use_hentai_at_home_summary), subtitle = stringResource(SYMR.strings.use_hentai_at_home_summary),
entries = mapOf( entries = mapOf(
0 to stringResource(R.string.use_hentai_at_home_option_1), 0 to stringResource(SYMR.strings.use_hentai_at_home_option_1),
1 to stringResource(R.string.use_hentai_at_home_option_2), 1 to stringResource(SYMR.strings.use_hentai_at_home_option_2),
), ),
enabled = exhentaiEnabled, enabled = exhentaiEnabled,
) )
@ -235,11 +236,11 @@ object SettingsEhScreen : SearchableSettings {
val value by unsortedPreferences.useJapaneseTitle().collectAsState() val value by unsortedPreferences.useJapaneseTitle().collectAsState()
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.useJapaneseTitle(), pref = unsortedPreferences.useJapaneseTitle(),
title = stringResource(R.string.show_japanese_titles), title = stringResource(SYMR.strings.show_japanese_titles),
subtitle = if (value) { subtitle = if (value) {
stringResource(R.string.show_japanese_titles_option_1) stringResource(SYMR.strings.show_japanese_titles_option_1)
} else { } else {
stringResource(R.string.show_japanese_titles_option_2) stringResource(SYMR.strings.show_japanese_titles_option_2)
}, },
enabled = exhentaiEnabled, enabled = exhentaiEnabled,
) )
@ -253,11 +254,11 @@ object SettingsEhScreen : SearchableSettings {
val value by unsortedPreferences.exhUseOriginalImages().collectAsState() val value by unsortedPreferences.exhUseOriginalImages().collectAsState()
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.exhUseOriginalImages(), pref = unsortedPreferences.exhUseOriginalImages(),
title = stringResource(R.string.use_original_images), title = stringResource(SYMR.strings.use_original_images),
subtitle = if (value) { subtitle = if (value) {
stringResource(R.string.use_original_images_on) stringResource(SYMR.strings.use_original_images_on)
} else { } else {
stringResource(R.string.use_original_images_off) stringResource(SYMR.strings.use_original_images_off)
}, },
enabled = exhentaiEnabled, enabled = exhentaiEnabled,
) )
@ -267,15 +268,15 @@ object SettingsEhScreen : SearchableSettings {
fun watchedTags(exhentaiEnabled: Boolean): Preference.PreferenceItem.TextPreference { fun watchedTags(exhentaiEnabled: Boolean): Preference.PreferenceItem.TextPreference {
val context = LocalContext.current val context = LocalContext.current
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.watched_tags), title = stringResource(SYMR.strings.watched_tags),
subtitle = stringResource(R.string.watched_tags_summary), subtitle = stringResource(SYMR.strings.watched_tags_summary),
onClick = { onClick = {
startActivity( startActivity(
context, context,
WebViewActivity.newIntent( WebViewActivity.newIntent(
context, context,
url = "https://exhentai.org/mytags", url = "https://exhentai.org/mytags",
title = context.getString(R.string.watched_tags_exh), title = context.stringResource(SYMR.strings.watched_tags_exh),
), ),
null, null,
) )
@ -304,12 +305,12 @@ object SettingsEhScreen : SearchableSettings {
onClick = { onValueChange(value.toIntOrNull() ?: return@TextButton) }, onClick = { onValueChange(value.toIntOrNull() ?: return@TextButton) },
enabled = isValid, enabled = isValid,
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
@ -357,10 +358,10 @@ object SettingsEhScreen : SearchableSettings {
if (dialogOpen) { if (dialogOpen) {
TagThresholdDialog( TagThresholdDialog(
onDismissRequest = { dialogOpen = false }, onDismissRequest = { dialogOpen = false },
title = stringResource(R.string.tag_filtering_threshold), title = stringResource(SYMR.strings.tag_filtering_threshold),
initialValue = value, initialValue = value,
valueRange = -9999..0, valueRange = -9999..0,
outsideRangeError = stringResource(R.string.tag_filtering_threshhold_error), outsideRangeError = stringResource(SYMR.strings.tag_filtering_threshhold_error),
onValueChange = { onValueChange = {
dialogOpen = false dialogOpen = false
unsortedPreferences.ehTagFilterValue().set(it) unsortedPreferences.ehTagFilterValue().set(it)
@ -368,8 +369,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.tag_filtering_threshold), title = stringResource(SYMR.strings.tag_filtering_threshold),
subtitle = stringResource(R.string.tag_filtering_threshhold_summary, value), subtitle = stringResource(SYMR.strings.tag_filtering_threshhold_summary, value),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
@ -387,10 +388,10 @@ object SettingsEhScreen : SearchableSettings {
if (dialogOpen) { if (dialogOpen) {
TagThresholdDialog( TagThresholdDialog(
onDismissRequest = { dialogOpen = false }, onDismissRequest = { dialogOpen = false },
title = stringResource(R.string.tag_watching_threshhold), title = stringResource(SYMR.strings.tag_watching_threshhold),
initialValue = value, initialValue = value,
valueRange = 0..9999, valueRange = 0..9999,
outsideRangeError = stringResource(R.string.tag_watching_threshhold_error), outsideRangeError = stringResource(SYMR.strings.tag_watching_threshhold_error),
onValueChange = { onValueChange = {
dialogOpen = false dialogOpen = false
unsortedPreferences.ehTagWatchingValue().set(it) unsortedPreferences.ehTagWatchingValue().set(it)
@ -398,8 +399,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.tag_watching_threshhold), title = stringResource(SYMR.strings.tag_watching_threshhold),
subtitle = stringResource(R.string.tag_watching_threshhold_summary, value), subtitle = stringResource(SYMR.strings.tag_watching_threshhold_summary, value),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
@ -549,14 +550,14 @@ object SettingsEhScreen : SearchableSettings {
val state = remember(initialValue) { LanguageDialogState(initialValue) } val state = remember(initialValue) { LanguageDialogState(initialValue) }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(stringResource(R.string.language_filtering)) }, title = { Text(stringResource(SYMR.strings.language_filtering)) },
text = { text = {
Column( Column(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
Text(stringResource(R.string.language_filtering_summary)) Text(stringResource(SYMR.strings.language_filtering_summary))
Row( Row(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -589,12 +590,12 @@ object SettingsEhScreen : SearchableSettings {
}, },
confirmButton = { confirmButton = {
TextButton(onClick = { onValueChange(state.toPreference()) }) { TextButton(onClick = { onValueChange(state.toPreference()) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -618,8 +619,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.language_filtering), title = stringResource(SYMR.strings.language_filtering),
subtitle = stringResource(R.string.language_filtering_summary), subtitle = stringResource(SYMR.strings.language_filtering_summary),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
@ -684,14 +685,14 @@ object SettingsEhScreen : SearchableSettings {
val state = remember(initialValue) { FrontPageCategoriesDialogState(initialValue) } val state = remember(initialValue) { FrontPageCategoriesDialogState(initialValue) }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(stringResource(R.string.frong_page_categories)) }, title = { Text(stringResource(SYMR.strings.frong_page_categories)) },
text = { text = {
Column( Column(
Modifier Modifier
.fillMaxWidth() .fillMaxWidth()
.verticalScroll(rememberScrollState()), .verticalScroll(rememberScrollState()),
) { ) {
Text(stringResource(R.string.fromt_page_categories_summary)) Text(stringResource(SYMR.strings.fromt_page_categories_summary))
Row( Row(
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
@ -755,12 +756,12 @@ object SettingsEhScreen : SearchableSettings {
}, },
confirmButton = { confirmButton = {
TextButton(onClick = { onValueChange(state.toPreference()) }) { TextButton(onClick = { onValueChange(state.toPreference()) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -784,8 +785,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.frong_page_categories), title = stringResource(SYMR.strings.frong_page_categories),
subtitle = stringResource(R.string.fromt_page_categories_summary), subtitle = stringResource(SYMR.strings.fromt_page_categories_summary),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
@ -800,8 +801,8 @@ object SettingsEhScreen : SearchableSettings {
): Preference.PreferenceItem.SwitchPreference { ): Preference.PreferenceItem.SwitchPreference {
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.exhWatchedListDefaultState(), pref = unsortedPreferences.exhWatchedListDefaultState(),
title = stringResource(R.string.watched_list_default), title = stringResource(SYMR.strings.watched_list_default),
subtitle = stringResource(R.string.watched_list_state_summary), subtitle = stringResource(SYMR.strings.watched_list_state_summary),
enabled = exhentaiEnabled, enabled = exhentaiEnabled,
) )
} }
@ -813,15 +814,15 @@ object SettingsEhScreen : SearchableSettings {
): Preference.PreferenceItem.ListPreference<String> { ): Preference.PreferenceItem.ListPreference<String> {
return Preference.PreferenceItem.ListPreference( return Preference.PreferenceItem.ListPreference(
pref = unsortedPreferences.imageQuality(), pref = unsortedPreferences.imageQuality(),
title = stringResource(R.string.eh_image_quality_summary), title = stringResource(SYMR.strings.eh_image_quality_summary),
subtitle = stringResource(R.string.eh_image_quality), subtitle = stringResource(SYMR.strings.eh_image_quality),
entries = mapOf( entries = mapOf(
"auto" to stringResource(R.string.eh_image_quality_auto), "auto" to stringResource(SYMR.strings.eh_image_quality_auto),
"ovrs_2400" to stringResource(R.string.eh_image_quality_2400), "ovrs_2400" to stringResource(SYMR.strings.eh_image_quality_2400),
"ovrs_1600" to stringResource(R.string.eh_image_quality_1600), "ovrs_1600" to stringResource(SYMR.strings.eh_image_quality_1600),
"high" to stringResource(R.string.eh_image_quality_1280), "high" to stringResource(SYMR.strings.eh_image_quality_1280),
"med" to stringResource(R.string.eh_image_quality_980), "med" to stringResource(SYMR.strings.eh_image_quality_980),
"low" to stringResource(R.string.eh_image_quality_780), "low" to stringResource(SYMR.strings.eh_image_quality_780),
), ),
enabled = exhentaiEnabled, enabled = exhentaiEnabled,
) )
@ -831,8 +832,8 @@ object SettingsEhScreen : SearchableSettings {
fun enhancedEhentaiView(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference { fun enhancedEhentaiView(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference {
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.enhancedEHentaiView(), pref = unsortedPreferences.enhancedEHentaiView(),
title = stringResource(R.string.pref_enhanced_e_hentai_view), title = stringResource(SYMR.strings.pref_enhanced_e_hentai_view),
subtitle = stringResource(R.string.pref_enhanced_e_hentai_view_summary), subtitle = stringResource(SYMR.strings.pref_enhanced_e_hentai_view_summary),
) )
} }
@ -840,8 +841,8 @@ object SettingsEhScreen : SearchableSettings {
fun readOnlySync(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference { fun readOnlySync(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference {
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.exhReadOnlySync(), pref = unsortedPreferences.exhReadOnlySync(),
title = stringResource(R.string.disable_favorites_uploading), title = stringResource(SYMR.strings.disable_favorites_uploading),
subtitle = stringResource(R.string.disable_favorites_uploading_summary), subtitle = stringResource(SYMR.strings.disable_favorites_uploading_summary),
) )
} }
@ -855,8 +856,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.show_favorite_sync_notes), title = stringResource(SYMR.strings.show_favorite_sync_notes),
subtitle = stringResource(R.string.show_favorite_sync_notes_summary), subtitle = stringResource(SYMR.strings.show_favorite_sync_notes_summary),
onClick = { dialogOpen = true }, onClick = { dialogOpen = true },
) )
} }
@ -865,8 +866,8 @@ object SettingsEhScreen : SearchableSettings {
fun lenientSync(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference { fun lenientSync(unsortedPreferences: UnsortedPreferences): Preference.PreferenceItem.SwitchPreference {
return Preference.PreferenceItem.SwitchPreference( return Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.exhLenientSync(), pref = unsortedPreferences.exhLenientSync(),
title = stringResource(R.string.ignore_sync_errors), title = stringResource(SYMR.strings.ignore_sync_errors),
subtitle = stringResource(R.string.ignore_sync_errors_summary), subtitle = stringResource(SYMR.strings.ignore_sync_errors_summary),
) )
} }
@ -878,19 +879,19 @@ object SettingsEhScreen : SearchableSettings {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { title = {
Text(text = stringResource(R.string.favorites_sync_reset)) Text(text = stringResource(SYMR.strings.favorites_sync_reset))
}, },
text = { text = {
Text(text = stringResource(R.string.favorites_sync_reset_message)) Text(text = stringResource(SYMR.strings.favorites_sync_reset_message))
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onStartReset) { TextButton(onClick = onStartReset) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
properties = DialogProperties( properties = DialogProperties(
@ -914,7 +915,7 @@ object SettingsEhScreen : SearchableSettings {
try { try {
deleteFavoriteEntries.await() deleteFavoriteEntries.await()
withUIContext { withUIContext {
context.toast(context.getString(R.string.sync_state_reset), Toast.LENGTH_LONG) context.toast(context.stringResource(SYMR.strings.sync_state_reset), Toast.LENGTH_LONG)
} }
} catch (e: Exception) { } catch (e: Exception) {
this@SettingsEhScreen.logcat(LogPriority.ERROR, e) this@SettingsEhScreen.logcat(LogPriority.ERROR, e)
@ -924,8 +925,8 @@ object SettingsEhScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.force_sync_state_reset), title = stringResource(SYMR.strings.force_sync_state_reset),
subtitle = stringResource(R.string.force_sync_state_reset_summary), subtitle = stringResource(SYMR.strings.force_sync_state_reset_summary),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
@ -940,26 +941,26 @@ object SettingsEhScreen : SearchableSettings {
val context = LocalContext.current val context = LocalContext.current
return Preference.PreferenceItem.ListPreference( return Preference.PreferenceItem.ListPreference(
pref = unsortedPreferences.exhAutoUpdateFrequency(), pref = unsortedPreferences.exhAutoUpdateFrequency(),
title = stringResource(R.string.time_between_batches), title = stringResource(SYMR.strings.time_between_batches),
subtitle = if (value == 0) { subtitle = if (value == 0) {
stringResource(R.string.time_between_batches_summary_1, stringResource(R.string.app_name)) stringResource(SYMR.strings.time_between_batches_summary_1, stringResource(MR.strings.app_name))
} else { } else {
stringResource( stringResource(
R.string.time_between_batches_summary_2, SYMR.strings.time_between_batches_summary_2,
stringResource(R.string.app_name), stringResource(MR.strings.app_name),
value, value,
EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION, EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION,
) )
}, },
entries = mapOf( entries = mapOf(
0 to stringResource(R.string.time_between_batches_never), 0 to stringResource(SYMR.strings.time_between_batches_never),
1 to stringResource(R.string.time_between_batches_1_hour), 1 to stringResource(SYMR.strings.time_between_batches_1_hour),
2 to stringResource(R.string.time_between_batches_2_hours), 2 to stringResource(SYMR.strings.time_between_batches_2_hours),
3 to stringResource(R.string.time_between_batches_3_hours), 3 to stringResource(SYMR.strings.time_between_batches_3_hours),
6 to stringResource(R.string.time_between_batches_6_hours), 6 to stringResource(SYMR.strings.time_between_batches_6_hours),
12 to stringResource(R.string.time_between_batches_12_hours), 12 to stringResource(SYMR.strings.time_between_batches_12_hours),
24 to stringResource(R.string.time_between_batches_24_hours), 24 to stringResource(SYMR.strings.time_between_batches_24_hours),
48 to stringResource(R.string.time_between_batches_48_hours), 48 to stringResource(SYMR.strings.time_between_batches_48_hours),
), ),
onValueChanged = { interval -> onValueChanged = { interval ->
EHentaiUpdateWorker.scheduleBackground(context, prefInterval = interval) EHentaiUpdateWorker.scheduleBackground(context, prefInterval = interval)
@ -976,27 +977,27 @@ object SettingsEhScreen : SearchableSettings {
val context = LocalContext.current val context = LocalContext.current
return Preference.PreferenceItem.MultiSelectListPreference( return Preference.PreferenceItem.MultiSelectListPreference(
pref = unsortedPreferences.exhAutoUpdateRequirements(), pref = unsortedPreferences.exhAutoUpdateRequirements(),
title = stringResource(R.string.auto_update_restrictions), title = stringResource(SYMR.strings.auto_update_restrictions),
subtitle = remember(value) { subtitle = remember(value) {
context.getString( context.stringResource(
R.string.restrictions, MR.strings.restrictions,
value.sorted() value.sorted()
.map { .map {
when (it) { when (it) {
DEVICE_ONLY_ON_WIFI -> context.getString(R.string.connected_to_wifi) DEVICE_ONLY_ON_WIFI -> context.stringResource(MR.strings.connected_to_wifi)
DEVICE_CHARGING -> context.getString(R.string.charging) DEVICE_CHARGING -> context.stringResource(MR.strings.charging)
else -> it else -> it
} }
} }
.ifEmpty { .ifEmpty {
listOf(context.getString(R.string.none)) listOf(context.stringResource(MR.strings.none))
} }
.joinToString(), .joinToString(),
) )
}, },
entries = mapOf( entries = mapOf(
DEVICE_ONLY_ON_WIFI to stringResource(R.string.connected_to_wifi), DEVICE_ONLY_ON_WIFI to stringResource(MR.strings.connected_to_wifi),
DEVICE_CHARGING to stringResource(R.string.charging), DEVICE_CHARGING to stringResource(MR.strings.charging),
), ),
onValueChanged = { restrictions -> onValueChanged = { restrictions ->
EHentaiUpdateWorker.scheduleBackground(context, prefRestrictions = restrictions) EHentaiUpdateWorker.scheduleBackground(context, prefRestrictions = restrictions)
@ -1019,7 +1020,7 @@ object SettingsEhScreen : SearchableSettings {
shape = MaterialTheme.shapes.medium, shape = MaterialTheme.shapes.medium,
) { ) {
Text( Text(
text = stringResource(R.string.gallery_updater_statistics_collection), text = stringResource(SYMR.strings.gallery_updater_statistics_collection),
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
modifier = Modifier.padding(40.dp), modifier = Modifier.padding(40.dp),
) )
@ -1035,14 +1036,14 @@ object SettingsEhScreen : SearchableSettings {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { title = {
Text(text = stringResource(R.string.gallery_updater_statistics)) Text(text = stringResource(SYMR.strings.gallery_updater_statistics))
}, },
text = { text = {
Text(text = updateInfo) Text(text = updateInfo)
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
) )
@ -1109,20 +1110,20 @@ object SettingsEhScreen : SearchableSettings {
} }
private fun getRelativeTimeString(relativeTime: RelativeTime, context: Context): String { private fun getRelativeTimeString(relativeTime: RelativeTime, context: Context): String {
return relativeTime.years?.let { context.resources.getQuantityString(R.plurals.humanize_year, it.toInt(), it) } return relativeTime.years?.let { context.pluralStringResource(SYMR.plurals.humanize_year, it.toInt(), it) }
?: relativeTime.months?.let { ?: relativeTime.months?.let {
context.resources.getQuantityString(R.plurals.humanize_month, it.toInt(), it) context.pluralStringResource(SYMR.plurals.humanize_month, it.toInt(), it)
} }
?: relativeTime.weeks?.let { context.resources.getQuantityString(R.plurals.humanize_week, it.toInt(), it) } ?: relativeTime.weeks?.let { context.pluralStringResource(SYMR.plurals.humanize_week, it.toInt(), it) }
?: relativeTime.days?.let { context.resources.getQuantityString(R.plurals.humanize_day, it.toInt(), it) } ?: relativeTime.days?.let { context.pluralStringResource(SYMR.plurals.humanize_day, it.toInt(), it) }
?: relativeTime.hours?.let { context.resources.getQuantityString(R.plurals.humanize_hour, it.toInt(), it) } ?: relativeTime.hours?.let { context.pluralStringResource(SYMR.plurals.humanize_hour, it.toInt(), it) }
?: relativeTime.minutes?.let { ?: relativeTime.minutes?.let {
context.resources.getQuantityString(R.plurals.humanize_minute, it.toInt(), it) context.pluralStringResource(SYMR.plurals.humanize_minute, it.toInt(), it)
} }
?: relativeTime.seconds?.let { ?: relativeTime.seconds?.let {
context.resources.getQuantityString(R.plurals.humanize_second, it.toInt(), it) context.pluralStringResource(SYMR.plurals.humanize_second, it.toInt(), it)
} }
?: context.getString(R.string.humanize_fallback) ?: context.stringResource(SYMR.strings.humanize_fallback)
} }
data class RelativeTime( data class RelativeTime(
@ -1154,14 +1155,14 @@ object SettingsEhScreen : SearchableSettings {
} }
val statsText = if (stats != null) { val statsText = if (stats != null) {
context.getString( context.stringResource(
R.string.gallery_updater_stats_text, SYMR.strings.gallery_updater_stats_text,
getRelativeTimeString(getRelativeTimeFromNow(stats.startTime.milliseconds), context), getRelativeTimeString(getRelativeTimeFromNow(stats.startTime.milliseconds), context),
stats.updateCount, stats.updateCount,
stats.possibleUpdates, stats.possibleUpdates,
) )
} else { } else {
context.getString(R.string.gallery_updater_not_ran_yet) context.stringResource(SYMR.strings.gallery_updater_not_ran_yet)
} }
val allMeta = getExhFavoriteMangaWithMetadata.await() val allMeta = getExhFavoriteMangaWithMetadata.await()
@ -1177,8 +1178,8 @@ object SettingsEhScreen : SearchableSettings {
}.count() }.count()
} }
statsText + "\n\n" + context.getString( statsText + "\n\n" + context.stringResource(
R.string.gallery_updater_stats_time, SYMR.strings.gallery_updater_stats_time,
metaInRelativeDuration(1.hours), metaInRelativeDuration(1.hours),
metaInRelativeDuration(6.hours), metaInRelativeDuration(6.hours),
metaInRelativeDuration(12.hours), metaInRelativeDuration(12.hours),
@ -1204,7 +1205,7 @@ object SettingsEhScreen : SearchableSettings {
} }
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.show_updater_statistics), title = stringResource(SYMR.strings.show_updater_statistics),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },

View File

@ -1,6 +1,5 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import androidx.annotation.StringRes
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
@ -11,8 +10,6 @@ import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.util.fastMap import androidx.compose.ui.util.fastMap
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.LocalNavigator
@ -21,7 +18,6 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.category.visualName import eu.kanade.presentation.category.visualName
import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.Preference
import eu.kanade.presentation.more.settings.widget.TriStateListDialog import eu.kanade.presentation.more.settings.widget.TriStateListDialog
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.library.LibraryUpdateJob import eu.kanade.tachiyomi.data.library.LibraryUpdateJob
import eu.kanade.tachiyomi.ui.category.CategoryScreen import eu.kanade.tachiyomi.ui.category.CategoryScreen
import eu.kanade.tachiyomi.ui.category.genre.SortTagScreen import eu.kanade.tachiyomi.ui.category.genre.SortTagScreen
@ -40,6 +36,10 @@ import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_HAS_U
import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_NON_COMPLETED import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_NON_COMPLETED
import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_NON_READ import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_NON_READ
import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_OUTSIDE_RELEASE_PERIOD import tachiyomi.domain.library.service.LibraryPreferences.Companion.MANGA_OUTSIDE_RELEASE_PERIOD
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -48,15 +48,14 @@ object SettingsLibraryScreen : SearchableSettings {
@Composable @Composable
@ReadOnlyComposable @ReadOnlyComposable
@StringRes override fun getTitleRes() = MR.strings.pref_category_library
override fun getTitleRes() = R.string.pref_category_library
@Composable @Composable
override fun getPreferences(): List<Preference> { override fun getPreferences(): List<Preference> {
val getCategories = remember { Injekt.get<GetCategories>() } val getCategories = remember { Injekt.get<GetCategories>() }
val libraryPreferences = remember { Injekt.get<LibraryPreferences>() } val libraryPreferences = remember { Injekt.get<LibraryPreferences>() }
val allCategories by getCategories.subscribe().collectAsState( val allCategories by getCategories.subscribe().collectAsState(
initial = runBlocking { getCategories.await() } initial = runBlocking { getCategories.await() },
) )
// SY --> // SY -->
val unsortedPreferences = remember { Injekt.get<UnsortedPreferences>() } val unsortedPreferences = remember { Injekt.get<UnsortedPreferences>() }
@ -89,16 +88,16 @@ object SettingsLibraryScreen : SearchableSettings {
// For default category // For default category
val ids = listOf(libraryPreferences.defaultCategory().defaultValue()) + val ids = listOf(libraryPreferences.defaultCategory().defaultValue()) +
allCategories.fastMap { it.id.toInt() } allCategories.fastMap { it.id.toInt() }
val labels = listOf(stringResource(R.string.default_category_summary)) + val labels = listOf(stringResource(MR.strings.default_category_summary)) +
allCategories.fastMap { it.visualName(context) } allCategories.fastMap { it.visualName(context) }
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.categories), title = stringResource(MR.strings.categories),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.action_edit_categories), title = stringResource(MR.strings.action_edit_categories),
subtitle = pluralStringResource( subtitle = pluralStringResource(
id = R.plurals.num_categories, MR.plurals.num_categories,
count = userCategoriesCount, count = userCategoriesCount,
userCategoriesCount, userCategoriesCount,
), ),
@ -106,13 +105,13 @@ object SettingsLibraryScreen : SearchableSettings {
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = libraryPreferences.defaultCategory(), pref = libraryPreferences.defaultCategory(),
title = stringResource(R.string.default_category), title = stringResource(MR.strings.default_category),
subtitle = selectedCategory?.visualName ?: stringResource(R.string.default_category_summary), subtitle = selectedCategory?.visualName ?: stringResource(MR.strings.default_category_summary),
entries = ids.zip(labels).toMap(), entries = ids.zip(labels).toMap(),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = libraryPreferences.categorizedDisplaySettings(), pref = libraryPreferences.categorizedDisplaySettings(),
title = stringResource(R.string.categorized_display_settings), title = stringResource(MR.strings.categorized_display_settings),
onValueChanged = { onValueChanged = {
if (!it) { if (!it) {
scope.launch { scope.launch {
@ -144,8 +143,8 @@ object SettingsLibraryScreen : SearchableSettings {
var showCategoriesDialog by rememberSaveable { mutableStateOf(false) } var showCategoriesDialog by rememberSaveable { mutableStateOf(false) }
if (showCategoriesDialog) { if (showCategoriesDialog) {
TriStateListDialog( TriStateListDialog(
title = stringResource(R.string.categories), title = stringResource(MR.strings.categories),
message = stringResource(R.string.pref_library_update_categories_details), message = stringResource(MR.strings.pref_library_update_categories_details),
items = allCategories, items = allCategories,
initialChecked = included.mapNotNull { id -> allCategories.find { it.id.toString() == id } }, initialChecked = included.mapNotNull { id -> allCategories.find { it.id.toString() == id } },
initialInversed = excluded.mapNotNull { id -> allCategories.find { it.id.toString() == id } }, initialInversed = excluded.mapNotNull { id -> allCategories.find { it.id.toString() == id } },
@ -160,18 +159,18 @@ object SettingsLibraryScreen : SearchableSettings {
} }
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_category_library_update), title = stringResource(MR.strings.pref_category_library_update),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = autoUpdateIntervalPref, pref = autoUpdateIntervalPref,
title = stringResource(R.string.pref_library_update_interval), title = stringResource(MR.strings.pref_library_update_interval),
entries = mapOf( entries = mapOf(
0 to stringResource(R.string.update_never), 0 to stringResource(MR.strings.update_never),
12 to stringResource(R.string.update_12hour), 12 to stringResource(MR.strings.update_12hour),
24 to stringResource(R.string.update_24hour), 24 to stringResource(MR.strings.update_24hour),
48 to stringResource(R.string.update_48hour), 48 to stringResource(MR.strings.update_48hour),
72 to stringResource(R.string.update_72hour), 72 to stringResource(MR.strings.update_72hour),
168 to stringResource(R.string.update_weekly), 168 to stringResource(MR.strings.update_weekly),
), ),
onValueChanged = { onValueChanged = {
LibraryUpdateJob.setupTask(context, it) LibraryUpdateJob.setupTask(context, it)
@ -181,12 +180,12 @@ object SettingsLibraryScreen : SearchableSettings {
Preference.PreferenceItem.MultiSelectListPreference( Preference.PreferenceItem.MultiSelectListPreference(
pref = libraryPreferences.autoUpdateDeviceRestrictions(), pref = libraryPreferences.autoUpdateDeviceRestrictions(),
enabled = autoUpdateInterval > 0, enabled = autoUpdateInterval > 0,
title = stringResource(R.string.pref_library_update_restriction), title = stringResource(MR.strings.pref_library_update_restriction),
subtitle = stringResource(R.string.restrictions), subtitle = stringResource(MR.strings.restrictions),
entries = mapOf( entries = mapOf(
DEVICE_ONLY_ON_WIFI to stringResource(R.string.connected_to_wifi), DEVICE_ONLY_ON_WIFI to stringResource(MR.strings.connected_to_wifi),
DEVICE_NETWORK_NOT_METERED to stringResource(R.string.network_not_metered), DEVICE_NETWORK_NOT_METERED to stringResource(MR.strings.network_not_metered),
DEVICE_CHARGING to stringResource(R.string.charging), DEVICE_CHARGING to stringResource(MR.strings.charging),
), ),
onValueChanged = { onValueChanged = {
// Post to event looper to allow the preference to be updated. // Post to event looper to allow the preference to be updated.
@ -195,7 +194,7 @@ object SettingsLibraryScreen : SearchableSettings {
}, },
), ),
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.categories), title = stringResource(MR.strings.categories),
subtitle = getCategoriesLabel( subtitle = getCategoriesLabel(
allCategories = allCategories, allCategories = allCategories,
included = included, included = included,
@ -206,33 +205,33 @@ object SettingsLibraryScreen : SearchableSettings {
// SY --> // SY -->
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = libraryPreferences.groupLibraryUpdateType(), pref = libraryPreferences.groupLibraryUpdateType(),
title = stringResource(R.string.library_group_updates), title = stringResource(SYMR.strings.library_group_updates),
entries = mapOf( entries = mapOf(
GroupLibraryMode.GLOBAL to stringResource(R.string.library_group_updates_global), GroupLibraryMode.GLOBAL to stringResource(SYMR.strings.library_group_updates_global),
GroupLibraryMode.ALL_BUT_UNGROUPED to GroupLibraryMode.ALL_BUT_UNGROUPED to
stringResource(R.string.library_group_updates_all_but_ungrouped), stringResource(SYMR.strings.library_group_updates_all_but_ungrouped),
GroupLibraryMode.ALL to stringResource(R.string.library_group_updates_all), GroupLibraryMode.ALL to stringResource(SYMR.strings.library_group_updates_all),
), ),
), ),
// SY <-- // SY <--
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = libraryPreferences.autoUpdateMetadata(), pref = libraryPreferences.autoUpdateMetadata(),
title = stringResource(R.string.pref_library_update_refresh_metadata), title = stringResource(MR.strings.pref_library_update_refresh_metadata),
subtitle = stringResource(R.string.pref_library_update_refresh_metadata_summary), subtitle = stringResource(MR.strings.pref_library_update_refresh_metadata_summary),
), ),
Preference.PreferenceItem.MultiSelectListPreference( Preference.PreferenceItem.MultiSelectListPreference(
pref = libraryPreferences.autoUpdateMangaRestrictions(), pref = libraryPreferences.autoUpdateMangaRestrictions(),
title = stringResource(R.string.pref_library_update_manga_restriction), title = stringResource(MR.strings.pref_library_update_manga_restriction),
entries = mapOf( entries = mapOf(
MANGA_HAS_UNREAD to stringResource(R.string.pref_update_only_completely_read), MANGA_HAS_UNREAD to stringResource(MR.strings.pref_update_only_completely_read),
MANGA_NON_READ to stringResource(R.string.pref_update_only_started), MANGA_NON_READ to stringResource(MR.strings.pref_update_only_started),
MANGA_NON_COMPLETED to stringResource(R.string.pref_update_only_non_completed), MANGA_NON_COMPLETED to stringResource(MR.strings.pref_update_only_non_completed),
MANGA_OUTSIDE_RELEASE_PERIOD to stringResource(R.string.pref_update_only_in_release_period), MANGA_OUTSIDE_RELEASE_PERIOD to stringResource(MR.strings.pref_update_only_in_release_period),
), ),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = libraryPreferences.newShowUpdatesCount(), pref = libraryPreferences.newShowUpdatesCount(),
title = stringResource(R.string.pref_library_update_show_tab_badge), title = stringResource(MR.strings.pref_library_update_show_tab_badge),
), ),
), ),
) )
@ -243,26 +242,26 @@ object SettingsLibraryScreen : SearchableSettings {
libraryPreferences: LibraryPreferences, libraryPreferences: LibraryPreferences,
): Preference.PreferenceGroup { ): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_chapter_swipe), title = stringResource(MR.strings.pref_chapter_swipe),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = libraryPreferences.swipeToStartAction(), pref = libraryPreferences.swipeToStartAction(),
title = stringResource(R.string.pref_chapter_swipe_start), title = stringResource(MR.strings.pref_chapter_swipe_start),
entries = mapOf( entries = mapOf(
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(R.string.disabled), LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(MR.strings.disabled),
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(R.string.action_bookmark), LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(MR.strings.action_bookmark),
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(R.string.action_mark_as_read), LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(MR.strings.action_mark_as_read),
LibraryPreferences.ChapterSwipeAction.Download to stringResource(R.string.action_download), LibraryPreferences.ChapterSwipeAction.Download to stringResource(MR.strings.action_download),
), ),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = libraryPreferences.swipeToEndAction(), pref = libraryPreferences.swipeToEndAction(),
title = stringResource(R.string.pref_chapter_swipe_end), title = stringResource(MR.strings.pref_chapter_swipe_end),
entries = mapOf( entries = mapOf(
LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(R.string.disabled), LibraryPreferences.ChapterSwipeAction.Disabled to stringResource(MR.strings.disabled),
LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(R.string.action_bookmark), LibraryPreferences.ChapterSwipeAction.ToggleBookmark to stringResource(MR.strings.action_bookmark),
LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(R.string.action_mark_as_read), LibraryPreferences.ChapterSwipeAction.ToggleRead to stringResource(MR.strings.action_mark_as_read),
LibraryPreferences.ChapterSwipeAction.Download to stringResource(R.string.action_download), LibraryPreferences.ChapterSwipeAction.Download to stringResource(MR.strings.action_download),
), ),
), ),
), ),
@ -274,11 +273,11 @@ object SettingsLibraryScreen : SearchableSettings {
fun getSortingCategory(navigator: Navigator, libraryPreferences: LibraryPreferences): Preference.PreferenceGroup { fun getSortingCategory(navigator: Navigator, libraryPreferences: LibraryPreferences): Preference.PreferenceGroup {
val tagCount by libraryPreferences.sortTagsForLibrary().collectAsState() val tagCount by libraryPreferences.sortTagsForLibrary().collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
stringResource(R.string.pref_sorting_settings), stringResource(SYMR.strings.pref_sorting_settings),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.pref_tag_sorting), title = stringResource(SYMR.strings.pref_tag_sorting),
subtitle = pluralStringResource(R.plurals.pref_tag_sorting_desc, tagCount.size, tagCount.size), subtitle = pluralStringResource(SYMR.plurals.pref_tag_sorting_desc, tagCount.size, tagCount.size),
onClick = { onClick = {
navigator.push(SortTagScreen()) navigator.push(SortTagScreen())
}, },
@ -292,13 +291,13 @@ object SettingsLibraryScreen : SearchableSettings {
val skipPreMigration by unsortedPreferences.skipPreMigration().collectAsState() val skipPreMigration by unsortedPreferences.skipPreMigration().collectAsState()
val migrationSources by unsortedPreferences.migrationSources().collectAsState() val migrationSources by unsortedPreferences.migrationSources().collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
stringResource(R.string.migration), stringResource(SYMR.strings.migration),
enabled = skipPreMigration || migrationSources.isNotEmpty(), enabled = skipPreMigration || migrationSources.isNotEmpty(),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = unsortedPreferences.skipPreMigration(), pref = unsortedPreferences.skipPreMigration(),
title = stringResource(R.string.skip_pre_migration), title = stringResource(SYMR.strings.skip_pre_migration),
subtitle = stringResource(R.string.pref_skip_pre_migration_summary), subtitle = stringResource(SYMR.strings.pref_skip_pre_migration_summary),
), ),
), ),
) )

View File

@ -1,6 +1,5 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import androidx.annotation.StringRes
import androidx.compose.foundation.background import androidx.compose.foundation.background
import androidx.compose.foundation.isSystemInDarkTheme import androidx.compose.foundation.isSystemInDarkTheme
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
@ -34,24 +33,26 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.toArgb import androidx.compose.ui.graphics.toArgb
import androidx.compose.ui.graphics.vector.ImageVector import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.core.graphics.ColorUtils import androidx.core.graphics.ColorUtils
import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.Navigator import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.currentOrThrow import cafe.adriel.voyager.navigator.currentOrThrow
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.more.settings.screen.about.AboutScreen import eu.kanade.presentation.more.settings.screen.about.AboutScreen
import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget import eu.kanade.presentation.more.settings.widget.TextPreferenceWidget
import eu.kanade.presentation.util.LocalBackPress import eu.kanade.presentation.util.LocalBackPress
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import exh.assets.EhAssets import exh.assets.EhAssets
import exh.assets.ehassets.EhLogo import exh.assets.ehassets.EhLogo
import exh.assets.ehassets.MangadexLogo import exh.assets.ehassets.MangadexLogo
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen import cafe.adriel.voyager.core.screen.Screen as VoyagerScreen
object SettingsMainScreen : Screen() { object SettingsMainScreen : Screen() {
@ -88,13 +89,13 @@ object SettingsMainScreen : Screen() {
topBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(topBarState), topBarScrollBehavior = TopAppBarDefaults.pinnedScrollBehavior(topBarState),
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
title = stringResource(R.string.label_settings), title = stringResource(MR.strings.label_settings),
navigateUp = backPress::invoke, navigateUp = backPress::invoke,
actions = { actions = {
AppBarActions( AppBarActions(
persistentListOf( persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_search), title = stringResource(MR.strings.action_search),
icon = Icons.Outlined.Search, icon = Icons.Outlined.Search,
onClick = { navigator.navigate(SettingsSearchScreen(), twoPane) }, onClick = { navigator.navigate(SettingsSearchScreen(), twoPane) },
), ),
@ -171,8 +172,8 @@ object SettingsMainScreen : Screen() {
} }
private data class Item( private data class Item(
@StringRes val titleRes: Int, val titleRes: StringResource,
@StringRes val subtitleRes: Int, val subtitleRes: StringResource,
val formatSubtitle: @Composable () -> String = { stringResource(subtitleRes) }, val formatSubtitle: @Composable () -> String = { stringResource(subtitleRes) },
val icon: ImageVector, val icon: ImageVector,
val screen: VoyagerScreen, val screen: VoyagerScreen,
@ -180,78 +181,78 @@ object SettingsMainScreen : Screen() {
private val items = listOf( private val items = listOf(
Item( Item(
titleRes = R.string.pref_category_appearance, titleRes = MR.strings.pref_category_appearance,
subtitleRes = R.string.pref_appearance_summary, subtitleRes = MR.strings.pref_appearance_summary,
icon = Icons.Outlined.Palette, icon = Icons.Outlined.Palette,
screen = SettingsAppearanceScreen, screen = SettingsAppearanceScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_library, titleRes = MR.strings.pref_category_library,
subtitleRes = R.string.pref_library_summary, subtitleRes = MR.strings.pref_library_summary,
icon = Icons.Outlined.CollectionsBookmark, icon = Icons.Outlined.CollectionsBookmark,
screen = SettingsLibraryScreen, screen = SettingsLibraryScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_reader, titleRes = MR.strings.pref_category_reader,
subtitleRes = R.string.pref_reader_summary, subtitleRes = MR.strings.pref_reader_summary,
icon = Icons.AutoMirrored.Outlined.ChromeReaderMode, icon = Icons.AutoMirrored.Outlined.ChromeReaderMode,
screen = SettingsReaderScreen, screen = SettingsReaderScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_downloads, titleRes = MR.strings.pref_category_downloads,
subtitleRes = R.string.pref_downloads_summary, subtitleRes = MR.strings.pref_downloads_summary,
icon = Icons.Outlined.GetApp, icon = Icons.Outlined.GetApp,
screen = SettingsDownloadScreen, screen = SettingsDownloadScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_tracking, titleRes = MR.strings.pref_category_tracking,
subtitleRes = R.string.pref_tracking_summary, subtitleRes = MR.strings.pref_tracking_summary,
icon = Icons.Outlined.Sync, icon = Icons.Outlined.Sync,
screen = SettingsTrackingScreen, screen = SettingsTrackingScreen,
), ),
Item( Item(
titleRes = R.string.browse, titleRes = MR.strings.browse,
subtitleRes = R.string.pref_browse_summary, subtitleRes = MR.strings.pref_browse_summary,
icon = Icons.Outlined.Explore, icon = Icons.Outlined.Explore,
screen = SettingsBrowseScreen, screen = SettingsBrowseScreen,
), ),
Item( Item(
titleRes = R.string.label_data_storage, titleRes = MR.strings.label_data_storage,
subtitleRes = R.string.pref_backup_summary, subtitleRes = MR.strings.pref_backup_summary,
icon = Icons.Outlined.Storage, icon = Icons.Outlined.Storage,
screen = SettingsDataScreen, screen = SettingsDataScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_security, titleRes = MR.strings.pref_category_security,
subtitleRes = R.string.pref_security_summary, subtitleRes = MR.strings.pref_security_summary,
icon = Icons.Outlined.Security, icon = Icons.Outlined.Security,
screen = SettingsSecurityScreen, screen = SettingsSecurityScreen,
), ),
// SY --> // SY -->
Item( Item(
titleRes = R.string.pref_category_eh, titleRes = SYMR.strings.pref_category_eh,
subtitleRes = R.string.pref_ehentai_summary, subtitleRes = SYMR.strings.pref_ehentai_summary,
icon = EhAssets.EhLogo, icon = EhAssets.EhLogo,
screen = SettingsEhScreen, screen = SettingsEhScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_mangadex, titleRes = SYMR.strings.pref_category_mangadex,
subtitleRes = R.string.pref_mangadex_summary, subtitleRes = SYMR.strings.pref_mangadex_summary,
icon = EhAssets.MangadexLogo, icon = EhAssets.MangadexLogo,
screen = SettingsMangadexScreen, screen = SettingsMangadexScreen,
), ),
// SY <-- // SY <--
Item( Item(
titleRes = R.string.pref_category_advanced, titleRes = MR.strings.pref_category_advanced,
subtitleRes = R.string.pref_advanced_summary, subtitleRes = MR.strings.pref_advanced_summary,
icon = Icons.Outlined.Code, icon = Icons.Outlined.Code,
screen = SettingsAdvancedScreen, screen = SettingsAdvancedScreen,
), ),
Item( Item(
titleRes = R.string.pref_category_about, titleRes = MR.strings.pref_category_about,
subtitleRes = 0, subtitleRes = StringResource(0),
formatSubtitle = { formatSubtitle = {
"${stringResource(R.string.app_name)} ${AboutScreen.getVersionName(withBuildDate = false)}" "${stringResource(MR.strings.app_name)} ${AboutScreen.getVersionName(withBuildDate = false)}"
}, },
icon = Icons.Outlined.Info, icon = Icons.Outlined.Info,
screen = AboutScreen, screen = AboutScreen,

View File

@ -1,6 +1,5 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import androidx.annotation.StringRes
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
@ -27,7 +26,6 @@ import androidx.compose.runtime.toMutableStateList
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.domain.track.service.TrackPreferences import eu.kanade.domain.track.service.TrackPreferences
@ -46,7 +44,10 @@ import tachiyomi.core.util.lang.launchIO
import tachiyomi.core.util.lang.withUIContext import tachiyomi.core.util.lang.withUIContext
import tachiyomi.core.util.system.logcat import tachiyomi.core.util.system.logcat
import tachiyomi.domain.UnsortedPreferences import tachiyomi.domain.UnsortedPreferences
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import tachiyomi.presentation.core.util.secondaryItemAlpha import tachiyomi.presentation.core.util.secondaryItemAlpha
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
@ -56,8 +57,7 @@ object SettingsMangadexScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = SYMR.strings.pref_category_mangadex
override fun getTitleRes() = R.string.pref_category_mangadex
override fun isEnabled(): Boolean = MdUtil.getEnabledMangaDexs(Injekt.get()).isNotEmpty() override fun isEnabled(): Boolean = MdUtil.getEnabledMangaDexs(Injekt.get()).isNotEmpty()
@ -84,16 +84,16 @@ object SettingsMangadexScreen : SearchableSettings {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { title = {
Text(text = stringResource(R.string.logout)) Text(text = stringResource(MR.strings.logout))
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onLogoutRequest) { TextButton(onClick = onLogoutRequest) {
Text(text = stringResource(R.string.logout)) Text(text = stringResource(MR.strings.logout))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -117,17 +117,17 @@ object SettingsMangadexScreen : SearchableSettings {
try { try {
if (mdex.logout()) { if (mdex.logout()) {
withUIContext { withUIContext {
context.toast(R.string.logout_success) context.toast(MR.strings.logout_success)
} }
} else { } else {
withUIContext { withUIContext {
context.toast(R.string.unknown_error) context.toast(MR.strings.unknown_error)
} }
} }
} catch (e: Exception) { } catch (e: Exception) {
logcat(LogPriority.ERROR, e) { "Logout error" } logcat(LogPriority.ERROR, e) { "Logout error" }
withUIContext { withUIContext {
context.toast(R.string.unknown_error) context.toast(MR.strings.unknown_error)
} }
} }
} }
@ -178,8 +178,8 @@ object SettingsMangadexScreen : SearchableSettings {
): Preference.PreferenceItem.ListPreference<String> { ): Preference.PreferenceItem.ListPreference<String> {
return Preference.PreferenceItem.ListPreference( return Preference.PreferenceItem.ListPreference(
pref = unsortedPreferences.preferredMangaDexId(), pref = unsortedPreferences.preferredMangaDexId(),
title = stringResource(R.string.mangadex_preffered_source), title = stringResource(SYMR.strings.mangadex_preffered_source),
subtitle = stringResource(R.string.mangadex_preffered_source_summary), subtitle = stringResource(SYMR.strings.mangadex_preffered_source_summary),
entries = MdUtil.getEnabledMangaDexs(sourcePreferences) entries = MdUtil.getEnabledMangaDexs(sourcePreferences)
.associate { it.id.toString() to it.toString() }, .associate { it.id.toString() to it.toString() },
) )
@ -203,7 +203,7 @@ object SettingsMangadexScreen : SearchableSettings {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { title = {
Text(text = stringResource(R.string.mangadex_sync_follows_to_library)) Text(text = stringResource(SYMR.strings.mangadex_sync_follows_to_library))
}, },
text = { text = {
Column( Column(
@ -236,12 +236,12 @@ object SettingsMangadexScreen : SearchableSettings {
}, },
confirmButton = { confirmButton = {
TextButton(onClick = { onSelectionConfirmed(items.filterIndexed { index, _ -> selection[index] }) }) { TextButton(onClick = { onSelectionConfirmed(items.filterIndexed { index, _ -> selection[index] }) }) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -267,8 +267,8 @@ object SettingsMangadexScreen : SearchableSettings {
) )
} }
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.mangadex_sync_follows_to_library), title = stringResource(SYMR.strings.mangadex_sync_follows_to_library),
subtitle = stringResource(R.string.mangadex_sync_follows_to_library_summary), subtitle = stringResource(SYMR.strings.mangadex_sync_follows_to_library_summary),
onClick = { dialogOpen = true }, onClick = { dialogOpen = true },
) )
} }
@ -277,8 +277,8 @@ object SettingsMangadexScreen : SearchableSettings {
fun syncLibraryToMangaDex(): Preference.PreferenceItem.TextPreference { fun syncLibraryToMangaDex(): Preference.PreferenceItem.TextPreference {
val context = LocalContext.current val context = LocalContext.current
return Preference.PreferenceItem.TextPreference( return Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.mangadex_push_favorites_to_mangadex), title = stringResource(SYMR.strings.mangadex_push_favorites_to_mangadex),
subtitle = stringResource(R.string.mangadex_push_favorites_to_mangadex_summary), subtitle = stringResource(SYMR.strings.mangadex_push_favorites_to_mangadex_summary),
onClick = { onClick = {
LibraryUpdateJob.startNow( LibraryUpdateJob.startNow(
context, context,

View File

@ -1,20 +1,20 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import android.os.Build import android.os.Build
import androidx.annotation.StringRes
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.ui.platform.LocalView import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.res.stringResource
import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.Preference
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.reader.setting.ReaderBottomButton import eu.kanade.tachiyomi.ui.reader.setting.ReaderBottomButton
import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences import eu.kanade.tachiyomi.ui.reader.setting.ReaderPreferences
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig import eu.kanade.tachiyomi.ui.reader.viewer.pager.PagerConfig
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -24,8 +24,7 @@ object SettingsReaderScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = MR.strings.pref_category_reader
override fun getTitleRes() = R.string.pref_category_reader
@Composable @Composable
override fun getPreferences(): List<Preference> { override fun getPreferences(): List<Preference> {
@ -36,64 +35,64 @@ object SettingsReaderScreen : SearchableSettings {
return listOf( return listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPref.defaultReadingMode(), pref = readerPref.defaultReadingMode(),
title = stringResource(R.string.pref_viewer_type), title = stringResource(MR.strings.pref_viewer_type),
entries = ReadingMode.entries.drop(1) entries = ReadingMode.entries.drop(1)
.associate { it.flagValue to stringResource(it.stringRes) }, .associate { it.flagValue to stringResource(it.stringRes) },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPref.doubleTapAnimSpeed(), pref = readerPref.doubleTapAnimSpeed(),
title = stringResource(R.string.pref_double_tap_anim_speed), title = stringResource(MR.strings.pref_double_tap_anim_speed),
entries = mapOf( entries = mapOf(
1 to stringResource(R.string.double_tap_anim_speed_0), 1 to stringResource(MR.strings.double_tap_anim_speed_0),
500 to stringResource(R.string.double_tap_anim_speed_normal), 500 to stringResource(MR.strings.double_tap_anim_speed_normal),
250 to stringResource(R.string.double_tap_anim_speed_fast), 250 to stringResource(MR.strings.double_tap_anim_speed_fast),
), ),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.showReadingMode(), pref = readerPref.showReadingMode(),
title = stringResource(R.string.pref_show_reading_mode), title = stringResource(MR.strings.pref_show_reading_mode),
subtitle = stringResource(R.string.pref_show_reading_mode_summary), subtitle = stringResource(MR.strings.pref_show_reading_mode_summary),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.showNavigationOverlayOnStart(), pref = readerPref.showNavigationOverlayOnStart(),
title = stringResource(R.string.pref_show_navigation_mode), title = stringResource(MR.strings.pref_show_navigation_mode),
subtitle = stringResource(R.string.pref_show_navigation_mode_summary), subtitle = stringResource(MR.strings.pref_show_navigation_mode_summary),
), ),
// SY --> // SY -->
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.forceHorizontalSeekbar(), pref = readerPref.forceHorizontalSeekbar(),
title = stringResource(R.string.pref_force_horz_seekbar), title = stringResource(SYMR.strings.pref_force_horz_seekbar),
subtitle = stringResource(R.string.pref_force_horz_seekbar_summary), subtitle = stringResource(SYMR.strings.pref_force_horz_seekbar_summary),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.landscapeVerticalSeekbar(), pref = readerPref.landscapeVerticalSeekbar(),
title = stringResource(R.string.pref_show_vert_seekbar_landscape), title = stringResource(SYMR.strings.pref_show_vert_seekbar_landscape),
subtitle = stringResource(R.string.pref_show_vert_seekbar_landscape_summary), subtitle = stringResource(SYMR.strings.pref_show_vert_seekbar_landscape_summary),
enabled = !forceHorizontalSeekbar, enabled = !forceHorizontalSeekbar,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.leftVerticalSeekbar(), pref = readerPref.leftVerticalSeekbar(),
title = stringResource(R.string.pref_left_handed_vertical_seekbar), title = stringResource(SYMR.strings.pref_left_handed_vertical_seekbar),
subtitle = stringResource(R.string.pref_left_handed_vertical_seekbar_summary), subtitle = stringResource(SYMR.strings.pref_left_handed_vertical_seekbar_summary),
enabled = !forceHorizontalSeekbar, enabled = !forceHorizontalSeekbar,
), ),
// SY <-- // SY <--
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.trueColor(), pref = readerPref.trueColor(),
title = stringResource(R.string.pref_true_color), title = stringResource(MR.strings.pref_true_color),
subtitle = stringResource(R.string.pref_true_color_summary), subtitle = stringResource(MR.strings.pref_true_color_summary),
enabled = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O, enabled = Build.VERSION.SDK_INT >= Build.VERSION_CODES.O,
), ),
/* SY --> /* SY -->
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.pageTransitions(), pref = readerPref.pageTransitions(),
title = stringResource(R.string.pref_page_transitions), title = stringResource(MR.strings.pref_page_transitions),
), ),
SY <-- */ SY <-- */
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPref.flashOnPageChange(), pref = readerPref.flashOnPageChange(),
title = stringResource(R.string.pref_flash_page), title = stringResource(MR.strings.pref_flash_page),
subtitle = stringResource(R.string.pref_flash_page_summ), subtitle = stringResource(MR.strings.pref_flash_page_summ),
), ),
getDisplayGroup(readerPreferences = readerPref), getDisplayGroup(readerPreferences = readerPref),
getReadingGroup(readerPreferences = readerPref), getReadingGroup(readerPreferences = readerPref),
@ -116,42 +115,42 @@ object SettingsReaderScreen : SearchableSettings {
val fullscreenPref = readerPreferences.fullscreen() val fullscreenPref = readerPreferences.fullscreen()
val fullscreen by fullscreenPref.collectAsState() val fullscreen by fullscreenPref.collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_category_display), title = stringResource(MR.strings.pref_category_display),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.defaultOrientationType(), pref = readerPreferences.defaultOrientationType(),
title = stringResource(R.string.pref_rotation_type), title = stringResource(MR.strings.pref_rotation_type),
entries = ReaderOrientation.entries.drop(1) entries = ReaderOrientation.entries.drop(1)
.associate { it.flagValue to stringResource(it.stringRes) }, .associate { it.flagValue to stringResource(it.stringRes) },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.readerTheme(), pref = readerPreferences.readerTheme(),
title = stringResource(R.string.pref_reader_theme), title = stringResource(MR.strings.pref_reader_theme),
entries = mapOf( entries = mapOf(
1 to stringResource(R.string.black_background), 1 to stringResource(MR.strings.black_background),
2 to stringResource(R.string.gray_background), 2 to stringResource(MR.strings.gray_background),
0 to stringResource(R.string.white_background), 0 to stringResource(MR.strings.white_background),
3 to stringResource(R.string.automatic_background), 3 to stringResource(MR.strings.automatic_background),
), ),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = fullscreenPref, pref = fullscreenPref,
title = stringResource(R.string.pref_fullscreen), title = stringResource(MR.strings.pref_fullscreen),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.cutoutShort(), pref = readerPreferences.cutoutShort(),
title = stringResource(R.string.pref_cutout_short), title = stringResource(MR.strings.pref_cutout_short),
enabled = fullscreen && enabled = fullscreen &&
Build.VERSION.SDK_INT >= Build.VERSION_CODES.P && Build.VERSION.SDK_INT >= Build.VERSION_CODES.P &&
LocalView.current.rootWindowInsets?.displayCutout != null, // has cutout LocalView.current.rootWindowInsets?.displayCutout != null, // has cutout
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.keepScreenOn(), pref = readerPreferences.keepScreenOn(),
title = stringResource(R.string.pref_keep_screen_on), title = stringResource(MR.strings.pref_keep_screen_on),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.showPageNumber(), pref = readerPreferences.showPageNumber(),
title = stringResource(R.string.pref_show_page_number), title = stringResource(MR.strings.pref_show_page_number),
), ),
), ),
) )
@ -160,23 +159,23 @@ object SettingsReaderScreen : SearchableSettings {
@Composable @Composable
private fun getReadingGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup { private fun getReadingGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_category_reading), title = stringResource(MR.strings.pref_category_reading),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.skipRead(), pref = readerPreferences.skipRead(),
title = stringResource(R.string.pref_skip_read_chapters), title = stringResource(MR.strings.pref_skip_read_chapters),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.skipFiltered(), pref = readerPreferences.skipFiltered(),
title = stringResource(R.string.pref_skip_filtered_chapters), title = stringResource(MR.strings.pref_skip_filtered_chapters),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.skipDupe(), pref = readerPreferences.skipDupe(),
title = stringResource(R.string.pref_skip_dupe_chapters), title = stringResource(MR.strings.pref_skip_dupe_chapters),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.alwaysShowChapterTransition(), pref = readerPreferences.alwaysShowChapterTransition(),
title = stringResource(R.string.pref_always_show_chapter_transition), title = stringResource(MR.strings.pref_always_show_chapter_transition),
), ),
), ),
) )
@ -195,63 +194,63 @@ object SettingsReaderScreen : SearchableSettings {
val rotateToFit by rotateToFitPref.collectAsState() val rotateToFit by rotateToFitPref.collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pager_viewer), title = stringResource(MR.strings.pager_viewer),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = navModePref, pref = navModePref,
title = stringResource(R.string.pref_viewer_nav), title = stringResource(MR.strings.pref_viewer_nav),
entries = ReaderPreferences.TapZones entries = ReaderPreferences.TapZones
.mapIndexed { index, it -> index to stringResource(it) } .mapIndexed { index, it -> index to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.pagerNavInverted(), pref = readerPreferences.pagerNavInverted(),
title = stringResource(R.string.pref_read_with_tapping_inverted), title = stringResource(MR.strings.pref_read_with_tapping_inverted),
entries = mapOf( entries = mapOf(
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none), ReaderPreferences.TappingInvertMode.NONE to stringResource(MR.strings.none),
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(R.string.tapping_inverted_horizontal), ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(MR.strings.tapping_inverted_horizontal),
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(R.string.tapping_inverted_vertical), ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(MR.strings.tapping_inverted_vertical),
ReaderPreferences.TappingInvertMode.BOTH to stringResource(R.string.tapping_inverted_both), ReaderPreferences.TappingInvertMode.BOTH to stringResource(MR.strings.tapping_inverted_both),
), ),
enabled = navMode != 5, enabled = navMode != 5,
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = imageScaleTypePref, pref = imageScaleTypePref,
title = stringResource(R.string.pref_image_scale_type), title = stringResource(MR.strings.pref_image_scale_type),
entries = ReaderPreferences.ImageScaleType entries = ReaderPreferences.ImageScaleType
.mapIndexed { index, it -> index + 1 to stringResource(it) } .mapIndexed { index, it -> index + 1 to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.zoomStart(), pref = readerPreferences.zoomStart(),
title = stringResource(R.string.pref_zoom_start), title = stringResource(MR.strings.pref_zoom_start),
entries = ReaderPreferences.ZoomStart entries = ReaderPreferences.ZoomStart
.mapIndexed { index, it -> index + 1 to stringResource(it) } .mapIndexed { index, it -> index + 1 to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.cropBorders(), pref = readerPreferences.cropBorders(),
title = stringResource(R.string.pref_crop_borders), title = stringResource(MR.strings.pref_crop_borders),
), ),
// SY --> // SY -->
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.pageTransitionsPager(), pref = readerPreferences.pageTransitionsPager(),
title = stringResource(R.string.pref_page_transitions), title = stringResource(MR.strings.pref_page_transitions),
), ),
// SY <-- // SY <--
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.landscapeZoom(), pref = readerPreferences.landscapeZoom(),
title = stringResource(R.string.pref_landscape_zoom), title = stringResource(MR.strings.pref_landscape_zoom),
enabled = imageScaleType == 1, enabled = imageScaleType == 1,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.navigateToPan(), pref = readerPreferences.navigateToPan(),
title = stringResource(R.string.pref_navigate_pan), title = stringResource(MR.strings.pref_navigate_pan),
enabled = navMode != 5, enabled = navMode != 5,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = dualPageSplitPref, pref = dualPageSplitPref,
title = stringResource(R.string.pref_dual_page_split), title = stringResource(MR.strings.pref_dual_page_split),
onValueChanged = { onValueChanged = {
rotateToFitPref.set(false) rotateToFitPref.set(false)
true true
@ -259,13 +258,13 @@ object SettingsReaderScreen : SearchableSettings {
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.dualPageInvertPaged(), pref = readerPreferences.dualPageInvertPaged(),
title = stringResource(R.string.pref_dual_page_invert), title = stringResource(MR.strings.pref_dual_page_invert),
subtitle = stringResource(R.string.pref_dual_page_invert_summary), subtitle = stringResource(MR.strings.pref_dual_page_invert_summary),
enabled = dualPageSplit, enabled = dualPageSplit,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = rotateToFitPref, pref = rotateToFitPref,
title = stringResource(R.string.pref_page_rotate), title = stringResource(MR.strings.pref_page_rotate),
onValueChanged = { onValueChanged = {
dualPageSplitPref.set(false) dualPageSplitPref.set(false)
true true
@ -273,7 +272,7 @@ object SettingsReaderScreen : SearchableSettings {
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.dualPageRotateToFitInvert(), pref = readerPreferences.dualPageRotateToFitInvert(),
title = stringResource(R.string.pref_page_rotate_invert), title = stringResource(MR.strings.pref_page_rotate_invert),
enabled = rotateToFit, enabled = rotateToFit,
), ),
), ),
@ -293,29 +292,29 @@ object SettingsReaderScreen : SearchableSettings {
val webtoonSidePadding by webtoonSidePaddingPref.collectAsState() val webtoonSidePadding by webtoonSidePaddingPref.collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.webtoon_viewer), title = stringResource(MR.strings.webtoon_viewer),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = navModePref, pref = navModePref,
title = stringResource(R.string.pref_viewer_nav), title = stringResource(MR.strings.pref_viewer_nav),
entries = ReaderPreferences.TapZones entries = ReaderPreferences.TapZones
.mapIndexed { index, it -> index to stringResource(it) } .mapIndexed { index, it -> index to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.webtoonNavInverted(), pref = readerPreferences.webtoonNavInverted(),
title = stringResource(R.string.pref_read_with_tapping_inverted), title = stringResource(MR.strings.pref_read_with_tapping_inverted),
entries = mapOf( entries = mapOf(
ReaderPreferences.TappingInvertMode.NONE to stringResource(R.string.none), ReaderPreferences.TappingInvertMode.NONE to stringResource(MR.strings.none),
ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(R.string.tapping_inverted_horizontal), ReaderPreferences.TappingInvertMode.HORIZONTAL to stringResource(MR.strings.tapping_inverted_horizontal),
ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(R.string.tapping_inverted_vertical), ReaderPreferences.TappingInvertMode.VERTICAL to stringResource(MR.strings.tapping_inverted_vertical),
ReaderPreferences.TappingInvertMode.BOTH to stringResource(R.string.tapping_inverted_both), ReaderPreferences.TappingInvertMode.BOTH to stringResource(MR.strings.tapping_inverted_both),
), ),
enabled = navMode != 5, enabled = navMode != 5,
), ),
Preference.PreferenceItem.SliderPreference( Preference.PreferenceItem.SliderPreference(
value = webtoonSidePadding, value = webtoonSidePadding,
title = stringResource(R.string.pref_webtoon_side_padding), title = stringResource(MR.strings.pref_webtoon_side_padding),
subtitle = numberFormat.format(webtoonSidePadding / 100f), subtitle = numberFormat.format(webtoonSidePadding / 100f),
min = ReaderPreferences.WEBTOON_PADDING_MIN, min = ReaderPreferences.WEBTOON_PADDING_MIN,
max = ReaderPreferences.WEBTOON_PADDING_MAX, max = ReaderPreferences.WEBTOON_PADDING_MAX,
@ -326,41 +325,41 @@ object SettingsReaderScreen : SearchableSettings {
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.readerHideThreshold(), pref = readerPreferences.readerHideThreshold(),
title = stringResource(R.string.pref_hide_threshold), title = stringResource(MR.strings.pref_hide_threshold),
entries = mapOf( entries = mapOf(
ReaderPreferences.ReaderHideThreshold.HIGHEST to stringResource(R.string.pref_highest), ReaderPreferences.ReaderHideThreshold.HIGHEST to stringResource(MR.strings.pref_highest),
ReaderPreferences.ReaderHideThreshold.HIGH to stringResource(R.string.pref_high), ReaderPreferences.ReaderHideThreshold.HIGH to stringResource(MR.strings.pref_high),
ReaderPreferences.ReaderHideThreshold.LOW to stringResource(R.string.pref_low), ReaderPreferences.ReaderHideThreshold.LOW to stringResource(MR.strings.pref_low),
ReaderPreferences.ReaderHideThreshold.LOWEST to stringResource(R.string.pref_lowest), ReaderPreferences.ReaderHideThreshold.LOWEST to stringResource(MR.strings.pref_lowest),
), ),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.cropBordersWebtoon(), pref = readerPreferences.cropBordersWebtoon(),
title = stringResource(R.string.pref_crop_borders), title = stringResource(MR.strings.pref_crop_borders),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = dualPageSplitPref, pref = dualPageSplitPref,
title = stringResource(R.string.pref_dual_page_split), title = stringResource(MR.strings.pref_dual_page_split),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.dualPageInvertWebtoon(), pref = readerPreferences.dualPageInvertWebtoon(),
title = stringResource(R.string.pref_dual_page_invert), title = stringResource(MR.strings.pref_dual_page_invert),
subtitle = stringResource(R.string.pref_dual_page_invert_summary), subtitle = stringResource(MR.strings.pref_dual_page_invert_summary),
enabled = dualPageSplit, enabled = dualPageSplit,
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.webtoonDoubleTapZoomEnabled(), pref = readerPreferences.webtoonDoubleTapZoomEnabled(),
title = stringResource(R.string.pref_double_tap_zoom), title = stringResource(MR.strings.pref_double_tap_zoom),
enabled = true, enabled = true,
), ),
// SY --> // SY -->
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.pageTransitionsWebtoon(), pref = readerPreferences.pageTransitionsWebtoon(),
title = stringResource(R.string.pref_page_transitions), title = stringResource(MR.strings.pref_page_transitions),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.webtoonEnableZoomOut(), pref = readerPreferences.webtoonEnableZoomOut(),
title = stringResource(R.string.enable_zoom_out), title = stringResource(SYMR.strings.enable_zoom_out),
), ),
// SY <-- // SY <--
), ),
@ -371,16 +370,16 @@ object SettingsReaderScreen : SearchableSettings {
@Composable @Composable
private fun getContinuousVerticalGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup { private fun getContinuousVerticalGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.vertical_plus_viewer), title = stringResource(MR.strings.vertical_plus_viewer),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.continuousVerticalTappingByPage(), pref = readerPreferences.continuousVerticalTappingByPage(),
title = stringResource(R.string.tap_scroll_page), title = stringResource(SYMR.strings.tap_scroll_page),
subtitle = stringResource(R.string.tap_scroll_page_summary), subtitle = stringResource(SYMR.strings.tap_scroll_page_summary),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.cropBordersContinuousVertical(), pref = readerPreferences.cropBordersContinuousVertical(),
title = stringResource(R.string.pref_crop_borders), title = stringResource(MR.strings.pref_crop_borders),
), ),
), ),
) )
@ -392,15 +391,15 @@ object SettingsReaderScreen : SearchableSettings {
val readWithVolumeKeysPref = readerPreferences.readWithVolumeKeys() val readWithVolumeKeysPref = readerPreferences.readWithVolumeKeys()
val readWithVolumeKeys by readWithVolumeKeysPref.collectAsState() val readWithVolumeKeys by readWithVolumeKeysPref.collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_reader_navigation), title = stringResource(MR.strings.pref_reader_navigation),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readWithVolumeKeysPref, pref = readWithVolumeKeysPref,
title = stringResource(R.string.pref_read_with_volume_keys), title = stringResource(MR.strings.pref_read_with_volume_keys),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.readWithVolumeKeysInverted(), pref = readerPreferences.readWithVolumeKeysInverted(),
title = stringResource(R.string.pref_read_with_volume_keys_inverted), title = stringResource(MR.strings.pref_read_with_volume_keys_inverted),
enabled = readWithVolumeKeys, enabled = readWithVolumeKeys,
), ),
), ),
@ -410,16 +409,16 @@ object SettingsReaderScreen : SearchableSettings {
@Composable @Composable
private fun getActionsGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup { private fun getActionsGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_reader_actions), title = stringResource(MR.strings.pref_reader_actions),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.readWithLongTap(), pref = readerPreferences.readWithLongTap(),
title = stringResource(R.string.pref_read_with_long_tap), title = stringResource(MR.strings.pref_read_with_long_tap),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.folderPerManga(), pref = readerPreferences.folderPerManga(),
title = stringResource(R.string.pref_create_folder_per_manga), title = stringResource(MR.strings.pref_create_folder_per_manga),
subtitle = stringResource(R.string.pref_create_folder_per_manga_summary), subtitle = stringResource(MR.strings.pref_create_folder_per_manga_summary),
), ),
), ),
) )
@ -429,33 +428,33 @@ object SettingsReaderScreen : SearchableSettings {
@Composable @Composable
private fun getPageDownloadingGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup { private fun getPageDownloadingGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup {
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.page_downloading), title = stringResource(SYMR.strings.page_downloading),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.preloadSize(), pref = readerPreferences.preloadSize(),
title = stringResource(R.string.reader_preload_amount), title = stringResource(SYMR.strings.reader_preload_amount),
subtitle = stringResource(R.string.reader_preload_amount_summary), subtitle = stringResource(SYMR.strings.reader_preload_amount_summary),
entries = mapOf( entries = mapOf(
4 to stringResource(R.string.reader_preload_amount_4_pages), 4 to stringResource(SYMR.strings.reader_preload_amount_4_pages),
6 to stringResource(R.string.reader_preload_amount_6_pages), 6 to stringResource(SYMR.strings.reader_preload_amount_6_pages),
8 to stringResource(R.string.reader_preload_amount_8_pages), 8 to stringResource(SYMR.strings.reader_preload_amount_8_pages),
10 to stringResource(R.string.reader_preload_amount_10_pages), 10 to stringResource(SYMR.strings.reader_preload_amount_10_pages),
12 to stringResource(R.string.reader_preload_amount_12_pages), 12 to stringResource(SYMR.strings.reader_preload_amount_12_pages),
14 to stringResource(R.string.reader_preload_amount_14_pages), 14 to stringResource(SYMR.strings.reader_preload_amount_14_pages),
16 to stringResource(R.string.reader_preload_amount_16_pages), 16 to stringResource(SYMR.strings.reader_preload_amount_16_pages),
20 to stringResource(R.string.reader_preload_amount_20_pages), 20 to stringResource(SYMR.strings.reader_preload_amount_20_pages),
), ),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.readerThreads(), pref = readerPreferences.readerThreads(),
title = stringResource(R.string.download_threads), title = stringResource(SYMR.strings.download_threads),
subtitle = stringResource(R.string.download_threads_summary), subtitle = stringResource(SYMR.strings.download_threads_summary),
entries = List(5) { it }.associateWith { it.toString() }, entries = List(5) { it }.associateWith { it.toString() },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.cacheSize(), pref = readerPreferences.cacheSize(),
title = stringResource(R.string.reader_cache_size), title = stringResource(SYMR.strings.reader_cache_size),
subtitle = stringResource(R.string.reader_cache_size_summary), subtitle = stringResource(SYMR.strings.reader_cache_size_summary),
entries = mapOf( entries = mapOf(
"50" to "50 MB", "50" to "50 MB",
"75" to "75 MB", "75" to "75 MB",
@ -477,8 +476,8 @@ object SettingsReaderScreen : SearchableSettings {
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.aggressivePageLoading(), pref = readerPreferences.aggressivePageLoading(),
title = stringResource(R.string.aggressively_load_pages), title = stringResource(SYMR.strings.aggressively_load_pages),
subtitle = stringResource(R.string.aggressively_load_pages_summary), subtitle = stringResource(SYMR.strings.aggressively_load_pages_summary),
), ),
), ),
) )
@ -488,54 +487,54 @@ object SettingsReaderScreen : SearchableSettings {
private fun getForkSettingsGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup { private fun getForkSettingsGroup(readerPreferences: ReaderPreferences): Preference.PreferenceGroup {
val pageLayout by readerPreferences.pageLayout().collectAsState() val pageLayout by readerPreferences.pageLayout().collectAsState()
return Preference.PreferenceGroup( return Preference.PreferenceGroup(
title = stringResource(R.string.pref_category_fork), title = stringResource(SYMR.strings.pref_category_fork),
preferenceItems = listOf( preferenceItems = listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.readerInstantRetry(), pref = readerPreferences.readerInstantRetry(),
title = stringResource(R.string.skip_queue_on_retry), title = stringResource(SYMR.strings.skip_queue_on_retry),
subtitle = stringResource(R.string.skip_queue_on_retry_summary), subtitle = stringResource(SYMR.strings.skip_queue_on_retry_summary),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.preserveReadingPosition(), pref = readerPreferences.preserveReadingPosition(),
title = stringResource(R.string.preserve_reading_position), title = stringResource(SYMR.strings.preserve_reading_position),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.useAutoWebtoon(), pref = readerPreferences.useAutoWebtoon(),
title = stringResource(R.string.auto_webtoon_mode), title = stringResource(SYMR.strings.auto_webtoon_mode),
subtitle = stringResource(R.string.auto_webtoon_mode_summary), subtitle = stringResource(SYMR.strings.auto_webtoon_mode_summary),
), ),
Preference.PreferenceItem.MultiSelectListPreference( Preference.PreferenceItem.MultiSelectListPreference(
pref = readerPreferences.readerBottomButtons(), pref = readerPreferences.readerBottomButtons(),
title = stringResource(R.string.reader_bottom_buttons), title = stringResource(SYMR.strings.reader_bottom_buttons),
subtitle = stringResource(R.string.reader_bottom_buttons_summary), subtitle = stringResource(SYMR.strings.reader_bottom_buttons_summary),
entries = ReaderBottomButton.values() entries = ReaderBottomButton.values()
.associate { it.value to stringResource(it.stringRes) }, .associate { it.value to stringResource(it.stringRes) },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.pageLayout(), pref = readerPreferences.pageLayout(),
title = stringResource(R.string.page_layout), title = stringResource(SYMR.strings.page_layout),
subtitle = stringResource(R.string.automatic_can_still_switch), subtitle = stringResource(SYMR.strings.automatic_can_still_switch),
entries = ReaderPreferences.PageLayouts entries = ReaderPreferences.PageLayouts
.mapIndexed { index, it -> index + 1 to stringResource(it) } .mapIndexed { index, it -> index + 1 to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.invertDoublePages(), pref = readerPreferences.invertDoublePages(),
title = stringResource(R.string.invert_double_pages), title = stringResource(SYMR.strings.invert_double_pages),
enabled = pageLayout != PagerConfig.PageLayout.SINGLE_PAGE, enabled = pageLayout != PagerConfig.PageLayout.SINGLE_PAGE,
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = readerPreferences.centerMarginType(), pref = readerPreferences.centerMarginType(),
title = stringResource(R.string.center_margin), title = stringResource(SYMR.strings.center_margin),
subtitle = stringResource(R.string.pref_center_margin_summary), subtitle = stringResource(SYMR.strings.pref_center_margin_summary),
entries = ReaderPreferences.CenterMarginTypes entries = ReaderPreferences.CenterMarginTypes
.mapIndexed { index, it -> index + 1 to stringResource(it) } .mapIndexed { index, it -> index + 1 to stringResource(it) }
.toMap(), .toMap(),
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = readerPreferences.cacheArchiveMangaOnDisk(), pref = readerPreferences.cacheArchiveMangaOnDisk(),
title = stringResource(R.string.cache_archived_manga_to_disk), title = stringResource(SYMR.strings.cache_archived_manga_to_disk),
subtitle = stringResource(R.string.cache_archived_manga_to_disk_subtitle), subtitle = stringResource(SYMR.strings.cache_archived_manga_to_disk_subtitle),
), ),
), ),
) )

View File

@ -1,6 +1,5 @@
package eu.kanade.presentation.more.settings.screen package eu.kanade.presentation.more.settings.screen
import androidx.annotation.StringRes
import androidx.compose.foundation.clickable import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
@ -35,8 +34,6 @@ import androidx.compose.ui.input.key.Key
import androidx.compose.ui.input.key.key import androidx.compose.ui.input.key.key
import androidx.compose.ui.input.key.onKeyEvent import androidx.compose.ui.input.key.onKeyEvent
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.pluralStringResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.ImeAction import androidx.compose.ui.text.input.ImeAction
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.text.input.PasswordVisualTransformation import androidx.compose.ui.text.input.PasswordVisualTransformation
@ -46,14 +43,19 @@ import androidx.compose.ui.window.DialogProperties
import androidx.fragment.app.FragmentActivity import androidx.fragment.app.FragmentActivity
import cafe.adriel.voyager.navigator.LocalNavigator import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow import cafe.adriel.voyager.navigator.currentOrThrow
import dev.icerock.moko.resources.StringResource
import eu.kanade.presentation.more.settings.Preference import eu.kanade.presentation.more.settings.Preference
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.core.security.SecurityPreferences import eu.kanade.tachiyomi.core.security.SecurityPreferences
import eu.kanade.tachiyomi.ui.base.delegate.SecureActivityDelegate import eu.kanade.tachiyomi.ui.base.delegate.SecureActivityDelegate
import eu.kanade.tachiyomi.ui.category.biometric.BiometricTimesScreen import eu.kanade.tachiyomi.ui.category.biometric.BiometricTimesScreen
import eu.kanade.tachiyomi.util.storage.CbzCrypto import eu.kanade.tachiyomi.util.storage.CbzCrypto
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.authenticate
import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported import eu.kanade.tachiyomi.util.system.AuthenticatorUtil.isAuthenticationSupported
import tachiyomi.core.i18n.stringResource
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.pluralStringResource
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -62,8 +64,7 @@ object SettingsSecurityScreen : SearchableSettings {
@ReadOnlyComposable @ReadOnlyComposable
@Composable @Composable
@StringRes override fun getTitleRes() = MR.strings.pref_category_security
override fun getTitleRes() = R.string.pref_category_security
@Composable @Composable
override fun getPreferences(): List<Preference> { override fun getPreferences(): List<Preference> {
@ -81,54 +82,54 @@ object SettingsSecurityScreen : SearchableSettings {
return listOf( return listOf(
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = useAuthPref, pref = useAuthPref,
title = stringResource(R.string.lock_with_biometrics), title = stringResource(MR.strings.lock_with_biometrics),
enabled = authSupported, enabled = authSupported,
onValueChanged = { onValueChanged = {
(context as FragmentActivity).authenticate( (context as FragmentActivity).authenticate(
title = context.getString(R.string.lock_with_biometrics), title = context.stringResource(MR.strings.lock_with_biometrics),
) )
}, },
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = securityPreferences.lockAppAfter(), pref = securityPreferences.lockAppAfter(),
title = stringResource(R.string.lock_when_idle), title = stringResource(MR.strings.lock_when_idle),
enabled = authSupported && useAuth, enabled = authSupported && useAuth,
entries = LockAfterValues entries = LockAfterValues
.associateWith { .associateWith {
when (it) { when (it) {
-1 -> stringResource(R.string.lock_never) -1 -> stringResource(MR.strings.lock_never)
0 -> stringResource(R.string.lock_always) 0 -> stringResource(MR.strings.lock_always)
else -> pluralStringResource(id = R.plurals.lock_after_mins, count = it, it) else -> pluralStringResource(MR.plurals.lock_after_mins, count = it, it)
} }
}, },
onValueChanged = { onValueChanged = {
(context as FragmentActivity).authenticate( (context as FragmentActivity).authenticate(
title = context.getString(R.string.lock_when_idle), title = context.stringResource(MR.strings.lock_when_idle),
) )
}, },
), ),
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = securityPreferences.hideNotificationContent(), pref = securityPreferences.hideNotificationContent(),
title = stringResource(R.string.hide_notification_content), title = stringResource(MR.strings.hide_notification_content),
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = securityPreferences.secureScreen(), pref = securityPreferences.secureScreen(),
title = stringResource(R.string.secure_screen), title = stringResource(MR.strings.secure_screen),
entries = SecurityPreferences.SecureScreenMode.entries entries = SecurityPreferences.SecureScreenMode.entries
.associateWith { stringResource(it.titleResId) }, .associateWith { stringResource(it.titleRes) },
), ),
// SY --> // SY -->
Preference.PreferenceItem.SwitchPreference( Preference.PreferenceItem.SwitchPreference(
pref = securityPreferences.passwordProtectDownloads(), pref = securityPreferences.passwordProtectDownloads(),
title = stringResource(R.string.password_protect_downloads), title = stringResource(SYMR.strings.password_protect_downloads),
subtitle = stringResource(R.string.password_protect_downloads_summary), subtitle = stringResource(SYMR.strings.password_protect_downloads_summary),
enabled = isCbzPasswordSet, enabled = isCbzPasswordSet,
), ),
Preference.PreferenceItem.ListPreference( Preference.PreferenceItem.ListPreference(
pref = securityPreferences.encryptionType(), pref = securityPreferences.encryptionType(),
title = stringResource(R.string.encryption_type), title = stringResource(SYMR.strings.encryption_type),
entries = SecurityPreferences.EncryptionType.values() entries = SecurityPreferences.EncryptionType.entries
.associateWith { stringResource(it.titleResId) }, .associateWith { stringResource(it.titleRes) },
enabled = passwordProtectDownloads, enabled = passwordProtectDownloads,
), ),
@ -146,14 +147,14 @@ object SettingsSecurityScreen : SearchableSettings {
) )
} }
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.set_cbz_zip_password), title = stringResource(SYMR.strings.set_cbz_zip_password),
onClick = { onClick = {
dialogOpen = true dialogOpen = true
}, },
) )
}, },
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.delete_cbz_archive_password), title = stringResource(SYMR.strings.delete_cbz_archive_password),
onClick = { onClick = {
CbzCrypto.deleteKeyCbz() CbzCrypto.deleteKeyCbz()
securityPreferences.cbzPassword().set("") securityPreferences.cbzPassword().set("")
@ -164,9 +165,9 @@ object SettingsSecurityScreen : SearchableSettings {
val navigator = LocalNavigator.currentOrThrow val navigator = LocalNavigator.currentOrThrow
val count by securityPreferences.authenticatorTimeRanges().collectAsState() val count by securityPreferences.authenticatorTimeRanges().collectAsState()
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.action_edit_biometric_lock_times), title = stringResource(SYMR.strings.action_edit_biometric_lock_times),
subtitle = pluralStringResource( subtitle = pluralStringResource(
R.plurals.num_lock_times, SYMR.plurals.num_lock_times,
count.size, count.size,
count.size, count.size,
), ),
@ -190,26 +191,26 @@ object SettingsSecurityScreen : SearchableSettings {
) )
} }
Preference.PreferenceItem.TextPreference( Preference.PreferenceItem.TextPreference(
title = stringResource(R.string.biometric_lock_days), title = stringResource(SYMR.strings.biometric_lock_days),
subtitle = stringResource(R.string.biometric_lock_days_summary), subtitle = stringResource(SYMR.strings.biometric_lock_days_summary),
onClick = { dialogOpen = true }, onClick = { dialogOpen = true },
enabled = useAuth, enabled = useAuth,
) )
}, },
// SY <-- // SY <--
Preference.PreferenceItem.InfoPreference(stringResource(R.string.secure_screen_summary)), Preference.PreferenceItem.InfoPreference(stringResource(MR.strings.secure_screen_summary)),
) )
} }
// SY --> // SY -->
enum class DayOption(val day: Int, val stringRes: Int) { enum class DayOption(val day: Int, val stringRes: StringResource) {
Sunday(SecureActivityDelegate.LOCK_SUNDAY, R.string.sunday), Sunday(SecureActivityDelegate.LOCK_SUNDAY, SYMR.strings.sunday),
Monday(SecureActivityDelegate.LOCK_MONDAY, R.string.monday), Monday(SecureActivityDelegate.LOCK_MONDAY, SYMR.strings.monday),
Tuesday(SecureActivityDelegate.LOCK_TUESDAY, R.string.tuesday), Tuesday(SecureActivityDelegate.LOCK_TUESDAY, SYMR.strings.tuesday),
Wednesday(SecureActivityDelegate.LOCK_WEDNESDAY, R.string.wednesday), Wednesday(SecureActivityDelegate.LOCK_WEDNESDAY, SYMR.strings.wednesday),
Thursday(SecureActivityDelegate.LOCK_THURSDAY, R.string.thursday), Thursday(SecureActivityDelegate.LOCK_THURSDAY, SYMR.strings.thursday),
Friday(SecureActivityDelegate.LOCK_FRIDAY, R.string.friday), Friday(SecureActivityDelegate.LOCK_FRIDAY, SYMR.strings.friday),
Saturday(SecureActivityDelegate.LOCK_SATURDAY, R.string.saturday), Saturday(SecureActivityDelegate.LOCK_SATURDAY, SYMR.strings.saturday),
} }
@Composable @Composable
@ -224,7 +225,7 @@ object SettingsSecurityScreen : SearchableSettings {
} }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.biometric_lock_days)) }, title = { Text(text = stringResource(SYMR.strings.biometric_lock_days)) },
text = { text = {
LazyColumn { LazyColumn {
DayOption.values().forEach { day -> DayOption.values().forEach { day ->
@ -269,12 +270,12 @@ object SettingsSecurityScreen : SearchableSettings {
) )
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )
@ -290,15 +291,15 @@ object SettingsSecurityScreen : SearchableSettings {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.cbz_archive_password)) }, title = { Text(text = stringResource(SYMR.strings.cbz_archive_password)) },
text = { text = {
TextField( TextField(
value = password, value = password,
onValueChange = { password = it }, onValueChange = { password = it },
maxLines = 1, maxLines = 1,
placeholder = { Text(text = stringResource(R.string.password)) }, placeholder = { Text(text = stringResource(MR.strings.password)) },
label = { Text(text = stringResource(R.string.password)) }, label = { Text(text = stringResource(MR.strings.password)) },
trailingIcon = { trailingIcon = {
IconButton( IconButton(
onClick = { onClick = {
@ -344,12 +345,12 @@ object SettingsSecurityScreen : SearchableSettings {
onReturnPassword(password) onReturnPassword(password)
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )

View File

@ -47,7 +47,7 @@ import tachiyomi.i18n.MR
import tachiyomi.presentation.core.components.LinkIcon import tachiyomi.presentation.core.components.LinkIcon
import tachiyomi.presentation.core.components.ScrollbarLazyColumn import tachiyomi.presentation.core.components.ScrollbarLazyColumn
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.localize import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.icons.CustomIcons import tachiyomi.presentation.core.icons.CustomIcons
import tachiyomi.presentation.core.icons.Discord import tachiyomi.presentation.core.icons.Discord
import tachiyomi.presentation.core.icons.Facebook import tachiyomi.presentation.core.icons.Facebook
@ -79,7 +79,7 @@ object AboutScreen : Screen() {
Scaffold( Scaffold(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
title = localize(MR.strings.pref_category_about), title = stringResource(MR.strings.pref_category_about),
navigateUp = if (handleBack != null) handleBack::invoke else null, navigateUp = if (handleBack != null) handleBack::invoke else null,
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
) )
@ -94,7 +94,7 @@ object AboutScreen : Screen() {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.strings.version), title = stringResource(MR.strings.version),
subtitle = getVersionName(withBuildDate = true), subtitle = getVersionName(withBuildDate = true),
onPreferenceClick = { onPreferenceClick = {
val deviceInfo = CrashLogUtil(context).getDebugInfo() val deviceInfo = CrashLogUtil(context).getDebugInfo()
@ -106,7 +106,7 @@ object AboutScreen : Screen() {
if (BuildConfig.INCLUDE_UPDATER) { if (BuildConfig.INCLUDE_UPDATER) {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.strings.check_for_updates), title = stringResource(MR.strings.check_for_updates),
widget = { widget = {
AnimatedVisibility(visible = isCheckingUpdates) { AnimatedVisibility(visible = isCheckingUpdates) {
CircularProgressIndicator( CircularProgressIndicator(
@ -145,7 +145,7 @@ object AboutScreen : Screen() {
if (!BuildConfig.DEBUG) { if (!BuildConfig.DEBUG) {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.string.whats_new), title = stringResource(MR.strings.whats_new),
// SY --> // SY -->
onPreferenceClick = { showWhatsNewDialog = true }, onPreferenceClick = { showWhatsNewDialog = true },
// SY <-- // SY <--
@ -155,21 +155,21 @@ object AboutScreen : Screen() {
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.strings.help_translate), title = stringResource(MR.strings.help_translate),
onPreferenceClick = { uriHandler.openUri("https://tachiyomi.org/docs/contribute#translation") }, onPreferenceClick = { uriHandler.openUri("https://tachiyomi.org/docs/contribute#translation") },
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.strings.licenses), title = stringResource(MR.strings.licenses),
onPreferenceClick = { navigator.push(OpenSourceLicensesScreen()) }, onPreferenceClick = { navigator.push(OpenSourceLicensesScreen()) },
) )
} }
item { item {
TextPreferenceWidget( TextPreferenceWidget(
title = localize(MR.strings.privacy_policy), title = stringResource(MR.strings.privacy_policy),
onPreferenceClick = { uriHandler.openUri("https://tachiyomi.org/privacy/") }, onPreferenceClick = { uriHandler.openUri("https://tachiyomi.org/privacy/") },
) )
} }
@ -182,7 +182,7 @@ object AboutScreen : Screen() {
horizontalArrangement = Arrangement.Center, horizontalArrangement = Arrangement.Center,
) { ) {
LinkIcon( LinkIcon(
label = localize(MR.strings.website), label = stringResource(MR.strings.website),
icon = Icons.Outlined.Public, icon = Icons.Outlined.Public,
url = "https://tachiyomi.org", url = "https://tachiyomi.org",
) )

View File

@ -17,7 +17,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.produceState import androidx.compose.runtime.produceState
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.AnnotatedString import androidx.compose.ui.text.AnnotatedString
import androidx.compose.ui.text.SpanStyle import androidx.compose.ui.text.SpanStyle
import androidx.compose.ui.text.buildAnnotatedString import androidx.compose.ui.text.buildAnnotatedString
@ -31,7 +30,10 @@ import nl.adaptivity.xmlutil.serialization.XML
import nl.adaptivity.xmlutil.serialization.XmlSerialName import nl.adaptivity.xmlutil.serialization.XmlSerialName
import nl.adaptivity.xmlutil.serialization.XmlValue import nl.adaptivity.xmlutil.serialization.XmlValue
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun WhatsNewDialog(onDismissRequest: () -> Unit) { fun WhatsNewDialog(onDismissRequest: () -> Unit) {
@ -39,11 +41,11 @@ fun WhatsNewDialog(onDismissRequest: () -> Unit) {
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
confirmButton = { confirmButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
title = { title = {
Text(text = stringResource(R.string.whats_new)) Text(text = stringResource(MR.strings.whats_new))
}, },
text = { text = {
Column { Column {
@ -67,7 +69,7 @@ fun WhatsNewDialog(onDismissRequest: () -> Unit) {
items(changelog.orEmpty()) { changelog -> items(changelog.orEmpty()) { changelog ->
Column(Modifier.fillMaxWidth()) { Column(Modifier.fillMaxWidth()) {
Text( Text(
text = stringResource(R.string.changelog_version, changelog.version), text = stringResource(SYMR.strings.changelog_version, changelog.version),
color = MaterialTheme.colorScheme.primary, color = MaterialTheme.colorScheme.primary,
fontWeight = FontWeight.Bold, fontWeight = FontWeight.Bold,
style = MaterialTheme.typography.titleSmall, style = MaterialTheme.typography.titleSmall,

View File

@ -30,7 +30,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.util.fastMap import androidx.compose.ui.util.fastMap
import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.StateScreenModel
@ -42,7 +41,6 @@ import eu.kanade.presentation.browse.components.SourceIcon
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.collectLatest
@ -54,8 +52,11 @@ import tachiyomi.data.Database
import tachiyomi.domain.source.interactor.GetSourcesWithNonLibraryManga import tachiyomi.domain.source.interactor.GetSourcesWithNonLibraryManga
import tachiyomi.domain.source.model.Source import tachiyomi.domain.source.model.Source
import tachiyomi.domain.source.model.SourceWithCount import tachiyomi.domain.source.model.SourceWithCount
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.screens.EmptyScreen import tachiyomi.presentation.core.screens.EmptyScreen
import tachiyomi.presentation.core.screens.LoadingScreen import tachiyomi.presentation.core.screens.LoadingScreen
import tachiyomi.presentation.core.util.selectedBackground import tachiyomi.presentation.core.util.selectedBackground
@ -90,26 +91,26 @@ class ClearDatabaseScreen : Screen() {
// SY <-- // SY <--
model.clearSelection() model.clearSelection()
model.hideConfirmation() model.hideConfirmation()
context.toast(R.string.clear_database_completed) context.toast(MR.strings.clear_database_completed)
} }
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = model::hideConfirmation) { TextButton(onClick = model::hideConfirmation) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
text = { text = {
// SY --> // SY -->
Column { Column {
// SY <-- // SY <--
Text(text = stringResource(R.string.clear_database_confirmation)) Text(text = stringResource(MR.strings.clear_database_confirmation))
// SY --> // SY -->
LabeledCheckbox( LabeledCheckbox(
label = stringResource(R.string.clear_db_exclude_read), label = stringResource(SYMR.strings.clear_db_exclude_read),
checked = keepReadManga, checked = keepReadManga,
onCheckedChange = { keepReadManga = it }, onCheckedChange = { keepReadManga = it },
) )
@ -122,19 +123,19 @@ class ClearDatabaseScreen : Screen() {
Scaffold( Scaffold(
topBar = { scrollBehavior -> topBar = { scrollBehavior ->
AppBar( AppBar(
title = stringResource(R.string.pref_clear_database), title = stringResource(MR.strings.pref_clear_database),
navigateUp = navigator::pop, navigateUp = navigator::pop,
actions = { actions = {
if (s.items.isNotEmpty()) { if (s.items.isNotEmpty()) {
AppBarActions( AppBarActions(
actions = persistentListOf( actions = persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_select_all), title = stringResource(MR.strings.action_select_all),
icon = Icons.Outlined.SelectAll, icon = Icons.Outlined.SelectAll,
onClick = model::selectAll, onClick = model::selectAll,
), ),
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_select_all), title = stringResource(MR.strings.action_select_all),
icon = Icons.Outlined.FlipToBack, icon = Icons.Outlined.FlipToBack,
onClick = model::invertSelection, onClick = model::invertSelection,
), ),
@ -148,7 +149,7 @@ class ClearDatabaseScreen : Screen() {
) { contentPadding -> ) { contentPadding ->
if (s.items.isEmpty()) { if (s.items.isEmpty()) {
EmptyScreen( EmptyScreen(
message = stringResource(R.string.database_clean), message = stringResource(MR.strings.database_clean),
modifier = Modifier.padding(contentPadding), modifier = Modifier.padding(contentPadding),
) )
} else { } else {
@ -180,7 +181,7 @@ class ClearDatabaseScreen : Screen() {
enabled = s.selection.isNotEmpty(), enabled = s.selection.isNotEmpty(),
) { ) {
Text( Text(
text = stringResource(R.string.action_delete), text = stringResource(MR.strings.action_delete),
color = MaterialTheme.colorScheme.onPrimary, color = MaterialTheme.colorScheme.onPrimary,
) )
} }
@ -216,7 +217,7 @@ class ClearDatabaseScreen : Screen() {
text = source.visualName, text = source.visualName,
style = MaterialTheme.typography.bodyMedium, style = MaterialTheme.typography.bodyMedium,
) )
Text(text = stringResource(R.string.clear_database_source_item_count, count)) Text(text = stringResource(MR.strings.clear_database_source_item_count, count))
} }
Checkbox( Checkbox(
checked = isSelected, checked = isSelected,

View File

@ -22,7 +22,6 @@ import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import cafe.adriel.voyager.core.model.StateScreenModel import cafe.adriel.voyager.core.model.StateScreenModel
import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.model.rememberScreenModel
@ -30,7 +29,6 @@ import cafe.adriel.voyager.navigator.LocalNavigator
import cafe.adriel.voyager.navigator.currentOrThrow import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.backup.BackupCreateFlags import eu.kanade.tachiyomi.data.backup.BackupCreateFlags
import eu.kanade.tachiyomi.data.backup.BackupCreateJob import eu.kanade.tachiyomi.data.backup.BackupCreateJob
import eu.kanade.tachiyomi.data.backup.models.Backup import eu.kanade.tachiyomi.data.backup.models.Backup
@ -41,9 +39,12 @@ import kotlinx.collections.immutable.minus
import kotlinx.collections.immutable.plus import kotlinx.collections.immutable.plus
import kotlinx.collections.immutable.toPersistentSet import kotlinx.collections.immutable.toPersistentSet
import kotlinx.coroutines.flow.update import kotlinx.coroutines.flow.update
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.LabeledCheckbox import tachiyomi.presentation.core.components.LabeledCheckbox
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
class CreateBackupScreen : Screen() { class CreateBackupScreen : Screen() {
@ -71,7 +72,7 @@ class CreateBackupScreen : Screen() {
Scaffold( Scaffold(
topBar = { topBar = {
AppBar( AppBar(
title = stringResource(R.string.pref_create_backup), title = stringResource(MR.strings.pref_create_backup),
navigateUp = navigator::pop, navigateUp = navigator::pop,
scrollBehavior = it, scrollBehavior = it,
) )
@ -89,7 +90,7 @@ class CreateBackupScreen : Screen() {
) { ) {
item { item {
LabeledCheckbox( LabeledCheckbox(
label = stringResource(R.string.manga), label = stringResource(MR.strings.manga),
checked = true, checked = true,
onCheckedChange = {}, onCheckedChange = {},
enabled = false, enabled = false,
@ -117,20 +118,20 @@ class CreateBackupScreen : Screen() {
onClick = { onClick = {
if (!BackupCreateJob.isManualJobRunning(context)) { if (!BackupCreateJob.isManualJobRunning(context)) {
if (DeviceUtil.isMiui && DeviceUtil.isMiuiOptimizationDisabled()) { if (DeviceUtil.isMiui && DeviceUtil.isMiuiOptimizationDisabled()) {
context.toast(R.string.restore_miui_warning, Toast.LENGTH_LONG) context.toast(MR.strings.restore_miui_warning, Toast.LENGTH_LONG)
} }
try { try {
chooseBackupDir.launch(Backup.getFilename()) chooseBackupDir.launch(Backup.getFilename())
} catch (e: ActivityNotFoundException) { } catch (e: ActivityNotFoundException) {
context.toast(R.string.file_picker_error) context.toast(MR.strings.file_picker_error)
} }
} else { } else {
context.toast(R.string.backup_in_progress) context.toast(MR.strings.backup_in_progress)
} }
}, },
) { ) {
Text( Text(
text = stringResource(R.string.action_create), text = stringResource(MR.strings.action_create),
color = MaterialTheme.colorScheme.onPrimary, color = MaterialTheme.colorScheme.onPrimary,
) )
} }
@ -163,14 +164,14 @@ private class CreateBackupScreenModel : StateScreenModel<CreateBackupScreenModel
} }
private val BackupChoices = mapOf( private val BackupChoices = mapOf(
BackupCreateFlags.BACKUP_CATEGORY to R.string.categories, BackupCreateFlags.BACKUP_CATEGORY to MR.strings.categories,
BackupCreateFlags.BACKUP_CHAPTER to R.string.chapters, BackupCreateFlags.BACKUP_CHAPTER to MR.strings.chapters,
BackupCreateFlags.BACKUP_TRACK to R.string.track, BackupCreateFlags.BACKUP_TRACK to MR.strings.track,
BackupCreateFlags.BACKUP_HISTORY to R.string.history, BackupCreateFlags.BACKUP_HISTORY to MR.strings.history,
BackupCreateFlags.BACKUP_APP_PREFS to R.string.app_settings, BackupCreateFlags.BACKUP_APP_PREFS to MR.strings.app_settings,
BackupCreateFlags.BACKUP_SOURCE_PREFS to R.string.source_settings, BackupCreateFlags.BACKUP_SOURCE_PREFS to MR.strings.source_settings,
// SY --> // SY -->
BackupCreateFlags.BACKUP_CUSTOM_INFO to R.string.custom_entry_info, BackupCreateFlags.BACKUP_CUSTOM_INFO to SYMR.strings.custom_entry_info,
BackupCreateFlags.BACKUP_READ_MANGA to R.string.all_read_entries, BackupCreateFlags.BACKUP_READ_MANGA to SYMR.strings.all_read_entries,
// SY <-- // SY <--
) )

View File

@ -19,6 +19,7 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel
import eu.kanade.tachiyomi.util.lang.toRelativeString import eu.kanade.tachiyomi.util.lang.toRelativeString
import exh.metadata.MetadataUtil import exh.metadata.MetadataUtil
import exh.source.isEhBasedManga import exh.source.isEhBasedManga
import kotlinx.collections.immutable.ImmutableList
import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.library.service.LibraryPreferences import tachiyomi.domain.library.service.LibraryPreferences
import java.util.Date import java.util.Date
@ -27,7 +28,7 @@ import java.util.Date
fun ChapterListDialog( fun ChapterListDialog(
onDismissRequest: () -> Unit, onDismissRequest: () -> Unit,
screenModel: ReaderSettingsScreenModel, screenModel: ReaderSettingsScreenModel,
chapters: List<ReaderChapterItem>, chapters: ImmutableList<ReaderChapterItem>,
onClickChapter: (Chapter) -> Unit, onClickChapter: (Chapter) -> Unit,
onBookmark: (Chapter) -> Unit, onBookmark: (Chapter) -> Unit,
dateRelativeTime: Boolean, dateRelativeTime: Boolean,

View File

@ -18,12 +18,13 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.components.AdaptiveSheet import eu.kanade.presentation.components.AdaptiveSheet
import eu.kanade.tachiyomi.R import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.ActionButton import tachiyomi.presentation.core.components.ActionButton
import tachiyomi.presentation.core.components.material.padding import tachiyomi.presentation.core.components.material.padding
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun ReaderPageActionsDialog( fun ReaderPageActionsDialog(
@ -54,9 +55,9 @@ fun ReaderPageActionsDialog(
title = stringResource( title = stringResource(
// SY --> // SY -->
if (hasExtraPage) { if (hasExtraPage) {
R.string.action_set_first_page_cover SYMR.strings.action_set_first_page_cover
} else { } else {
R.string.set_as_cover MR.strings.set_as_cover
}, },
// SY <-- // SY <--
), ),
@ -68,9 +69,9 @@ fun ReaderPageActionsDialog(
title = stringResource( title = stringResource(
// SY --> // SY -->
if (hasExtraPage) { if (hasExtraPage) {
R.string.action_share_first_page SYMR.strings.action_share_first_page
} else { } else {
R.string.action_share MR.strings.action_share
}, },
// SY <-- // SY <--
), ),
@ -88,9 +89,9 @@ fun ReaderPageActionsDialog(
title = stringResource( title = stringResource(
// SY --> // SY -->
if (hasExtraPage) { if (hasExtraPage) {
R.string.action_save_first_page SYMR.strings.action_save_first_page
} else { } else {
R.string.action_save MR.strings.action_save
}, },
// SY <-- // SY <--
), ),
@ -109,7 +110,7 @@ fun ReaderPageActionsDialog(
) { ) {
ActionButton( ActionButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
title = stringResource(R.string.action_set_second_page_cover), title = stringResource(SYMR.strings.action_set_second_page_cover),
icon = Icons.Outlined.Photo, icon = Icons.Outlined.Photo,
onClick = { onClick = {
showSetCoverDialog = true showSetCoverDialog = true
@ -117,7 +118,7 @@ fun ReaderPageActionsDialog(
) )
ActionButton( ActionButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
title = stringResource(R.string.action_share_second_page), title = stringResource(SYMR.strings.action_share_second_page),
icon = Icons.Outlined.Share, icon = Icons.Outlined.Share,
onClick = { onClick = {
onShare(true) onShare(true)
@ -126,7 +127,7 @@ fun ReaderPageActionsDialog(
) )
ActionButton( ActionButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
title = stringResource(R.string.action_save_second_page), title = stringResource(SYMR.strings.action_save_second_page),
icon = Icons.Outlined.Save, icon = Icons.Outlined.Save,
onClick = { onClick = {
onSave(true) onSave(true)
@ -139,7 +140,7 @@ fun ReaderPageActionsDialog(
) { ) {
ActionButton( ActionButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
title = stringResource(R.string.action_share_combined_page), title = stringResource(SYMR.strings.action_share_combined_page),
icon = Icons.Outlined.Share, icon = Icons.Outlined.Share,
onClick = { onClick = {
onShareCombined() onShareCombined()
@ -148,7 +149,7 @@ fun ReaderPageActionsDialog(
) )
ActionButton( ActionButton(
modifier = Modifier.weight(1f), modifier = Modifier.weight(1f),
title = stringResource(R.string.action_save_combined_page), title = stringResource(SYMR.strings.action_save_combined_page),
icon = Icons.Outlined.Save, icon = Icons.Outlined.Save,
onClick = { onClick = {
onSaveCombined() onSaveCombined()
@ -181,16 +182,16 @@ private fun SetCoverDialog(
) { ) {
AlertDialog( AlertDialog(
text = { text = {
Text(stringResource(R.string.confirm_set_image_as_cover)) Text(stringResource(MR.strings.confirm_set_image_as_cover))
}, },
confirmButton = { confirmButton = {
TextButton(onClick = onConfirm) { TextButton(onClick = onConfirm) {
Text(stringResource(R.string.action_ok)) Text(stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismiss) { TextButton(onClick = onDismiss) {
Text(stringResource(R.string.action_cancel)) Text(stringResource(MR.strings.action_cancel))
} }
}, },
onDismissRequest = onDismiss, onDismissRequest = onDismiss,

View File

@ -22,13 +22,15 @@ import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.reader.setting.ReaderBottomButton import eu.kanade.tachiyomi.ui.reader.setting.ReaderBottomButton
import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import kotlinx.collections.immutable.ImmutableSet
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.localize import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun BottomReaderBar( fun BottomReaderBar(
// SY --> // SY -->
enabledButtons: Set<String>, enabledButtons: ImmutableSet<String>,
// SY <-- // SY <--
backgroundColor: Color, backgroundColor: Color,
readingMode: ReadingMode, readingMode: ReadingMode,
@ -61,7 +63,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickChapterList) { IconButton(onClick = onClickChapterList) {
Icon( Icon(
imageVector = Icons.Outlined.FormatListNumbered, imageVector = Icons.Outlined.FormatListNumbered,
contentDescription = localize(MR.strings.chapters), contentDescription = stringResource(MR.strings.chapters),
) )
} }
} }
@ -70,7 +72,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickWebView) { IconButton(onClick = onClickWebView) {
Icon( Icon(
imageVector = Icons.Outlined.Public, imageVector = Icons.Outlined.Public,
contentDescription = localize(MR.strings.action_open_in_web_view), contentDescription = stringResource(MR.strings.action_open_in_web_view),
) )
} }
} }
@ -79,7 +81,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickShare) { IconButton(onClick = onClickShare) {
Icon( Icon(
imageVector = Icons.Outlined.Share, imageVector = Icons.Outlined.Share,
contentDescription = localize(MR.strings.action_share), contentDescription = stringResource(MR.strings.action_share),
) )
} }
} }
@ -88,7 +90,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickReadingMode) { IconButton(onClick = onClickReadingMode) {
Icon( Icon(
painter = painterResource(readingMode.iconRes), painter = painterResource(readingMode.iconRes),
contentDescription = localize(MR.strings.viewer), contentDescription = stringResource(MR.strings.viewer),
) )
} }
} }
@ -97,7 +99,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickOrientation) { IconButton(onClick = onClickOrientation) {
Icon( Icon(
painter = painterResource(orientation.iconRes), painter = painterResource(orientation.iconRes),
contentDescription = localize(MR.strings.pref_rotation_type), contentDescription = stringResource(MR.strings.pref_rotation_type),
) )
} }
} }
@ -111,7 +113,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickCropBorder) { IconButton(onClick = onClickCropBorder) {
Icon( Icon(
painter = painterResource(if (cropEnabled) R.drawable.ic_crop_24dp else R.drawable.ic_crop_off_24dp), painter = painterResource(if (cropEnabled) R.drawable.ic_crop_24dp else R.drawable.ic_crop_off_24dp),
contentDescription = localize(MR.strings.pref_crop_borders), contentDescription = stringResource(MR.strings.pref_crop_borders),
) )
} }
} }
@ -124,7 +126,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickPageLayout) { IconButton(onClick = onClickPageLayout) {
Icon( Icon(
painter = painterResource(R.drawable.ic_book_open_variant_24dp), painter = painterResource(R.drawable.ic_book_open_variant_24dp),
contentDescription = localize(MR.strings.page_layout), contentDescription = stringResource(SYMR.strings.page_layout),
) )
} }
} }
@ -133,7 +135,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickShiftPage) { IconButton(onClick = onClickShiftPage) {
Icon( Icon(
painter = painterResource(R.drawable.ic_page_next_outline_24dp), painter = painterResource(R.drawable.ic_page_next_outline_24dp),
contentDescription = localize(MR.strings.shift_double_pages), contentDescription = stringResource(SYMR.strings.shift_double_pages),
) )
} }
} }
@ -141,7 +143,7 @@ fun BottomReaderBar(
IconButton(onClick = onClickSettings) { IconButton(onClick = onClickSettings) {
Icon( Icon(
imageVector = Icons.Outlined.Settings, imageVector = Icons.Outlined.Settings,
contentDescription = localize(MR.stringss.action_settings), contentDescription = stringResource(MR.strings.action_settings),
) )
} }
// SY <-- // SY <--

View File

@ -32,18 +32,17 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.font.FontFamily import androidx.compose.ui.text.font.FontFamily
import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.font.FontWeight
import androidx.compose.ui.text.input.KeyboardType import androidx.compose.ui.text.input.KeyboardType
import androidx.compose.ui.tooling.preview.PreviewLightDark import androidx.compose.ui.tooling.preview.PreviewLightDark
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp import androidx.compose.ui.unit.sp
import eu.kanade.tachiyomi.R import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun ExhUtils( fun ExhUtils(
modifier: Modifier = Modifier,
isVisible: Boolean, isVisible: Boolean,
onSetExhUtilsVisibility: (Boolean) -> Unit, onSetExhUtilsVisibility: (Boolean) -> Unit,
backgroundColor: Color, backgroundColor: Color,
@ -57,6 +56,7 @@ fun ExhUtils(
onClickRetryAllHelp: () -> Unit, onClickRetryAllHelp: () -> Unit,
onClickBoostPage: () -> Unit, onClickBoostPage: () -> Unit,
onClickBoostPageHelp: () -> Unit, onClickBoostPageHelp: () -> Unit,
modifier: Modifier = Modifier,
) { ) {
Column( Column(
modifier modifier
@ -80,7 +80,7 @@ fun ExhUtils(
verticalAlignment = Alignment.CenterVertically, verticalAlignment = Alignment.CenterVertically,
) { ) {
Text( Text(
text = stringResource(R.string.eh_autoscroll), text = stringResource(SYMR.strings.eh_autoscroll),
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
fontSize = 13.sp, fontSize = 13.sp,
fontFamily = FontFamily.SansSerif, fontFamily = FontFamily.SansSerif,
@ -123,7 +123,7 @@ fun ExhUtils(
) )
AnimatedVisibility(!isAutoScrollEnabled) { AnimatedVisibility(!isAutoScrollEnabled) {
Text( Text(
text = stringResource(R.string.eh_autoscroll_freq_invalid), text = stringResource(SYMR.strings.eh_autoscroll_freq_invalid),
color = MaterialTheme.colorScheme.error, color = MaterialTheme.colorScheme.error,
style = MaterialTheme.typography.labelSmall, style = MaterialTheme.typography.labelSmall,
) )
@ -156,7 +156,7 @@ fun ExhUtils(
modifier = Modifier.weight(3f), modifier = Modifier.weight(3f),
) { ) {
Text( Text(
text = stringResource(R.string.eh_retry_all), text = stringResource(SYMR.strings.eh_retry_all),
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
fontSize = 13.sp, fontSize = 13.sp,
fontFamily = FontFamily.SansSerif, fontFamily = FontFamily.SansSerif,
@ -184,7 +184,7 @@ fun ExhUtils(
modifier = Modifier.weight(3f), modifier = Modifier.weight(3f),
) { ) {
Text( Text(
text = stringResource(R.string.eh_boost_page), text = stringResource(SYMR.strings.eh_boost_page),
color = MaterialTheme.colorScheme.onSurface, color = MaterialTheme.colorScheme.onSurface,
fontSize = 13.sp, fontSize = 13.sp,
fontFamily = FontFamily.SansSerif, fontFamily = FontFamily.SansSerif,

View File

@ -33,7 +33,7 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderOrientation
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import eu.kanade.tachiyomi.ui.reader.viewer.Viewer import eu.kanade.tachiyomi.ui.reader.viewer.Viewer
import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer import eu.kanade.tachiyomi.ui.reader.viewer.pager.R2LPagerViewer
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.ImmutableSet
private val animationSpec = tween<IntOffset>(200) private val animationSpec = tween<IntOffset>(200)
@ -106,7 +106,7 @@ fun ReaderAppBars(
onClickBoostPageHelp: () -> Unit, onClickBoostPageHelp: () -> Unit,
navBarType: NavBarType, navBarType: NavBarType,
currentPageText: String, currentPageText: String,
enabledButtons: Set<String>, enabledButtons: ImmutableSet<String>,
dualPageSplitEnabled: Boolean, dualPageSplitEnabled: Boolean,
doublePages: Boolean, doublePages: Boolean,
onClickChapterList: () -> Unit, onClickChapterList: () -> Unit,
@ -215,20 +215,20 @@ fun ReaderAppBars(
listOfNotNull( listOfNotNull(
AppBar.Action( AppBar.Action(
title = stringResource( title = stringResource(
if (bookmarked) R.string.action_remove_bookmark else R.string.action_bookmark if (bookmarked) MR.strings.action_remove_bookmark else MR.strings.action_bookmark
), ),
icon = if (bookmarked) Icons.Outlined.Bookmark else Icons.Outlined.BookmarkBorder, icon = if (bookmarked) Icons.Outlined.Bookmark else Icons.Outlined.BookmarkBorder,
onClick = onToggleBookmarked, onClick = onToggleBookmarked,
), ),
onOpenInWebView?.let { onOpenInWebView?.let {
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_open_in_web_view), title = stringResource(MR.strings.action_open_in_web_view),
onClick = it, onClick = it,
) )
}, },
onShare?.let { onShare?.let {
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.action_share), title = stringResource(MR.strings.action_share),
onClick = it, onClick = it,
) )
}, },

View File

@ -36,12 +36,12 @@ import androidx.compose.ui.hapticfeedback.HapticFeedbackType
import androidx.compose.ui.layout.layout import androidx.compose.ui.layout.layout
import androidx.compose.ui.platform.LocalHapticFeedback import androidx.compose.ui.platform.LocalHapticFeedback
import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Constraints import androidx.compose.ui.unit.Constraints
import androidx.compose.ui.unit.LayoutDirection import androidx.compose.ui.unit.LayoutDirection
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import eu.kanade.presentation.util.isTabletUi import eu.kanade.presentation.util.isTabletUi
import eu.kanade.tachiyomi.R import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
import kotlin.math.roundToInt import kotlin.math.roundToInt
@Composable @Composable
@ -104,7 +104,7 @@ fun ChapterNavigator(
Icon( Icon(
imageVector = Icons.Outlined.SkipPrevious, imageVector = Icons.Outlined.SkipPrevious,
contentDescription = stringResource( contentDescription = stringResource(
if (isRtl) R.string.action_next_chapter else R.string.action_previous_chapter, if (isRtl) MR.strings.action_next_chapter else MR.strings.action_previous_chapter,
), ),
) )
} }
@ -158,7 +158,7 @@ fun ChapterNavigator(
Icon( Icon(
imageVector = Icons.Outlined.SkipNext, imageVector = Icons.Outlined.SkipNext,
contentDescription = stringResource( contentDescription = stringResource(
if (isRtl) R.string.action_previous_chapter else R.string.action_next_chapter, if (isRtl) MR.strings.action_previous_chapter else MR.strings.action_next_chapter,
), ),
) )
} }
@ -206,7 +206,7 @@ fun ChapterNavigatorVert(
) { ) {
Icon( Icon(
imageVector = Icons.Outlined.SkipPrevious, imageVector = Icons.Outlined.SkipPrevious,
contentDescription = stringResource(R.string.action_previous_chapter), contentDescription = stringResource(MR.strings.action_previous_chapter),
modifier = Modifier.rotate(90f), modifier = Modifier.rotate(90f),
) )
} }
@ -274,7 +274,7 @@ fun ChapterNavigatorVert(
) { ) {
Icon( Icon(
imageVector = Icons.Outlined.SkipNext, imageVector = Icons.Outlined.SkipNext,
contentDescription = stringResource(R.string.action_next_chapter), contentDescription = stringResource(MR.strings.action_next_chapter),
modifier = Modifier.rotate(90f), modifier = Modifier.rotate(90f),
) )
} }

View File

@ -5,24 +5,25 @@ import androidx.compose.material3.FilterChip
import androidx.compose.material3.Text import androidx.compose.material3.Text
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.SettingsChipRow import tachiyomi.presentation.core.components.SettingsChipRow
import tachiyomi.presentation.core.i18n.stringResource
import tachiyomi.presentation.core.util.collectAsState import tachiyomi.presentation.core.util.collectAsState
private val themes = listOf( private val themes = listOf(
R.string.black_background to 1, MR.strings.black_background to 1,
R.string.gray_background to 2, MR.strings.gray_background to 2,
R.string.white_background to 0, MR.strings.white_background to 0,
R.string.automatic_background to 3, MR.strings.automatic_background to 3,
) )
@Composable @Composable
internal fun ColumnScope.GeneralPage(screenModel: ReaderSettingsScreenModel) { internal fun ColumnScope.GeneralPage(screenModel: ReaderSettingsScreenModel) {
val readerTheme by screenModel.preferences.readerTheme().collectAsState() val readerTheme by screenModel.preferences.readerTheme().collectAsState()
SettingsChipRow(R.string.pref_reader_theme) { SettingsChipRow(MR.strings.pref_reader_theme) {
themes.map { (labelRes, value) -> themes.map { (labelRes, value) ->
FilterChip( FilterChip(
selected = readerTheme == value, selected = readerTheme == value,
@ -33,71 +34,71 @@ internal fun ColumnScope.GeneralPage(screenModel: ReaderSettingsScreenModel) {
} }
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_show_page_number), label = stringResource(MR.strings.pref_show_page_number),
pref = screenModel.preferences.showPageNumber(), pref = screenModel.preferences.showPageNumber(),
) )
// SY --> // SY -->
val forceHorizontalSeekbar by screenModel.preferences.forceHorizontalSeekbar().collectAsState() val forceHorizontalSeekbar by screenModel.preferences.forceHorizontalSeekbar().collectAsState()
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_force_horz_seekbar), label = stringResource(SYMR.strings.pref_force_horz_seekbar),
pref = screenModel.preferences.forceHorizontalSeekbar(), pref = screenModel.preferences.forceHorizontalSeekbar(),
) )
if (!forceHorizontalSeekbar) { if (!forceHorizontalSeekbar) {
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_show_vert_seekbar_landscape), label = stringResource(SYMR.strings.pref_show_vert_seekbar_landscape),
pref = screenModel.preferences.landscapeVerticalSeekbar(), pref = screenModel.preferences.landscapeVerticalSeekbar(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_left_handed_vertical_seekbar), label = stringResource(SYMR.strings.pref_left_handed_vertical_seekbar),
pref = screenModel.preferences.leftVerticalSeekbar(), pref = screenModel.preferences.leftVerticalSeekbar(),
) )
} }
// SY <-- // SY <--
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_fullscreen), label = stringResource(MR.strings.pref_fullscreen),
pref = screenModel.preferences.fullscreen(), pref = screenModel.preferences.fullscreen(),
) )
if (screenModel.hasDisplayCutout) { if (screenModel.hasDisplayCutout) {
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_cutout_short), label = stringResource(MR.strings.pref_cutout_short),
pref = screenModel.preferences.cutoutShort(), pref = screenModel.preferences.cutoutShort(),
) )
} }
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_keep_screen_on), label = stringResource(MR.strings.pref_keep_screen_on),
pref = screenModel.preferences.keepScreenOn(), pref = screenModel.preferences.keepScreenOn(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_read_with_long_tap), label = stringResource(MR.strings.pref_read_with_long_tap),
pref = screenModel.preferences.readWithLongTap(), pref = screenModel.preferences.readWithLongTap(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_always_show_chapter_transition), label = stringResource(MR.strings.pref_always_show_chapter_transition),
pref = screenModel.preferences.alwaysShowChapterTransition(), pref = screenModel.preferences.alwaysShowChapterTransition(),
) )
// SY --> // SY -->
/*CheckboxItem( /*CheckboxItem(
label = stringResource(R.string.pref_page_transitions), label = stringResource(MR.strings.pref_page_transitions),
pref = screenModel.preferences.pageTransitions(), pref = screenModel.preferences.pageTransitions(),
) SY <-- */ ) SY <-- */
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_flash_page), label = stringResource(MR.strings.pref_flash_page),
pref = screenModel.preferences.flashOnPageChange(), pref = screenModel.preferences.flashOnPageChange(),
) )
// SY --> // SY -->
CheckboxItem( CheckboxItem(
label = stringResource(R.string.auto_webtoon_mode), label = stringResource(SYMR.strings.auto_webtoon_mode),
pref = screenModel.preferences.useAutoWebtoon(), pref = screenModel.preferences.useAutoWebtoon(),
) )
// SY <-- // SY <--

View File

@ -15,6 +15,7 @@ import eu.kanade.tachiyomi.ui.reader.setting.ReaderSettingsScreenModel
import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode import eu.kanade.tachiyomi.ui.reader.setting.ReadingMode
import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer import eu.kanade.tachiyomi.ui.reader.viewer.webtoon.WebtoonViewer
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.CheckboxItem import tachiyomi.presentation.core.components.CheckboxItem
import tachiyomi.presentation.core.components.HeadingItem import tachiyomi.presentation.core.components.HeadingItem
import tachiyomi.presentation.core.components.SettingsChipRow import tachiyomi.presentation.core.components.SettingsChipRow
@ -98,7 +99,7 @@ private fun ColumnScope.PagerViewerSettings(screenModel: ReaderSettingsScreenMod
// SY --> // SY -->
val pageLayout by screenModel.preferences.pageLayout().collectAsState() val pageLayout by screenModel.preferences.pageLayout().collectAsState()
SettingsChipRow(R.string.page_layout) { SettingsChipRow(SYMR.strings.page_layout) {
ReaderPreferences.PageLayouts.mapIndexed { index, it -> ReaderPreferences.PageLayouts.mapIndexed { index, it ->
FilterChip( FilterChip(
selected = pageLayout == index, selected = pageLayout == index,
@ -152,17 +153,17 @@ private fun ColumnScope.PagerViewerSettings(screenModel: ReaderSettingsScreenMod
// SY --> // SY -->
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_page_transitions), label = stringResource(MR.strings.pref_page_transitions),
pref = screenModel.preferences.pageTransitionsPager(), pref = screenModel.preferences.pageTransitionsPager(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.invert_double_pages), label = stringResource(SYMR.strings.invert_double_pages),
pref = screenModel.preferences.invertDoublePages(), pref = screenModel.preferences.invertDoublePages(),
) )
val centerMarginType by screenModel.preferences.centerMarginType().collectAsState() val centerMarginType by screenModel.preferences.centerMarginType().collectAsState()
SettingsChipRow(R.string.pref_center_margin) { SettingsChipRow(SYMR.strings.pref_center_margin) {
ReaderPreferences.CenterMarginTypes.mapIndexed { index, it -> ReaderPreferences.CenterMarginTypes.mapIndexed { index, it ->
FilterChip( FilterChip(
selected = centerMarginType == index, selected = centerMarginType == index,
@ -208,17 +209,17 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM
// SY --> // SY -->
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_smooth_scroll), label = stringResource(SYMR.strings.pref_smooth_scroll),
pref = screenModel.preferences.smoothAutoScroll(), pref = screenModel.preferences.smoothAutoScroll(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_page_transitions), label = stringResource(MR.strings.pref_page_transitions),
pref = screenModel.preferences.pageTransitionsWebtoon(), pref = screenModel.preferences.pageTransitionsWebtoon(),
) )
CheckboxItem( CheckboxItem(
label = stringResource(R.string.enable_zoom_out), label = stringResource(SYMR.strings.enable_zoom_out),
pref = screenModel.preferences.webtoonEnableZoomOut(), pref = screenModel.preferences.webtoonEnableZoomOut(),
) )
// SY <-- // SY <--
@ -245,10 +246,10 @@ private fun ColumnScope.WebtoonViewerSettings(screenModel: ReaderSettingsScreenM
// SY --> // SY -->
@Composable @Composable
private fun ColumnScope.WebtoonWithGapsViewerSettings(screenModel: ReaderSettingsScreenModel) { private fun ColumnScope.WebtoonWithGapsViewerSettings(screenModel: ReaderSettingsScreenModel) {
HeadingItem(R.string.vertical_plus_viewer) HeadingItem(MR.strings.vertical_plus_viewer)
CheckboxItem( CheckboxItem(
label = stringResource(R.string.pref_crop_borders), label = stringResource(MR.strings.pref_crop_borders),
pref = screenModel.preferences.cropBordersContinuousVertical(), pref = screenModel.preferences.cropBordersContinuousVertical(),
) )
} }

View File

@ -28,7 +28,6 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.dp
import androidx.compose.ui.window.Dialog import androidx.compose.ui.window.Dialog
import com.google.accompanist.web.AccompanistWebViewClient import com.google.accompanist.web.AccompanistWebViewClient
@ -39,10 +38,12 @@ import com.google.accompanist.web.rememberWebViewNavigator
import com.google.accompanist.web.rememberWebViewState import com.google.accompanist.web.rememberWebViewState
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.tachiyomi.BuildConfig import eu.kanade.tachiyomi.BuildConfig
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.system.setDefaultSettings import eu.kanade.tachiyomi.util.system.setDefaultSettings
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.Button import tachiyomi.presentation.core.components.material.Button
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun EhLoginWebViewScreen( fun EhLoginWebViewScreen(
@ -81,9 +82,10 @@ fun EhLoginWebViewScreen(
val animatedProgress by animateFloatAsState( val animatedProgress by animateFloatAsState(
(loadingState as? LoadingState.Loading)?.progress ?: 1f, (loadingState as? LoadingState.Loading)?.progress ?: 1f,
animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec, animationSpec = ProgressIndicatorDefaults.ProgressAnimationSpec,
label = "webview_loading",
) )
LinearProgressIndicator( LinearProgressIndicator(
progress = animatedProgress, progress = { animatedProgress },
modifier = Modifier modifier = Modifier
.fillMaxWidth() .fillMaxWidth()
.align(Alignment.BottomCenter), .align(Alignment.BottomCenter),
@ -139,10 +141,10 @@ fun EhLoginWebViewScreen(
horizontalArrangement = Arrangement.SpaceBetween, horizontalArrangement = Arrangement.SpaceBetween,
) { ) {
Button(onClick = onUp, Modifier.weight(0.5F)) { Button(onClick = onUp, Modifier.weight(0.5F)) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
Button(onClick = { showAdvancedOptions = true }, Modifier.weight(0.5F)) { Button(onClick = { showAdvancedOptions = true }, Modifier.weight(0.5F)) {
Text(text = stringResource(R.string.pref_category_advanced)) Text(text = stringResource(MR.strings.pref_category_advanced))
} }
} }
} }
@ -164,7 +166,7 @@ fun EhLoginWebViewScreen(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
) { ) {
Text(text = stringResource(R.string.recheck_login_status)) Text(text = stringResource(SYMR.strings.recheck_login_status))
} }
Button( Button(
onClick = { onClick = {
@ -173,7 +175,7 @@ fun EhLoginWebViewScreen(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
) { ) {
Text(text = stringResource(R.string.alternative_login_page)) Text(text = stringResource(SYMR.strings.alternative_login_page))
} }
Button( Button(
onClick = { onClick = {
@ -182,7 +184,7 @@ fun EhLoginWebViewScreen(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
) { ) {
Text(text = stringResource(R.string.skip_page_restyling)) Text(text = stringResource(SYMR.strings.skip_page_restyling))
} }
Button( Button(
onClick = { onClick = {
@ -191,10 +193,10 @@ fun EhLoginWebViewScreen(
}, },
modifier = Modifier.fillMaxWidth(), modifier = Modifier.fillMaxWidth(),
) { ) {
Text(text = stringResource(R.string.custom_igneous_cookie)) Text(text = stringResource(SYMR.strings.custom_igneous_cookie))
} }
Button(onClick = { showAdvancedOptions = false }, Modifier.fillMaxWidth()) { Button(onClick = { showAdvancedOptions = false }, Modifier.fillMaxWidth()) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
} }
} }

View File

@ -12,10 +12,11 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.saveable.rememberSaveable import androidx.compose.runtime.saveable.rememberSaveable
import androidx.compose.runtime.setValue import androidx.compose.runtime.setValue
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.input.TextFieldValue import androidx.compose.ui.text.input.TextFieldValue
import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.window.DialogProperties
import eu.kanade.tachiyomi.R import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun IgneousDialog( fun IgneousDialog(
@ -27,10 +28,10 @@ fun IgneousDialog(
} }
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = { Text(text = stringResource(R.string.custom_igneous_cookie)) }, title = { Text(text = stringResource(SYMR.strings.custom_igneous_cookie)) },
text = { text = {
Column { Column {
Text(text = stringResource(R.string.custom_igneous_cookie_message)) Text(text = stringResource(SYMR.strings.custom_igneous_cookie_message))
OutlinedTextField( OutlinedTextField(
value = textFieldValue, value = textFieldValue,
onValueChange = { textFieldValue = it }, onValueChange = { textFieldValue = it },
@ -49,12 +50,12 @@ fun IgneousDialog(
onDismissRequest() onDismissRequest()
}, },
) { ) {
Text(text = stringResource(R.string.action_ok)) Text(text = stringResource(MR.strings.action_ok))
} }
}, },
dismissButton = { dismissButton = {
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(MR.strings.action_cancel))
} }
}, },
) )

View File

@ -251,7 +251,7 @@ class App : Application(), DefaultLifecycleObserver, ImageLoaderFactory {
val logFolder = File( val logFolder = File(
Environment.getExternalStorageDirectory().absolutePath + File.separator + Environment.getExternalStorageDirectory().absolutePath + File.separator +
getString(R.string.app_name), stringResource(MR.strings.app_name),
"logs", "logs",
) )

View File

@ -50,6 +50,7 @@ import tachiyomi.domain.manga.model.CustomMangaInfo
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.track.model.Track import tachiyomi.domain.track.model.Track
import tachiyomi.i18n.MR import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.io.File import java.io.File
@ -247,8 +248,8 @@ class BackupRestorer(
showRestoreProgress( showRestoreProgress(
restoreProgress, restoreProgress,
restoreAmount, restoreAmount,
context.getString(R.string.saved_searches), context.stringResource(SYMR.strings.saved_searches),
context.getString(R.string.restoring_backup), context.stringResource(MR.strings.restoring_backup),
) )
} }
// SY <-- // SY <--

View File

@ -2,7 +2,6 @@ package eu.kanade.tachiyomi.data.download
import android.content.Context import android.content.Context
import com.hippo.unifile.UniFile import com.hippo.unifile.UniFile
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.source.Source import eu.kanade.tachiyomi.source.Source
import eu.kanade.tachiyomi.source.model.Page import eu.kanade.tachiyomi.source.model.Page
@ -18,6 +17,7 @@ import kotlinx.coroutines.flow.merge
import kotlinx.coroutines.flow.onStart import kotlinx.coroutines.flow.onStart
import kotlinx.coroutines.runBlocking import kotlinx.coroutines.runBlocking
import logcat.LogPriority import logcat.LogPriority
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.launchIO
import tachiyomi.core.util.system.logcat import tachiyomi.core.util.system.logcat
import tachiyomi.domain.category.interactor.GetCategories import tachiyomi.domain.category.interactor.GetCategories
@ -25,6 +25,7 @@ import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.download.service.DownloadPreferences
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.service.SourceManager import tachiyomi.domain.source.service.SourceManager
import tachiyomi.i18n.MR
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -166,7 +167,7 @@ class DownloadManager(
.filter { "image" in it.type.orEmpty() } .filter { "image" in it.type.orEmpty() }
if (files.isEmpty()) { if (files.isEmpty()) {
throw Exception(context.getString(R.string.page_list_empty_error)) throw Exception(context.stringResource(MR.strings.page_list_empty_error))
} }
return files.sortedBy { it.name } return files.sortedBy { it.name }

View File

@ -6,7 +6,6 @@ import com.hippo.unifile.UniFile
import eu.kanade.domain.chapter.model.toSChapter import eu.kanade.domain.chapter.model.toSChapter
import eu.kanade.domain.manga.model.getComicInfo import eu.kanade.domain.manga.model.getComicInfo
import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.cache.ChapterCache import eu.kanade.tachiyomi.data.cache.ChapterCache
import eu.kanade.tachiyomi.data.download.model.Download import eu.kanade.tachiyomi.data.download.model.Download
import eu.kanade.tachiyomi.data.library.LibraryUpdateNotifier import eu.kanade.tachiyomi.data.library.LibraryUpdateNotifier
@ -48,6 +47,7 @@ import net.lingala.zip4j.ZipFile
import net.lingala.zip4j.model.ZipParameters import net.lingala.zip4j.model.ZipParameters
import nl.adaptivity.xmlutil.serialization.XML import nl.adaptivity.xmlutil.serialization.XML
import okhttp3.Response import okhttp3.Response
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.metadata.comicinfo.COMIC_INFO_FILE import tachiyomi.core.metadata.comicinfo.COMIC_INFO_FILE
import tachiyomi.core.metadata.comicinfo.ComicInfo import tachiyomi.core.metadata.comicinfo.ComicInfo
import tachiyomi.core.util.lang.launchIO import tachiyomi.core.util.lang.launchIO
@ -61,6 +61,7 @@ import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.download.service.DownloadPreferences import tachiyomi.domain.download.service.DownloadPreferences
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.domain.source.service.SourceManager import tachiyomi.domain.source.service.SourceManager
import tachiyomi.i18n.MR
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.io.BufferedOutputStream import java.io.BufferedOutputStream
@ -315,7 +316,7 @@ class Downloader(
) { ) {
withUIContext { withUIContext {
notifier.onWarning( notifier.onWarning(
context.getString(R.string.download_queue_size_warning), context.stringResource(MR.strings.download_queue_size_warning),
WARNING_NOTIF_TIMEOUT_MS, WARNING_NOTIF_TIMEOUT_MS,
NotificationHandler.openUrl(context, LibraryUpdateNotifier.HELP_WARNING_URL), NotificationHandler.openUrl(context, LibraryUpdateNotifier.HELP_WARNING_URL),
) )
@ -338,7 +339,7 @@ class Downloader(
if (availSpace != -1L && availSpace < MIN_DISK_SPACE) { if (availSpace != -1L && availSpace < MIN_DISK_SPACE) {
download.status = Download.State.ERROR download.status = Download.State.ERROR
notifier.onError( notifier.onError(
context.getString(R.string.download_insufficient_space), context.stringResource(MR.strings.download_insufficient_space),
download.chapter.name, download.chapter.name,
download.manga.title, download.manga.title,
) )
@ -355,7 +356,7 @@ class Downloader(
val pages = download.source.getPageList(download.chapter.toSChapter()) val pages = download.source.getPageList(download.chapter.toSChapter())
if (pages.isEmpty()) { if (pages.isEmpty()) {
throw Exception(context.getString(R.string.page_list_empty_error)) throw Exception(context.stringResource(MR.strings.page_list_empty_error))
} }
// Don't trust index from source // Don't trust index from source
val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) } val reIndexedPages = pages.mapIndexed { index, page -> Page(index, page.url, page.imageUrl, page.uri) }
@ -570,7 +571,7 @@ class Downloader(
try { try {
val filenamePrefix = String.format("%03d", page.number) val filenamePrefix = String.format("%03d", page.number)
val imageFile = tmpDir.listFiles()?.firstOrNull { it.name.orEmpty().startsWith(filenamePrefix) } val imageFile = tmpDir.listFiles()?.firstOrNull { it.name.orEmpty().startsWith(filenamePrefix) }
?: error(context.getString(R.string.download_notifier_split_page_not_found, page.number)) ?: error(context.stringResource(MR.strings.download_notifier_split_page_not_found, page.number))
// If the original page was previously split, then skip // If the original page was previously split, then skip
if (imageFile.name.orEmpty().startsWith("${filenamePrefix}__")) return if (imageFile.name.orEmpty().startsWith("${filenamePrefix}__")) return

View File

@ -20,7 +20,6 @@ import eu.kanade.domain.manga.model.copyFrom
import eu.kanade.domain.manga.model.toSManga import eu.kanade.domain.manga.model.toSManga
import eu.kanade.domain.track.model.toDbTrack import eu.kanade.domain.track.model.toDbTrack
import eu.kanade.domain.track.model.toDomainTrack import eu.kanade.domain.track.model.toDomainTrack
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.cache.CoverCache import eu.kanade.tachiyomi.data.cache.CoverCache
import eu.kanade.tachiyomi.data.download.DownloadManager import eu.kanade.tachiyomi.data.download.DownloadManager
import eu.kanade.tachiyomi.data.notification.Notifications import eu.kanade.tachiyomi.data.notification.Notifications
@ -54,6 +53,7 @@ import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.sync.Semaphore import kotlinx.coroutines.sync.Semaphore
import kotlinx.coroutines.sync.withPermit import kotlinx.coroutines.sync.withPermit
import logcat.LogPriority import logcat.LogPriority
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.preference.getAndSet import tachiyomi.core.preference.getAndSet
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.core.util.system.logcat import tachiyomi.core.util.system.logcat
@ -87,6 +87,7 @@ import tachiyomi.domain.source.model.SourceNotInstalledException
import tachiyomi.domain.source.service.SourceManager import tachiyomi.domain.source.service.SourceManager
import tachiyomi.domain.track.interactor.GetTracks import tachiyomi.domain.track.interactor.GetTracks
import tachiyomi.domain.track.interactor.InsertTrack import tachiyomi.domain.track.interactor.InsertTrack
import tachiyomi.i18n.MR
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
import java.io.File import java.io.File
@ -273,27 +274,27 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
.filter { .filter {
when { when {
it.manga.updateStrategy != UpdateStrategy.ALWAYS_UPDATE -> { it.manga.updateStrategy != UpdateStrategy.ALWAYS_UPDATE -> {
skippedUpdates.add(it.manga to context.getString(R.string.skipped_reason_not_always_update)) skippedUpdates.add(it.manga to context.stringResource(MR.strings.skipped_reason_not_always_update))
false false
} }
MANGA_NON_COMPLETED in restrictions && it.manga.status.toInt() == SManga.COMPLETED -> { MANGA_NON_COMPLETED in restrictions && it.manga.status.toInt() == SManga.COMPLETED -> {
skippedUpdates.add(it.manga to context.getString(R.string.skipped_reason_completed)) skippedUpdates.add(it.manga to context.stringResource(MR.strings.skipped_reason_completed))
false false
} }
MANGA_HAS_UNREAD in restrictions && it.unreadCount != 0L -> { MANGA_HAS_UNREAD in restrictions && it.unreadCount != 0L -> {
skippedUpdates.add(it.manga to context.getString(R.string.skipped_reason_not_caught_up)) skippedUpdates.add(it.manga to context.stringResource(MR.strings.skipped_reason_not_caught_up))
false false
} }
MANGA_NON_READ in restrictions && it.totalChapters > 0L && !it.hasStarted -> { MANGA_NON_READ in restrictions && it.totalChapters > 0L && !it.hasStarted -> {
skippedUpdates.add(it.manga to context.getString(R.string.skipped_reason_not_started)) skippedUpdates.add(it.manga to context.stringResource(MR.strings.skipped_reason_not_started))
false false
} }
MANGA_OUTSIDE_RELEASE_PERIOD in restrictions && it.manga.nextUpdate > fetchWindow.second -> { MANGA_OUTSIDE_RELEASE_PERIOD in restrictions && it.manga.nextUpdate > fetchWindow.second -> {
skippedUpdates.add(it.manga to context.getString(R.string.skipped_reason_not_in_release_period)) skippedUpdates.add(it.manga to context.stringResource(MR.strings.skipped_reason_not_in_release_period))
false false
} }
else -> true else -> true
@ -400,10 +401,10 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
} }
} catch (e: Throwable) { } catch (e: Throwable) {
val errorMessage = when (e) { val errorMessage = when (e) {
is NoChaptersException -> context.getString(R.string.no_chapters_error) is NoChaptersException -> context.stringResource(MR.strings.no_chapters_error)
// failedUpdates will already have the source, don't need to copy it into the message // failedUpdates will already have the source, don't need to copy it into the message
is SourceNotInstalledException -> context.getString( is SourceNotInstalledException -> context.stringResource(
R.string.loader_not_implemented_error, MR.strings.loader_not_implemented_error,
) )
else -> e.message else -> e.message
} }
@ -648,7 +649,7 @@ class LibraryUpdateJob(private val context: Context, workerParams: WorkerParamet
if (errors.isNotEmpty()) { if (errors.isNotEmpty()) {
val file = context.createFileInCacheDir("tachiyomi_update_errors.txt") val file = context.createFileInCacheDir("tachiyomi_update_errors.txt")
file.bufferedWriter().use { out -> file.bufferedWriter().use { out ->
out.write(context.getString(R.string.library_errors_help, ERROR_LOG_HELP_URL) + "\n\n") out.write(context.stringResource(MR.strings.library_errors_help, ERROR_LOG_HELP_URL) + "\n\n")
// Error file format: // Error file format:
// ! Error // ! Error
// # Source // # Source

View File

@ -26,9 +26,12 @@ import eu.kanade.tachiyomi.util.system.getBitmapOrNull
import eu.kanade.tachiyomi.util.system.notificationBuilder import eu.kanade.tachiyomi.util.system.notificationBuilder
import eu.kanade.tachiyomi.util.system.notify import eu.kanade.tachiyomi.util.system.notify
import tachiyomi.core.Constants import tachiyomi.core.Constants
import tachiyomi.core.i18n.pluralStringResource
import tachiyomi.core.i18n.stringResource
import tachiyomi.core.util.lang.launchUI import tachiyomi.core.util.lang.launchUI
import tachiyomi.domain.chapter.model.Chapter import tachiyomi.domain.chapter.model.Chapter
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
import java.text.NumberFormat import java.text.NumberFormat
@ -58,12 +61,12 @@ class LibraryUpdateNotifier(private val context: Context) {
*/ */
val progressNotificationBuilder by lazy { val progressNotificationBuilder by lazy {
context.notificationBuilder(Notifications.CHANNEL_LIBRARY_PROGRESS) { context.notificationBuilder(Notifications.CHANNEL_LIBRARY_PROGRESS) {
setContentTitle(context.getString(R.string.app_name)) setContentTitle(context.stringResource(MR.strings.app_name))
setSmallIcon(R.drawable.ic_refresh_24dp) setSmallIcon(R.drawable.ic_refresh_24dp)
setLargeIcon(notificationBitmap) setLargeIcon(notificationBitmap)
setOngoing(true) setOngoing(true)
setOnlyAlertOnce(true) setOnlyAlertOnce(true)
addAction(R.drawable.ic_close_24dp, context.getString(R.string.action_cancel), cancelIntent) addAction(R.drawable.ic_close_24dp, context.stringResource(MR.strings.action_cancel), cancelIntent)
} }
} }
@ -77,14 +80,14 @@ class LibraryUpdateNotifier(private val context: Context) {
fun showProgressNotification(manga: List<Manga>, current: Int, total: Int) { fun showProgressNotification(manga: List<Manga>, current: Int, total: Int) {
if (preferences.hideNotificationContent().get()) { if (preferences.hideNotificationContent().get()) {
progressNotificationBuilder progressNotificationBuilder
.setContentTitle(context.getString(R.string.notification_check_updates)) .setContentTitle(context.stringResource(MR.strings.notification_check_updates))
.setContentText("($current/$total)") .setContentText("($current/$total)")
} else { } else {
val updatingText = manga.joinToString("\n") { it.title.chop(40) } val updatingText = manga.joinToString("\n") { it.title.chop(40) }
progressNotificationBuilder progressNotificationBuilder
.setContentTitle( .setContentTitle(
context.getString( context.stringResource(
R.string.notification_updating_progress, MR.strings.notification_updating_progress,
percentFormatter.format(current.toFloat() / total), percentFormatter.format(current.toFloat() / total),
), ),
) )
@ -104,8 +107,8 @@ class LibraryUpdateNotifier(private val context: Context) {
Notifications.ID_LIBRARY_SIZE_WARNING, Notifications.ID_LIBRARY_SIZE_WARNING,
Notifications.CHANNEL_LIBRARY_PROGRESS, Notifications.CHANNEL_LIBRARY_PROGRESS,
) { ) {
setContentTitle(context.getString(R.string.label_warning)) setContentTitle(context.stringResource(MR.strings.label_warning))
setStyle(NotificationCompat.BigTextStyle().bigText(context.getString(R.string.notification_size_warning))) setStyle(NotificationCompat.BigTextStyle().bigText(context.stringResource(MR.strings.notification_size_warning)))
setSmallIcon(R.drawable.ic_warning_white_24dp) setSmallIcon(R.drawable.ic_warning_white_24dp)
setTimeoutAfter(Downloader.WARNING_NOTIF_TIMEOUT_MS) setTimeoutAfter(Downloader.WARNING_NOTIF_TIMEOUT_MS)
setContentIntent(NotificationHandler.openUrl(context, HELP_WARNING_URL)) setContentIntent(NotificationHandler.openUrl(context, HELP_WARNING_URL))
@ -127,8 +130,8 @@ class LibraryUpdateNotifier(private val context: Context) {
Notifications.ID_LIBRARY_ERROR, Notifications.ID_LIBRARY_ERROR,
Notifications.CHANNEL_LIBRARY_ERROR, Notifications.CHANNEL_LIBRARY_ERROR,
) { ) {
setContentTitle(context.resources.getString(R.string.notification_update_error, failed)) setContentTitle(context.stringResource(MR.strings.notification_update_error, failed))
setContentText(context.getString(R.string.action_show_errors)) setContentText(context.stringResource(MR.strings.action_show_errors))
setSmallIcon(R.drawable.ic_tachi) setSmallIcon(R.drawable.ic_tachi)
setContentIntent(NotificationReceiver.openErrorLogPendingActivity(context, uri)) setContentIntent(NotificationReceiver.openErrorLogPendingActivity(context, uri))
@ -149,8 +152,8 @@ class LibraryUpdateNotifier(private val context: Context) {
Notifications.ID_LIBRARY_SKIPPED, Notifications.ID_LIBRARY_SKIPPED,
Notifications.CHANNEL_LIBRARY_SKIPPED, Notifications.CHANNEL_LIBRARY_SKIPPED,
) { ) {
setContentTitle(context.resources.getString(R.string.notification_update_skipped, skipped)) setContentTitle(context.stringResource(MR.strings.notification_update_skipped, skipped))
setContentText(context.getString(R.string.learn_more)) setContentText(context.stringResource(MR.strings.learn_more))
setSmallIcon(R.drawable.ic_tachi) setSmallIcon(R.drawable.ic_tachi)
setContentIntent(NotificationHandler.openUrl(context, HELP_SKIPPED_URL)) setContentIntent(NotificationHandler.openUrl(context, HELP_SKIPPED_URL))
} }
@ -167,13 +170,13 @@ class LibraryUpdateNotifier(private val context: Context) {
Notifications.ID_NEW_CHAPTERS, Notifications.ID_NEW_CHAPTERS,
Notifications.CHANNEL_NEW_CHAPTERS, Notifications.CHANNEL_NEW_CHAPTERS,
) { ) {
setContentTitle(context.getString(R.string.notification_new_chapters)) setContentTitle(context.stringResource(MR.strings.notification_new_chapters))
if (updates.size == 1 && !preferences.hideNotificationContent().get()) { if (updates.size == 1 && !preferences.hideNotificationContent().get()) {
setContentText(updates.first().first.title.chop(NOTIF_TITLE_MAX_LEN)) setContentText(updates.first().first.title.chop(NOTIF_TITLE_MAX_LEN))
} else { } else {
setContentText( setContentText(
context.resources.getQuantityString( context.pluralStringResource(
R.plurals.notification_new_chapters_summary, MR.plurals.notification_new_chapters_summary,
updates.size, updates.size,
updates.size, updates.size,
), ),
@ -243,7 +246,7 @@ class LibraryUpdateNotifier(private val context: Context) {
// Mark chapters as read action // Mark chapters as read action
addAction( addAction(
R.drawable.ic_glasses_24dp, R.drawable.ic_glasses_24dp,
context.getString(R.string.action_mark_as_read), context.stringResource(MR.strings.action_mark_as_read),
NotificationReceiver.markAsReadPendingBroadcast( NotificationReceiver.markAsReadPendingBroadcast(
context, context,
manga, manga,
@ -254,7 +257,7 @@ class LibraryUpdateNotifier(private val context: Context) {
// View chapters action // View chapters action
addAction( addAction(
R.drawable.ic_book_24dp, R.drawable.ic_book_24dp,
context.getString(R.string.action_view_chapters), context.stringResource(MR.strings.action_view_chapters),
NotificationReceiver.openChapterPendingActivity( NotificationReceiver.openChapterPendingActivity(
context, context,
manga, manga,
@ -266,7 +269,7 @@ class LibraryUpdateNotifier(private val context: Context) {
if (chapters.size <= Downloader.CHAPTERS_PER_SOURCE_QUEUE_WARNING_THRESHOLD) { if (chapters.size <= Downloader.CHAPTERS_PER_SOURCE_QUEUE_WARNING_THRESHOLD) {
addAction( addAction(
android.R.drawable.stat_sys_download_done, android.R.drawable.stat_sys_download_done,
context.getString(R.string.action_download), context.stringResource(MR.strings.action_download),
NotificationReceiver.downloadChaptersPendingBroadcast( NotificationReceiver.downloadChaptersPendingBroadcast(
context, context,
manga, manga,
@ -306,8 +309,8 @@ class LibraryUpdateNotifier(private val context: Context) {
// No sensible chapter numbers to show (i.e. no chapters have parsed chapter number) // No sensible chapter numbers to show (i.e. no chapters have parsed chapter number)
0 -> { 0 -> {
// "1 new chapter" or "5 new chapters" // "1 new chapter" or "5 new chapters"
context.resources.getQuantityString( context.pluralStringResource(
R.plurals.notification_chapters_generic, MR.plurals.notification_chapters_generic,
chapters.size, chapters.size,
chapters.size, chapters.size,
) )
@ -317,14 +320,14 @@ class LibraryUpdateNotifier(private val context: Context) {
val remaining = chapters.size - displayableChapterNumbers.size val remaining = chapters.size - displayableChapterNumbers.size
if (remaining == 0) { if (remaining == 0) {
// "Chapter 2.5" // "Chapter 2.5"
context.resources.getString( context.stringResource(
R.string.notification_chapters_single, MR.strings.notification_chapters_single,
displayableChapterNumbers.first(), displayableChapterNumbers.first(),
) )
} else { } else {
// "Chapter 2.5 and 10 more" // "Chapter 2.5 and 10 more"
context.resources.getString( context.stringResource(
R.string.notification_chapters_single_and_more, MR.strings.notification_chapters_single_and_more,
displayableChapterNumbers.first(), displayableChapterNumbers.first(),
remaining, remaining,
) )
@ -337,16 +340,16 @@ class LibraryUpdateNotifier(private val context: Context) {
// "Chapters 1, 2.5, 3, 4, 5 and 10 more" // "Chapters 1, 2.5, 3, 4, 5 and 10 more"
val remaining = displayableChapterNumbers.size - NOTIF_MAX_CHAPTERS val remaining = displayableChapterNumbers.size - NOTIF_MAX_CHAPTERS
val joinedChapterNumbers = displayableChapterNumbers.take(NOTIF_MAX_CHAPTERS).joinToString(", ") val joinedChapterNumbers = displayableChapterNumbers.take(NOTIF_MAX_CHAPTERS).joinToString(", ")
context.resources.getQuantityString( context.pluralStringResource(
R.plurals.notification_chapters_multiple_and_more, MR.plurals.notification_chapters_multiple_and_more,
remaining, remaining,
joinedChapterNumbers, joinedChapterNumbers,
remaining, remaining,
) )
} else { } else {
// "Chapters 1, 2.5, 3" // "Chapters 1, 2.5, 3"
context.resources.getString( context.stringResource(
R.string.notification_chapters_multiple, MR.strings.notification_chapters_multiple,
displayableChapterNumbers.joinToString(", "), displayableChapterNumbers.joinToString(", "),
) )
} }

View File

@ -1,7 +1,6 @@
package eu.kanade.tachiyomi.data.track package eu.kanade.tachiyomi.data.track
import androidx.annotation.StringRes import dev.icerock.moko.resources.StringResource
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.track.anilist.Anilist import eu.kanade.tachiyomi.data.track.anilist.Anilist
import eu.kanade.tachiyomi.data.track.bangumi.Bangumi import eu.kanade.tachiyomi.data.track.bangumi.Bangumi
import eu.kanade.tachiyomi.data.track.kitsu.Kitsu import eu.kanade.tachiyomi.data.track.kitsu.Kitsu
@ -10,15 +9,17 @@ import eu.kanade.tachiyomi.data.track.mangaupdates.MangaUpdates
import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList import eu.kanade.tachiyomi.data.track.myanimelist.MyAnimeList
import eu.kanade.tachiyomi.data.track.shikimori.Shikimori import eu.kanade.tachiyomi.data.track.shikimori.Shikimori
import exh.md.utils.FollowStatus import exh.md.utils.FollowStatus
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
enum class TrackStatus(val int: Int, @StringRes val res: Int) { enum class TrackStatus(val int: Int, val res: StringResource) {
READING(1, R.string.reading), READING(1, MR.strings.reading),
REPEATING(2, R.string.repeating), REPEATING(2, MR.strings.repeating),
PLAN_TO_READ(3, R.string.plan_to_read), PLAN_TO_READ(3, MR.strings.plan_to_read),
PAUSED(4, R.string.on_hold), PAUSED(4, MR.strings.on_hold),
COMPLETED(5, R.string.completed), COMPLETED(5, MR.strings.completed),
DROPPED(6, R.string.dropped), DROPPED(6, MR.strings.dropped),
OTHER(7, R.string.not_tracked), OTHER(7, SYMR.strings.not_tracked),
; ;
companion object { companion object {

View File

@ -1,7 +1,7 @@
package eu.kanade.tachiyomi.data.track.mdlist package eu.kanade.tachiyomi.data.track.mdlist
import android.graphics.Color import android.graphics.Color
import androidx.annotation.StringRes import dev.icerock.moko.resources.StringResource
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.data.database.models.Track import eu.kanade.tachiyomi.data.database.models.Track
import eu.kanade.tachiyomi.data.track.BaseTracker import eu.kanade.tachiyomi.data.track.BaseTracker
@ -16,6 +16,8 @@ import tachiyomi.core.util.lang.awaitSingle
import tachiyomi.core.util.lang.runAsObservable import tachiyomi.core.util.lang.runAsObservable
import tachiyomi.core.util.lang.withIOContext import tachiyomi.core.util.lang.withIOContext
import tachiyomi.domain.manga.model.Manga import tachiyomi.domain.manga.model.Manga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -43,15 +45,14 @@ class MdList(id: Long) : BaseTracker(id, "MDList") {
return FollowStatus.values().map { it.int } return FollowStatus.values().map { it.int }
} }
@StringRes override fun getStatus(status: Int): StringResource? = when (status) {
override fun getStatus(status: Int): Int? = when (status) { 0 -> SYMR.strings.md_follows_unfollowed
0 -> R.string.md_follows_unfollowed 1 -> MR.strings.reading
1 -> R.string.reading 2 -> MR.strings.completed
2 -> R.string.completed 3 -> MR.strings.on_hold
3 -> R.string.on_hold 4 -> MR.strings.plan_to_read
4 -> R.string.plan_to_read 5 -> MR.strings.dropped
5 -> R.string.dropped 6 -> MR.strings.repeating
6 -> R.string.repeating
else -> null else -> null
} }

View File

@ -24,7 +24,6 @@ import eu.kanade.tachiyomi.network.NetworkHelper
import eu.kanade.tachiyomi.source.AndroidSourceManager import eu.kanade.tachiyomi.source.AndroidSourceManager
import eu.kanade.tachiyomi.util.storage.CbzCrypto import eu.kanade.tachiyomi.util.storage.CbzCrypto
import exh.eh.EHentaiUpdateHelper import exh.eh.EHentaiUpdateHelper
import exh.pref.DelegateSourcePreferences
import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory import io.requery.android.database.sqlite.RequerySQLiteOpenHelperFactory
import kotlinx.serialization.json.Json import kotlinx.serialization.json.Json
import net.zetetic.database.sqlcipher.SupportOpenHelperFactory import net.zetetic.database.sqlcipher.SupportOpenHelperFactory
@ -39,7 +38,6 @@ import tachiyomi.data.History
import tachiyomi.data.Mangas import tachiyomi.data.Mangas
import tachiyomi.data.StringListColumnAdapter import tachiyomi.data.StringListColumnAdapter
import tachiyomi.data.UpdateStrategyColumnAdapter import tachiyomi.data.UpdateStrategyColumnAdapter
import tachiyomi.domain.UnsortedPreferences
import tachiyomi.domain.manga.interactor.GetCustomMangaInfo import tachiyomi.domain.manga.interactor.GetCustomMangaInfo
import tachiyomi.domain.source.service.SourceManager import tachiyomi.domain.source.service.SourceManager
import tachiyomi.source.local.image.LocalCoverManager import tachiyomi.source.local.image.LocalCoverManager
@ -178,4 +176,3 @@ class AppModule(val app: Application) : InjektModule {
} }
} }
} }

View File

@ -4,6 +4,7 @@ import android.content.Context
import android.graphics.drawable.Drawable import android.graphics.drawable.Drawable
import androidx.core.content.ContextCompat import androidx.core.content.ContextCompat
import eu.kanade.domain.source.service.SourcePreferences import eu.kanade.domain.source.service.SourcePreferences
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi import eu.kanade.tachiyomi.extension.api.ExtensionGithubApi
import eu.kanade.tachiyomi.extension.api.ExtensionUpdateNotifier import eu.kanade.tachiyomi.extension.api.ExtensionUpdateNotifier
import eu.kanade.tachiyomi.extension.model.Extension import eu.kanade.tachiyomi.extension.model.Extension

View File

@ -10,7 +10,6 @@ import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope import androidx.compose.runtime.rememberCoroutineScope
import androidx.compose.ui.platform.LocalContext import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.res.stringResource
import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.navigator.Navigator import cafe.adriel.voyager.navigator.Navigator
import cafe.adriel.voyager.navigator.tab.LocalTabNavigator import cafe.adriel.voyager.navigator.tab.LocalTabNavigator
@ -29,6 +28,8 @@ import eu.kanade.tachiyomi.ui.browse.source.globalsearch.GlobalSearchScreen
import eu.kanade.tachiyomi.ui.browse.source.sourcesTab import eu.kanade.tachiyomi.ui.browse.source.sourcesTab
import eu.kanade.tachiyomi.ui.main.MainActivity import eu.kanade.tachiyomi.ui.main.MainActivity
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.presentation.core.i18n.stringResource
import uy.kohesive.injekt.Injekt import uy.kohesive.injekt.Injekt
import uy.kohesive.injekt.api.get import uy.kohesive.injekt.api.get
@ -43,7 +44,7 @@ data class BrowseTab(
val image = AnimatedImageVector.animatedVectorResource(R.drawable.anim_browse_enter) val image = AnimatedImageVector.animatedVectorResource(R.drawable.anim_browse_enter)
return TabOptions( return TabOptions(
index = 3u, index = 3u,
title = stringResource(R.string.browse), title = stringResource(MR.strings.browse),
icon = rememberAnimatedVectorPainter(image, isSelected), icon = rememberAnimatedVectorPainter(image, isSelected),
) )
} }
@ -67,7 +68,7 @@ data class BrowseTab(
val extensionsState by extensionsScreenModel.state.collectAsState() val extensionsState by extensionsScreenModel.state.collectAsState()
TabbedScreen( TabbedScreen(
titleRes = R.string.browse, titleRes = MR.strings.browse,
// SY --> // SY -->
tabs = if (feedTabInFront) { tabs = if (feedTabInFront) {
persistentListOf( persistentListOf(

View File

@ -13,6 +13,9 @@ import eu.kanade.presentation.browse.FeedItemUI
import eu.kanade.tachiyomi.source.CatalogueSource import eu.kanade.tachiyomi.source.CatalogueSource
import eu.kanade.tachiyomi.source.model.FilterList import eu.kanade.tachiyomi.source.model.FilterList
import eu.kanade.tachiyomi.util.system.LocaleHelper import eu.kanade.tachiyomi.util.system.LocaleHelper
import kotlinx.collections.immutable.ImmutableList
import kotlinx.collections.immutable.persistentListOf
import kotlinx.collections.immutable.toImmutableList
import kotlinx.coroutines.asCoroutineDispatcher import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.async import kotlinx.coroutines.async
import kotlinx.coroutines.awaitAll import kotlinx.coroutines.awaitAll
@ -124,7 +127,13 @@ open class FeedScreenModel(
screenModelScope.launchIO { screenModelScope.launchIO {
mutableState.update { state -> mutableState.update { state ->
state.copy( state.copy(
dialog = Dialog.AddFeedSearch(source, (if (source.supportsLatest) listOf(null) else emptyList()) + getSourceSavedSearches(source.id)), dialog = Dialog.AddFeedSearch(
source,
(
(if (source.supportsLatest) persistentListOf(null) else persistentListOf()) +
getSourceSavedSearches(source.id)
).toImmutableList(),
),
) )
} }
} }
@ -144,7 +153,7 @@ open class FeedScreenModel(
return countFeedSavedSearchGlobal.await() > 10 return countFeedSavedSearchGlobal.await() > 10
} }
fun getEnabledSources(): List<CatalogueSource> { fun getEnabledSources(): ImmutableList<CatalogueSource> {
val languages = sourcePreferences.enabledLanguages().get() val languages = sourcePreferences.enabledLanguages().get()
val pinnedSources = sourcePreferences.pinnedSources().get() val pinnedSources = sourcePreferences.pinnedSources().get()
val disabledSources = sourcePreferences.disabledSources().get() val disabledSources = sourcePreferences.disabledSources().get()
@ -155,11 +164,11 @@ open class FeedScreenModel(
.filterNot { it.id in disabledSources } .filterNot { it.id in disabledSources }
.sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { "(${it.lang}) ${it.name}" }) .sortedWith(compareBy(String.CASE_INSENSITIVE_ORDER) { "(${it.lang}) ${it.name}" })
return list.sortedBy { it.id.toString() !in pinnedSources } return list.sortedBy { it.id.toString() !in pinnedSources }.toImmutableList()
} }
suspend fun getSourceSavedSearches(sourceId: Long): List<SavedSearch> { suspend fun getSourceSavedSearches(sourceId: Long): ImmutableList<SavedSearch> {
return getSavedSearchBySourceId.await(sourceId) return getSavedSearchBySourceId.await(sourceId).toImmutableList()
} }
fun createFeed(source: CatalogueSource, savedSearch: SavedSearch?) { fun createFeed(source: CatalogueSource, savedSearch: SavedSearch?) {
@ -290,8 +299,8 @@ open class FeedScreenModel(
} }
sealed class Dialog { sealed class Dialog {
data class AddFeed(val options: List<CatalogueSource>) : Dialog() data class AddFeed(val options: ImmutableList<CatalogueSource>) : Dialog()
data class AddFeedSearch(val source: CatalogueSource, val options: List<SavedSearch?>) : Dialog() data class AddFeedSearch(val source: CatalogueSource, val options: ImmutableList<SavedSearch?>) : Dialog()
data class DeleteFeed(val feed: FeedSavedSearch) : Dialog() data class DeleteFeed(val feed: FeedSavedSearch) : Dialog()
} }

View File

@ -7,7 +7,6 @@ import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.collectAsState import androidx.compose.runtime.collectAsState
import androidx.compose.runtime.getValue import androidx.compose.runtime.getValue
import androidx.compose.ui.res.stringResource
import cafe.adriel.voyager.core.model.rememberScreenModel import cafe.adriel.voyager.core.model.rememberScreenModel
import cafe.adriel.voyager.core.screen.Screen import cafe.adriel.voyager.core.screen.Screen
import cafe.adriel.voyager.core.stack.StackEvent import cafe.adriel.voyager.core.stack.StackEvent
@ -19,13 +18,15 @@ import eu.kanade.presentation.browse.FeedDeleteConfirmDialog
import eu.kanade.presentation.browse.FeedScreen import eu.kanade.presentation.browse.FeedScreen
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.TabContent import eu.kanade.presentation.components.TabContent
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreen import eu.kanade.tachiyomi.ui.browse.source.browse.BrowseSourceScreen
import eu.kanade.tachiyomi.ui.manga.MangaScreen import eu.kanade.tachiyomi.ui.manga.MangaScreen
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import kotlinx.coroutines.flow.collectLatest import kotlinx.coroutines.flow.collectLatest
import kotlinx.coroutines.launch import kotlinx.coroutines.launch
import tachiyomi.domain.source.interactor.GetRemoteManga import tachiyomi.domain.source.interactor.GetRemoteManga
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.i18n.stringResource
@Composable @Composable
fun Screen.feedTab(): TabContent { fun Screen.feedTab(): TabContent {
@ -48,10 +49,10 @@ fun Screen.feedTab(): TabContent {
} }
return TabContent( return TabContent(
titleRes = R.string.feed, titleRes = SYMR.strings.feed,
actions = persistentListOf( actions = persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_add), title = stringResource(MR.strings.action_add),
icon = Icons.Outlined.Add, icon = Icons.Outlined.Add,
onClick = { onClick = {
screenModel.openAddDialog() screenModel.openAddDialog()
@ -127,8 +128,8 @@ fun Screen.feedTab(): TabContent {
} }
} }
val internalErrString = stringResource(R.string.internal_error) val internalErrString = stringResource(MR.strings.internal_error)
val tooManyFeedsString = stringResource(R.string.too_many_in_feed) val tooManyFeedsString = stringResource(SYMR.strings.too_many_in_feed)
LaunchedEffect(Unit) { LaunchedEffect(Unit) {
screenModel.events.collectLatest { event -> screenModel.events.collectLatest { event ->
when (event) { when (event) {

View File

@ -14,13 +14,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.viewinterop.AndroidView import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.isVisible import androidx.core.view.isVisible
import eu.kanade.presentation.components.AdaptiveSheet import eu.kanade.presentation.components.AdaptiveSheet
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.databinding.MigrationBottomSheetBinding import eu.kanade.tachiyomi.databinding.MigrationBottomSheetBinding
import eu.kanade.tachiyomi.ui.browse.migration.MigrationFlags import eu.kanade.tachiyomi.ui.browse.migration.MigrationFlags
import eu.kanade.tachiyomi.util.system.toast import eu.kanade.tachiyomi.util.system.toast
import tachiyomi.core.preference.Preference import tachiyomi.core.preference.Preference
import tachiyomi.core.util.lang.toLong import tachiyomi.core.util.lang.toLong
import tachiyomi.domain.UnsortedPreferences import tachiyomi.domain.UnsortedPreferences
import tachiyomi.i18n.sy.SYMR
import uy.kohesive.injekt.injectLazy import uy.kohesive.injekt.injectLazy
@Composable @Composable
@ -77,7 +77,7 @@ class MigrationBottomSheetDialogState(private val onStartMigration: State<(extra
binding.skipStep.setOnCheckedChangeListener { _, isChecked -> binding.skipStep.setOnCheckedChangeListener { _, isChecked ->
if (isChecked) { if (isChecked) {
binding.root.context.toast( binding.root.context.toast(
R.string.pre_migration_skip_toast, SYMR.strings.pre_migration_skip_toast,
Toast.LENGTH_LONG, Toast.LENGTH_LONG,
) )
} }

View File

@ -24,7 +24,6 @@ import androidx.compose.ui.input.nestedscroll.NestedScrollSource
import androidx.compose.ui.input.nestedscroll.nestedScroll import androidx.compose.ui.input.nestedscroll.nestedScroll
import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalLayoutDirection import androidx.compose.ui.platform.LocalLayoutDirection
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.Velocity import androidx.compose.ui.unit.Velocity
import androidx.compose.ui.viewinterop.AndroidView import androidx.compose.ui.viewinterop.AndroidView
import androidx.core.view.ViewCompat import androidx.core.view.ViewCompat
@ -37,13 +36,15 @@ import cafe.adriel.voyager.navigator.currentOrThrow
import eu.kanade.presentation.components.AppBar import eu.kanade.presentation.components.AppBar
import eu.kanade.presentation.components.AppBarActions import eu.kanade.presentation.components.AppBarActions
import eu.kanade.presentation.util.Screen import eu.kanade.presentation.util.Screen
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.databinding.PreMigrationListBinding import eu.kanade.tachiyomi.databinding.PreMigrationListBinding
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigrationListScreen import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigrationListScreen
import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigrationProcedureConfig import eu.kanade.tachiyomi.ui.browse.migration.advanced.process.MigrationProcedureConfig
import kotlinx.collections.immutable.persistentListOf import kotlinx.collections.immutable.persistentListOf
import tachiyomi.i18n.MR
import tachiyomi.i18n.sy.SYMR
import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton import tachiyomi.presentation.core.components.material.ExtendedFloatingActionButton
import tachiyomi.presentation.core.components.material.Scaffold import tachiyomi.presentation.core.components.material.Scaffold
import tachiyomi.presentation.core.i18n.stringResource
import kotlin.math.roundToInt import kotlin.math.roundToInt
class PreMigrationScreen(val mangaIds: List<Long>) : Screen() { class PreMigrationScreen(val mangaIds: List<Long>) : Screen() {
@ -79,28 +80,28 @@ class PreMigrationScreen(val mangaIds: List<Long>) : Screen() {
Scaffold( Scaffold(
topBar = { topBar = {
AppBar( AppBar(
title = stringResource(R.string.select_sources), title = stringResource(SYMR.strings.select_sources),
navigateUp = navigator::pop, navigateUp = navigator::pop,
scrollBehavior = scrollBehavior, scrollBehavior = scrollBehavior,
actions = { actions = {
AppBarActions( AppBarActions(
persistentListOf( persistentListOf(
AppBar.Action( AppBar.Action(
title = stringResource(R.string.select_none), title = stringResource(SYMR.strings.select_none),
icon = Icons.Outlined.Deselect, icon = Icons.Outlined.Deselect,
onClick = { screenModel.massSelect(false) }, onClick = { screenModel.massSelect(false) },
), ),
AppBar.Action( AppBar.Action(
title = stringResource(R.string.action_select_all), title = stringResource(MR.strings.action_select_all),
icon = Icons.Outlined.SelectAll, icon = Icons.Outlined.SelectAll,
onClick = { screenModel.massSelect(true) }, onClick = { screenModel.massSelect(true) },
), ),
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.match_enabled_sources), title = stringResource(SYMR.strings.match_enabled_sources),
onClick = { screenModel.matchSelection(true) }, onClick = { screenModel.matchSelection(true) },
), ),
AppBar.OverflowAction( AppBar.OverflowAction(
title = stringResource(R.string.match_pinned_sources), title = stringResource(SYMR.strings.match_pinned_sources),
onClick = { screenModel.matchSelection(false) }, onClick = { screenModel.matchSelection(false) },
), ),
), ),
@ -110,11 +111,11 @@ class PreMigrationScreen(val mangaIds: List<Long>) : Screen() {
}, },
floatingActionButton = { floatingActionButton = {
ExtendedFloatingActionButton( ExtendedFloatingActionButton(
text = { Text(text = stringResource(R.string.action_migrate)) }, text = { Text(text = stringResource(MR.strings.action_migrate)) },
icon = { icon = {
Icon( Icon(
imageVector = Icons.Outlined.ArrowForward, imageVector = Icons.Outlined.ArrowForward,
contentDescription = stringResource(R.string.action_migrate), contentDescription = stringResource(MR.strings.action_migrate),
) )
}, },
onClick = { onClick = {

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