Made almost all the strings SY uses translatable! If people would like to help translate, feel free to join the Tachiyomi discord server (https://discord.gg/tachiyomi), and jump in the tachiyomi-az-sy channel and I can give you a rundown on how to do it
This commit is contained in:
@@ -286,7 +286,7 @@ class BackupRestoreService : Service() {
|
||||
backupManager.restoreSavedSearches(savedSearchesJson)
|
||||
|
||||
restoreProgress += 1
|
||||
showRestoreProgress(restoreProgress, restoreAmount, getString(R.string.eh_saved_searches))
|
||||
showRestoreProgress(restoreProgress, restoreAmount, getString(R.string.saved_searches))
|
||||
}
|
||||
// SY <--
|
||||
|
||||
|
||||
@@ -98,7 +98,7 @@ open class SourceManager(private val context: Context) {
|
||||
XLog.d("[EXH] Delegating source: %s -> %s!", sourceQName, delegate.newSourceClass.qualifiedName)
|
||||
val enhancedSource = EnhancedHttpSource(
|
||||
source,
|
||||
delegate.newSourceClass.constructors.find { it.parameters.size == 1 }!!.call(source)
|
||||
delegate.newSourceClass.constructors.find { it.parameters.size == 2 }!!.call(source, context)
|
||||
)
|
||||
val map = listOf(DelegatedSource(enhancedSource.originalSource.name, enhancedSource.originalSource.id, enhancedSource.originalSource::class.qualifiedName ?: delegate.originalSourceQualifiedClassName, (enhancedSource.enhancedSource as DelegatedHttpSource)::class, delegate.factory)).associateBy { it.originalSourceQualifiedClassName }
|
||||
currentDelegatedSources.plusAssign(map)
|
||||
@@ -132,12 +132,12 @@ open class SourceManager(private val context: Context) {
|
||||
if (prefs.enableExhentai().get()) {
|
||||
exSrcs += EHentai(EXH_SOURCE_ID, true, context)
|
||||
}
|
||||
exSrcs += PervEden(PERV_EDEN_EN_SOURCE_ID, PervEdenLang.en)
|
||||
exSrcs += PervEden(PERV_EDEN_IT_SOURCE_ID, PervEdenLang.it)
|
||||
exSrcs += PervEden(PERV_EDEN_EN_SOURCE_ID, PervEdenLang.en, context)
|
||||
exSrcs += PervEden(PERV_EDEN_IT_SOURCE_ID, PervEdenLang.it, context)
|
||||
exSrcs += NHentai(context)
|
||||
exSrcs += Hitomi()
|
||||
exSrcs += EightMuses()
|
||||
exSrcs += HBrowse()
|
||||
exSrcs += Hitomi(context)
|
||||
exSrcs += EightMuses(context)
|
||||
exSrcs += HBrowse(context)
|
||||
return exSrcs
|
||||
}
|
||||
// SY <--
|
||||
|
||||
@@ -271,7 +271,7 @@ class EHentai(
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(query) {
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
searchMangaRequestObservable(page, query, filters).flatMap {
|
||||
client.newCall(it).asObservableSuccess()
|
||||
}.map { response ->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.all
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import android.os.Build
|
||||
import com.github.salomonbrys.kotson.array
|
||||
@@ -41,7 +42,7 @@ import uy.kohesive.injekt.injectLazy
|
||||
/**
|
||||
* Man, I hate this source :(
|
||||
*/
|
||||
class Hitomi : HttpSource(), LewdSource<HitomiSearchMetadata, Document>, UrlImportableSource {
|
||||
class Hitomi(val context: Context) : HttpSource(), LewdSource<HitomiSearchMetadata, Document>, UrlImportableSource {
|
||||
private val prefs: PreferencesHelper by injectLazy()
|
||||
|
||||
override val id = HITOMI_SOURCE_ID
|
||||
@@ -185,7 +186,7 @@ class Hitomi : HttpSource(), LewdSource<HitomiSearchMetadata, Document>, UrlImpo
|
||||
override fun searchMangaRequest(page: Int, query: String, filters: FilterList) = throw UnsupportedOperationException()
|
||||
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||
return urlImportFetchSearchManga(query) {
|
||||
return urlImportFetchSearchManga(context, query) {
|
||||
val splitQuery = query.split(" ")
|
||||
|
||||
val positive = splitQuery.filter { !it.startsWith('-') }.toMutableList()
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.all
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.source.ConfigurableSource
|
||||
@@ -11,7 +12,7 @@ import exh.source.DelegatedHttpSource
|
||||
import exh.util.urlImportFetchSearchManga
|
||||
import rx.Observable
|
||||
|
||||
class MangaDex(delegate: HttpSource) :
|
||||
class MangaDex(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
ConfigurableSource,
|
||||
UrlImportableSource {
|
||||
@@ -19,7 +20,7 @@ class MangaDex(delegate: HttpSource) :
|
||||
override val matchingHosts: List<String> = listOf("mangadex.org", "www.mangadex.org")
|
||||
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> =
|
||||
urlImportFetchSearchManga(query) {
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ import rx.Observable
|
||||
* NHentai source
|
||||
*/
|
||||
|
||||
class NHentai(context: Context) : HttpSource(), LewdSource<NHentaiSearchMetadata, Response>, UrlImportableSource {
|
||||
class NHentai(val context: Context) : HttpSource(), LewdSource<NHentaiSearchMetadata, Response>, UrlImportableSource {
|
||||
override val metaClass = NHentaiSearchMetadata::class
|
||||
|
||||
override fun fetchPopularManga(page: Int): Observable<MangasPage> {
|
||||
@@ -57,7 +57,7 @@ class NHentai(context: Context) : HttpSource(), LewdSource<NHentaiSearchMetadata
|
||||
"$baseUrl/g/$trimmedIdQuery/"
|
||||
} else query
|
||||
|
||||
return urlImportFetchSearchManga(newQuery) {
|
||||
return urlImportFetchSearchManga(context, newQuery) {
|
||||
searchMangaRequestObservable(page, query, filters).flatMap {
|
||||
client.newCall(it).asObservableSuccess()
|
||||
}.map { response ->
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.all
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
@@ -33,7 +34,7 @@ import org.jsoup.nodes.TextNode
|
||||
import rx.Observable
|
||||
|
||||
// TODO Transform into delegated source
|
||||
class PervEden(override val id: Long, val pvLang: PervEdenLang) :
|
||||
class PervEden(override val id: Long, val pvLang: PervEdenLang, val context: Context) :
|
||||
ParsedHttpSource(),
|
||||
LewdSource<PervEdenSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
@@ -64,7 +65,7 @@ class PervEden(override val id: Long, val pvLang: PervEdenLang) :
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(query) {
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.kizitonwose.time.hours
|
||||
import eu.kanade.tachiyomi.network.GET
|
||||
@@ -41,7 +42,7 @@ import rx.schedulers.Schedulers
|
||||
|
||||
typealias SiteMap = NakedTrie<Unit>
|
||||
|
||||
class EightMuses :
|
||||
class EightMuses(val context: Context) :
|
||||
HttpSource(),
|
||||
LewdSource<EightMusesSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
@@ -177,7 +178,7 @@ class EightMuses :
|
||||
override fun fetchPopularManga(page: Int) = fetchListing(popularMangaRequest(page), false) // TODO Dig
|
||||
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||
return urlImportFetchSearchManga(query) {
|
||||
return urlImportFetchSearchManga(context, query) {
|
||||
fetchListing(searchMangaRequest(page, query, filters), false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import com.github.salomonbrys.kotson.array
|
||||
import com.github.salomonbrys.kotson.string
|
||||
@@ -43,7 +44,7 @@ import org.jsoup.nodes.Element
|
||||
import rx.Observable
|
||||
import rx.schedulers.Schedulers
|
||||
|
||||
class HBrowse : HttpSource(), LewdSource<HBrowseSearchMetadata, Document>, UrlImportableSource {
|
||||
class HBrowse(val context: Context) : HttpSource(), LewdSource<HBrowseSearchMetadata, Document>, UrlImportableSource {
|
||||
/**
|
||||
* An ISO 639-1 compliant language code (two letters in lower case).
|
||||
*/
|
||||
@@ -110,7 +111,7 @@ class HBrowse : HttpSource(), LewdSource<HBrowseSearchMetadata, Document>, UrlIm
|
||||
* @param filters the list of filters to apply.
|
||||
*/
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList): Observable<MangasPage> {
|
||||
return urlImportFetchSearchManga(query) {
|
||||
return urlImportFetchSearchManga(context, query) {
|
||||
fetchSearchMangaInternal(page, query, filters)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
@@ -19,7 +20,7 @@ import okhttp3.HttpUrl.Companion.toHttpUrlOrNull
|
||||
import org.jsoup.nodes.Document
|
||||
import rx.Observable
|
||||
|
||||
class HentaiCafe(delegate: HttpSource) :
|
||||
class HentaiCafe(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
LewdSource<HentaiCafeSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
@@ -34,7 +35,7 @@ class HentaiCafe(delegate: HttpSource) :
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(query) {
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
@@ -18,7 +19,7 @@ import exh.util.urlImportFetchSearchManga
|
||||
import org.jsoup.nodes.Document
|
||||
import rx.Observable
|
||||
|
||||
class Pururin(delegate: HttpSource) :
|
||||
class Pururin(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
LewdSource<PururinSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
@@ -38,7 +39,7 @@ class Pururin(delegate: HttpSource) :
|
||||
"$baseUrl/gallery/$trimmedIdQuery/-"
|
||||
} else query
|
||||
|
||||
return urlImportFetchSearchManga(newQuery) {
|
||||
return urlImportFetchSearchManga(context, newQuery) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package eu.kanade.tachiyomi.source.online.english
|
||||
|
||||
import android.content.Context
|
||||
import android.net.Uri
|
||||
import eu.kanade.tachiyomi.network.asObservableSuccess
|
||||
import eu.kanade.tachiyomi.source.model.FilterList
|
||||
@@ -19,7 +20,7 @@ import java.util.Locale
|
||||
import org.jsoup.nodes.Document
|
||||
import rx.Observable
|
||||
|
||||
class Tsumino(delegate: HttpSource) :
|
||||
class Tsumino(delegate: HttpSource, val context: Context) :
|
||||
DelegatedHttpSource(delegate),
|
||||
LewdSource<TsuminoSearchMetadata, Document>,
|
||||
UrlImportableSource {
|
||||
@@ -28,7 +29,7 @@ class Tsumino(delegate: HttpSource) :
|
||||
|
||||
// Support direct URL importing
|
||||
override fun fetchSearchManga(page: Int, query: String, filters: FilterList) =
|
||||
urlImportFetchSearchManga(query) {
|
||||
urlImportFetchSearchManga(context, query) {
|
||||
super.fetchSearchManga(page, query, filters)
|
||||
}
|
||||
|
||||
|
||||
+10
-11
@@ -64,7 +64,6 @@ import kotlinx.coroutines.flow.launchIn
|
||||
import kotlinx.coroutines.flow.onEach
|
||||
import reactivecircus.flowbinding.appcompat.QueryTextEvent
|
||||
import reactivecircus.flowbinding.appcompat.queryTextEvents
|
||||
import uy.kohesive.injekt.api.get
|
||||
import uy.kohesive.injekt.injectLazy
|
||||
|
||||
/**
|
||||
@@ -193,7 +192,7 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
|
||||
if (presenter.sourceFilters.isEmpty()) {
|
||||
// SY -->
|
||||
actionFab?.text = activity!!.getString(R.string.eh_saved_searches)
|
||||
actionFab?.text = activity!!.getString(R.string.saved_searches)
|
||||
// SY <--
|
||||
}
|
||||
|
||||
@@ -218,8 +217,8 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
onSaveClicked = {
|
||||
filterSheet?.context?.let {
|
||||
MaterialDialog(it)
|
||||
.title(text = "Save current search query?")
|
||||
.input("My search name", hintRes = null) { _, searchName ->
|
||||
.title(R.string.save_search)
|
||||
.input(hintRes = R.string.save_search_hint) { _, searchName ->
|
||||
val oldSavedSearches = presenter.loadSearches()
|
||||
if (searchName.isNotBlank() &&
|
||||
oldSavedSearches.size < MAX_SAVED_SEARCHES
|
||||
@@ -248,8 +247,8 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
if (search == null) {
|
||||
filterSheet?.context?.let {
|
||||
MaterialDialog(it)
|
||||
.title(text = "Failed to load saved searches!")
|
||||
.message(text = "An error occurred while loading your saved searches.")
|
||||
.title(R.string.save_search_failed_to_load)
|
||||
.message(R.string.save_search_failed_to_load_message)
|
||||
.cancelable(true)
|
||||
.cancelOnTouchOutside(true)
|
||||
.show()
|
||||
@@ -275,8 +274,8 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
if (search == null || search.name != name) {
|
||||
filterSheet?.context?.let {
|
||||
MaterialDialog(it)
|
||||
.title(text = "Failed to delete saved search!")
|
||||
.message(text = "An error occurred while deleting the search.")
|
||||
.title(R.string.save_search_failed_to_delete)
|
||||
.message(R.string.save_search_failed_to_delete_message)
|
||||
.cancelable(true)
|
||||
.cancelOnTouchOutside(true)
|
||||
.show()
|
||||
@@ -286,10 +285,10 @@ open class BrowseSourceController(bundle: Bundle) :
|
||||
|
||||
filterSheet?.context?.let {
|
||||
MaterialDialog(it)
|
||||
.title(text = "Delete saved search query?")
|
||||
.message(text = "Are you sure you wish to delete your saved search query: '${search.name}'?")
|
||||
.title(R.string.save_search_delete)
|
||||
.message(text = it.getString(R.string.save_search_delete_message, search.name))
|
||||
.positiveButton(R.string.action_cancel)
|
||||
.negativeButton(text = "Confirm") {
|
||||
.negativeButton(android.R.string.yes) {
|
||||
val newSearches = savedSearches.filterIndexed { index, _ ->
|
||||
index != indexToDelete
|
||||
}
|
||||
|
||||
@@ -696,7 +696,7 @@ class LibraryController(
|
||||
private fun showSyncProgressDialog() {
|
||||
favSyncDialog?.dismiss()
|
||||
favSyncDialog = buildDialog()
|
||||
?.title(text = "Favorites syncing")
|
||||
?.title(R.string.favorites_syncing)
|
||||
?.cancelable(false)
|
||||
// ?.progress(true, 0)
|
||||
favSyncDialog?.show()
|
||||
@@ -723,15 +723,15 @@ class LibraryController(
|
||||
|
||||
favSyncDialog?.dismiss()
|
||||
favSyncDialog = buildDialog()
|
||||
?.title(text = "Favorites sync error")
|
||||
?.message(text = status.message + " Sync will not start until the gallery is in only one category.")
|
||||
?.title(R.string.favorites_sync_error)
|
||||
?.message(text = activity!!.getString(R.string.favorites_sync_bad_library_state, status.message))
|
||||
?.cancelable(false)
|
||||
?.positiveButton(text = "Show gallery") {
|
||||
?.positiveButton(R.string.show_gallery) {
|
||||
openManga(status.manga)
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle())
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle(activity!!))
|
||||
}
|
||||
?.negativeButton(android.R.string.ok) {
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle())
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle(activity!!))
|
||||
}
|
||||
favSyncDialog?.show()
|
||||
}
|
||||
@@ -740,11 +740,11 @@ class LibraryController(
|
||||
|
||||
favSyncDialog?.dismiss()
|
||||
favSyncDialog = buildDialog()
|
||||
?.title(text = "Favorites sync error")
|
||||
?.message(text = "An error occurred during the sync process: ${status.message}")
|
||||
?.title(R.string.favorites_sync_error)
|
||||
?.message(text = activity!!.getString(R.string.favorites_sync_error_string, status.message))
|
||||
?.cancelable(false)
|
||||
?.positiveButton(android.R.string.ok) {
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle())
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle(activity!!))
|
||||
}
|
||||
favSyncDialog?.show()
|
||||
}
|
||||
@@ -753,11 +753,11 @@ class LibraryController(
|
||||
|
||||
favSyncDialog?.dismiss()
|
||||
favSyncDialog = buildDialog()
|
||||
?.title(text = "Favorites sync complete with errors")
|
||||
?.message(text = "Errors occurred during the sync process that were ignored:\n${status.message}")
|
||||
?.title(R.string.favorites_sync_done_errors)
|
||||
?.message(text = activity!!.getString(R.string.favorites_sync_done_errors_message, status.message))
|
||||
?.cancelable(false)
|
||||
?.positiveButton(android.R.string.ok) {
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle())
|
||||
presenter.favoritesSync.status.onNext(FavoritesSyncStatus.Idle(activity!!))
|
||||
}
|
||||
favSyncDialog?.show()
|
||||
}
|
||||
|
||||
@@ -548,7 +548,7 @@ class MangaController :
|
||||
startActivityForResult(
|
||||
Intent.createChooser(
|
||||
intent,
|
||||
resources?.getString(R.string.select_cover_image)
|
||||
resources?.getString(R.string.action_edit_cover)
|
||||
),
|
||||
REQUEST_EDIT_MANGA_COVER
|
||||
)
|
||||
@@ -750,7 +750,7 @@ class MangaController :
|
||||
presenter.editCoverWithStream(uri)
|
||||
}
|
||||
} catch (error: IOException) {
|
||||
activity.toast(R.string.failed_to_update_cover)
|
||||
activity.toast(R.string.notification_cover_update_failed)
|
||||
Timber.e(error)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ class MangaInfoHeaderAdapter(
|
||||
binding.btnSmartSearch.clicks()
|
||||
.onEach { controller.openSmartSearch() }
|
||||
.launchIn(scope)
|
||||
binding.btnSmartSearch.setTooltip(R.string.eh_merge_with_another_source)
|
||||
binding.btnSmartSearch.setTooltip(R.string.merge_with_another_source)
|
||||
}
|
||||
// SY <--
|
||||
|
||||
|
||||
@@ -146,12 +146,12 @@ class SettingsAdvancedController : SettingsController() {
|
||||
|
||||
// --> EXH
|
||||
preferenceCategory {
|
||||
title = "Developer tools"
|
||||
titleRes = R.string.developer_tools
|
||||
isPersistent = false
|
||||
|
||||
switchPreference {
|
||||
title = "Enable integrated hentai features"
|
||||
summary = "This is a experimental feature that will disable all hentai features if toggled off"
|
||||
titleRes = R.string.toggle_hentai_features
|
||||
summaryRes = R.string.toggle_hentai_features_summary
|
||||
key = Keys.eh_is_hentai_enabled
|
||||
defaultValue = true
|
||||
|
||||
@@ -212,35 +212,35 @@ class SettingsAdvancedController : SettingsController() {
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
title = "Enable delegated sources"
|
||||
titleRes = R.string.toggle_delegated_sources
|
||||
key = Keys.eh_delegateSources
|
||||
defaultValue = true
|
||||
summary = "Apply ${context.getString(R.string.app_name)} enhancements to the following sources if they are installed: ${DELEGATED_SOURCES.values.map { it.sourceName }.distinct().joinToString()}"
|
||||
summary = context.getString(R.string.toggle_delegated_sources_summary, context.getString(R.string.app_name), DELEGATED_SOURCES.values.map { it.sourceName }.distinct().joinToString())
|
||||
}
|
||||
|
||||
intListPreference {
|
||||
key = Keys.eh_logLevel
|
||||
title = "Log level"
|
||||
titleRes = R.string.log_level
|
||||
|
||||
entries = EHLogLevel.values().map {
|
||||
"${it.name.toLowerCase().capitalize()} (${it.description})"
|
||||
"${context.getString(it.nameRes)} (${context.getString(it.description)})"
|
||||
}.toTypedArray()
|
||||
entryValues = EHLogLevel.values().mapIndexed { index, _ -> "$index" }.toTypedArray()
|
||||
defaultValue = "0"
|
||||
|
||||
summary = "Changing this can impact app performance. Force-restart app after changing. Current value: %s"
|
||||
summaryRes = R.string.log_level_summary
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
title = "Enable source blacklist"
|
||||
titleRes = R.string.enable_source_blacklist
|
||||
key = Keys.eh_enableSourceBlacklist
|
||||
defaultValue = true
|
||||
summary = "Hide extensions/sources that are incompatible with ${context.getString(R.string.app_name)}. Force-restart app after changing."
|
||||
summary = context.getString(R.string.enable_source_blacklist_summary, context.getString(R.string.app_name))
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Open debug menu"
|
||||
summary = HtmlCompat.fromHtml("DO NOT TOUCH THIS MENU UNLESS YOU KNOW WHAT YOU ARE DOING! <font color='red'>IT CAN CORRUPT YOUR LIBRARY!</font>", HtmlCompat.FROM_HTML_MODE_LEGACY)
|
||||
titleRes = R.string.open_debug_menu
|
||||
summary = HtmlCompat.fromHtml(context.getString(R.string.open_debug_menu_summary), HtmlCompat.FROM_HTML_MODE_LEGACY)
|
||||
onClick { router.pushController(SettingsDebugController().withFadeTransaction()) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import eu.kanade.tachiyomi.util.preference.preference
|
||||
import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
||||
import eu.kanade.tachiyomi.util.preference.summaryRes
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
import eu.kanade.tachiyomi.util.system.toast
|
||||
import exh.EH_SOURCE_ID
|
||||
import exh.EXH_SOURCE_ID
|
||||
@@ -143,14 +144,14 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
title = "E-Hentai"
|
||||
titleRes = R.string.pref_category_eh
|
||||
|
||||
preferenceCategory {
|
||||
title = "E-Hentai Website Account Settings"
|
||||
titleRes = R.string.ehentai_prefs_account_settings
|
||||
|
||||
switchPreference {
|
||||
title = "Enable ExHentai"
|
||||
summaryOff = "Requires login"
|
||||
titleRes = R.string.enable_exhentai
|
||||
summaryOff = context.getString(R.string.requires_login)
|
||||
key = PreferenceKeys.eh_enableExHentai
|
||||
isPersistent = false
|
||||
defaultValue = false
|
||||
@@ -178,33 +179,23 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
intListPreference {
|
||||
title = "Use Hentai@Home Network"
|
||||
titleRes = R.string.use_hentai_at_home
|
||||
|
||||
key = PreferenceKeys.eh_enable_hah
|
||||
if (preferences.eh_hathPerksCookies().get().isBlank()) {
|
||||
summary = "Do you wish to load images through the Hentai@Home Network, if available? Disabling this option will reduce the amount of pages you are able to view\nOptions:\n - Any client (Recommended)\n - Default port clients only (Can be slower. Enable if behind firewall/proxy that blocks outgoing non-standard ports.)"
|
||||
entries = arrayOf(
|
||||
"Any client (Recommended)",
|
||||
"Default port clients only"
|
||||
)
|
||||
entryValues = arrayOf("0", "1")
|
||||
} else {
|
||||
summary = "Do you wish to load images through the Hentai@Home Network, if available? Disabling this option will reduce the amount of pages you are able to view\nOptions:\n - Any client (Recommended)\n - Default port clients only (Can be slower. Enable if behind firewall/proxy that blocks outgoing non-standard ports.)\n - No (Donator only. You will not be able to browse as many pages, enable only if having severe problems.)"
|
||||
entries = arrayOf(
|
||||
"Any client (Recommended)",
|
||||
"Default port clients only",
|
||||
"No(will select Default port clients only if you are not a donator)"
|
||||
)
|
||||
entryValues = arrayOf("0", "1", "2")
|
||||
}
|
||||
summaryRes = R.string.use_hentai_at_home_summary
|
||||
entriesRes = arrayOf(
|
||||
R.string.use_hentai_at_home_option_1,
|
||||
R.string.use_hentai_at_home_option_2
|
||||
)
|
||||
entryValues = arrayOf("0", "1")
|
||||
|
||||
onChange { preferences.useHentaiAtHome().reconfigure() }
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
switchPreference {
|
||||
title = "Show Japanese titles in search results"
|
||||
summaryOn = "Currently showing Japanese titles in search results. Clear the chapter cache after changing this (in the Advanced section)"
|
||||
summaryOff = "Currently showing English/Romanized titles in search results. Clear the chapter cache after changing this (in the Advanced section)"
|
||||
titleRes = R.string.show_japanese_titles
|
||||
summaryOn = context.getString(R.string.show_japanese_titles_option_1)
|
||||
summaryOff = context.getString(R.string.show_japanese_titles_option_2)
|
||||
key = "use_jp_title"
|
||||
defaultValue = false
|
||||
|
||||
@@ -212,9 +203,9 @@ class SettingsEhController : SettingsController() {
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
switchPreference {
|
||||
title = "Use original images"
|
||||
summaryOn = "Currently using original images"
|
||||
summaryOff = "Currently using resampled images"
|
||||
titleRes = R.string.use_original_images
|
||||
summaryOn = context.getString(R.string.use_original_images_on)
|
||||
summaryOff = context.getString(R.string.use_original_images_off)
|
||||
key = PreferenceKeys.eh_useOrigImages
|
||||
defaultValue = false
|
||||
|
||||
@@ -222,28 +213,28 @@ class SettingsEhController : SettingsController() {
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Watched Tags"
|
||||
summary = "Opens a webview to your E/ExHentai watched tags page"
|
||||
titleRes = R.string.watched_tags
|
||||
summaryRes = R.string.watched_tags_summary
|
||||
onClick {
|
||||
val intent = if (preferences.enableExhentai().get()) {
|
||||
WebViewActivity.newIntent(activity!!, url = "https://exhentai.org/mytags", title = "ExHentai Watched Tags")
|
||||
WebViewActivity.newIntent(activity!!, url = "https://exhentai.org/mytags", title = context.getString(R.string.watched_tags_exh))
|
||||
} else {
|
||||
WebViewActivity.newIntent(activity!!, url = "https://e-hentai.org/mytags", title = "E-Hentai Watched Tags")
|
||||
WebViewActivity.newIntent(activity!!, url = "https://e-hentai.org/mytags", title = context.getString(R.string.watched_tags_eh))
|
||||
}
|
||||
startActivity(intent)
|
||||
}
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Tag Filtering Threshold"
|
||||
titleRes = R.string.tag_filtering_threshold
|
||||
key = PreferenceKeys.eh_tag_filtering_value
|
||||
defaultValue = 0
|
||||
|
||||
summary = "You can soft filter tags by adding them to the \"My Tags\" E/ExHentai page with a negative weight. If a gallery has tags that add up to weight below this value, it is filtered from view. This threshold can be set between -9999 and 0. Currently: ${preferences.ehTagFilterValue().get()}"
|
||||
summaryRes = R.string.tag_filtering_threshhold_summary
|
||||
|
||||
onClick {
|
||||
MaterialDialog(activity!!)
|
||||
.title(text = "Tag Filtering Threshold")
|
||||
.title(R.string.tag_filtering_threshold)
|
||||
.input(
|
||||
inputType = InputType.TYPE_NUMBER_FLAG_SIGNED,
|
||||
waitForPositiveButton = false,
|
||||
@@ -255,14 +246,13 @@ class SettingsEhController : SettingsController() {
|
||||
if (value != null && value in -9999..0) {
|
||||
inputField.error = null
|
||||
} else {
|
||||
inputField.error = "Must be between -9999 and 0!"
|
||||
inputField.error = context.getString(R.string.tag_filtering_threshhold_error)
|
||||
}
|
||||
dialog.setActionButtonEnabled(WhichButton.POSITIVE, value != null && value in -9999..0)
|
||||
}
|
||||
.positiveButton(android.R.string.ok) {
|
||||
val value = it.getInputField().text.toString().toInt()
|
||||
preferences.ehTagFilterValue().set(value)
|
||||
summary = "You can soft filter tags by adding them to the \"My Tags\" E/ExHentai page with a negative weight. If a gallery has tags that add up to weight below this value, it is filtered from view. This threshold can be set between 0 and -9999. Currently: $value"
|
||||
preferences.ehTagFilterValue().reconfigure()
|
||||
}
|
||||
.show()
|
||||
@@ -270,15 +260,15 @@ class SettingsEhController : SettingsController() {
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Tag Watching Threshold"
|
||||
titleRes = R.string.tag_watching_threshhold
|
||||
key = PreferenceKeys.eh_tag_watching_value
|
||||
defaultValue = 0
|
||||
|
||||
summary = "Recently uploaded galleries will be included on the watched screen if it has at least one watched tag with positive weight, and the sum of weights on its watched tags add up to this value or higher. This threshold can be set between 0 and 9999. Currently: ${preferences.ehTagWatchingValue().get()}"
|
||||
summaryRes = R.string.tag_watching_threshhold_summary
|
||||
|
||||
onClick {
|
||||
MaterialDialog(activity!!)
|
||||
.title(text = "Tag Watching Threshold")
|
||||
.title(R.string.tag_watching_threshhold)
|
||||
.input(
|
||||
inputType = InputType.TYPE_NUMBER_FLAG_SIGNED,
|
||||
maxLength = 4,
|
||||
@@ -291,14 +281,13 @@ class SettingsEhController : SettingsController() {
|
||||
if (value != null && value in 0..9999) {
|
||||
inputField.error = null
|
||||
} else {
|
||||
inputField.error = "Must be between 0 and 9999!"
|
||||
inputField.error = context.getString(R.string.tag_watching_threshhold_error)
|
||||
}
|
||||
dialog.setActionButtonEnabled(WhichButton.POSITIVE, value != null && value in 0..9999)
|
||||
}
|
||||
.positiveButton(android.R.string.ok) {
|
||||
val value = it.getInputField().text.toString().toInt()
|
||||
preferences.ehTagWatchingValue().set(value)
|
||||
summary = "Recently uploaded galleries will be included on the watched screen if it has at least one watched tag with positive weight, and the sum of weights on its watched tags add up to this value or higher. This threshold can be set between 0 and 9999. Currently: $value"
|
||||
preferences.ehTagWatchingValue().reconfigure()
|
||||
}
|
||||
.show()
|
||||
@@ -306,13 +295,13 @@ class SettingsEhController : SettingsController() {
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Language Filtering"
|
||||
summary = "If you wish to hide galleries in certain languages from the gallery list and searches, select them in the dialog that will popup.\nNote that matching galleries will never appear regardless of your search query.\nTldr checkmarked = exclude"
|
||||
titleRes = R.string.language_filtering
|
||||
summaryRes = R.string.language_filtering_summary
|
||||
|
||||
onClick {
|
||||
MaterialDialog(activity!!)
|
||||
.title(text = "Language Filtering")
|
||||
.message(text = "If you wish to hide galleries in certain languages from the gallery list and searches, select them in the dialog that will popup.\nNote that matching galleries will never appear regardless of your search query.\nTldr checkmarked = exclude")
|
||||
.title(R.string.language_filtering)
|
||||
.message(R.string.language_filtering_summary)
|
||||
.customView(R.layout.eh_dialog_languages, scrollable = true)
|
||||
.positiveButton(android.R.string.ok) {
|
||||
val customView = it.view.contentLayout.customView!!
|
||||
@@ -444,13 +433,13 @@ class SettingsEhController : SettingsController() {
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
preference {
|
||||
title = "Front Page Categories"
|
||||
summary = "What categories would you like to show by default on the front page and in searches? They can still be enabled by enabling their filters"
|
||||
titleRes = R.string.frong_page_categories
|
||||
summaryRes = R.string.fromt_page_categories_summary
|
||||
|
||||
onClick {
|
||||
MaterialDialog(activity!!)
|
||||
.title(text = "Front Page Categories")
|
||||
.message(text = "What categories would you like to show by default on the front page and in searches? They can still be enabled by enabling their filters")
|
||||
.title(R.string.frong_page_categories)
|
||||
.message(R.string.fromt_page_categories_summary)
|
||||
.customView(R.layout.eh_dialog_categories, scrollable = true)
|
||||
.positiveButton {
|
||||
val customView = it.view.contentLayout.customView!!
|
||||
@@ -497,22 +486,22 @@ class SettingsEhController : SettingsController() {
|
||||
switchPreference {
|
||||
defaultValue = false
|
||||
key = PreferenceKeys.eh_watched_list_default_state
|
||||
title = "Watched List Filter Default State"
|
||||
summary = "When browsing ExHentai/E-Hentai should the watched list filter be enabled by default"
|
||||
}
|
||||
titleRes = R.string.watched_list_default
|
||||
summaryRes = R.string.watched_list_state_summary
|
||||
}.dependency = PreferenceKeys.eh_enableExHentai
|
||||
|
||||
listPreference {
|
||||
defaultValue = "auto"
|
||||
key = PreferenceKeys.eh_ehentai_quality
|
||||
summary = "The quality of the downloaded images"
|
||||
title = "Image quality"
|
||||
entries = arrayOf(
|
||||
"Auto",
|
||||
"2400x",
|
||||
"1600x",
|
||||
"1280x",
|
||||
"980x",
|
||||
"780x"
|
||||
summaryRes = R.string.eh_image_quality_summary
|
||||
titleRes = R.string.eh_image_quality
|
||||
entriesRes = arrayOf(
|
||||
R.string.eh_image_quality_auto,
|
||||
R.string.eh_image_quality_2400,
|
||||
R.string.eh_image_quality_1600,
|
||||
R.string.eh_image_quality_1280,
|
||||
R.string.eh_image_quality_980,
|
||||
R.string.eh_image_quality_780
|
||||
)
|
||||
entryValues = arrayOf(
|
||||
"auto",
|
||||
@@ -528,18 +517,18 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
preferenceCategory {
|
||||
title = "Favorites sync"
|
||||
titleRes = R.string.favorites_sync
|
||||
|
||||
switchPreference {
|
||||
title = "Disable favorites uploading"
|
||||
summary = "Favorites are only downloaded from ExHentai. Any changes to favorites in the app will not be uploaded. Prevents accidental loss of favorites on ExHentai. Note that removals will still be downloaded (if you remove a favorites on ExHentai, it will be removed in the app as well)."
|
||||
titleRes = R.string.disable_favorites_uploading
|
||||
summaryRes = R.string.disable_favorites_uploading_summary
|
||||
key = PreferenceKeys.eh_readOnlySync
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Show favorites sync notes"
|
||||
summary = "Show some information regarding the favorites sync feature"
|
||||
titleRes = R.string.show_favorite_sync_notes
|
||||
summaryRes = R.string.show_favorite_sync_notes_summary
|
||||
|
||||
onClick {
|
||||
activity?.let {
|
||||
@@ -549,21 +538,21 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
title = "Ignore sync errors when possible"
|
||||
summary = "Do not abort immediately when encountering errors during the sync process. Errors will still be displayed when the sync is complete. Can cause loss of favorites in some cases. Useful when syncing large libraries."
|
||||
titleRes = R.string.ignore_sync_errors
|
||||
summaryRes = R.string.ignore_sync_errors_summary
|
||||
key = PreferenceKeys.eh_lenientSync
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Force sync state reset"
|
||||
summary = "Performs a full resynchronization on the next sync. Removals will not be synced. All favorites in the app will be re-uploaded to ExHentai and all favorites on ExHentai will be re-downloaded into the app. Useful for repairing sync after sync has been interrupted."
|
||||
titleRes = R.string.force_sync_state_reset
|
||||
summaryRes = R.string.force_sync_state_reset_summary
|
||||
|
||||
onClick {
|
||||
activity?.let { activity ->
|
||||
MaterialDialog(activity)
|
||||
.title(R.string.eh_force_sync_reset_title)
|
||||
.message(R.string.eh_force_sync_reset_message)
|
||||
.title(R.string.favorites_sync_reset)
|
||||
.message(R.string.favorites_sync_reset_message)
|
||||
.positiveButton(android.R.string.yes) {
|
||||
LocalFavoritesStorage().apply {
|
||||
getRealm().use {
|
||||
@@ -572,7 +561,7 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
}
|
||||
}
|
||||
activity.toast("Sync state reset", Toast.LENGTH_LONG)
|
||||
activity.toast(context.getString(R.string.sync_state_reset), Toast.LENGTH_LONG)
|
||||
}
|
||||
.negativeButton(android.R.string.no)
|
||||
.cancelable(false)
|
||||
@@ -583,20 +572,20 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
preferenceCategory {
|
||||
title = "Gallery update checker"
|
||||
titleRes = R.string.gallery_update_checker
|
||||
|
||||
intListPreference {
|
||||
key = PreferenceKeys.eh_autoUpdateFrequency
|
||||
title = "Time between update batches"
|
||||
entries = arrayOf(
|
||||
"Never update galleries",
|
||||
"1 hour",
|
||||
"2 hours",
|
||||
"3 hours",
|
||||
"6 hours",
|
||||
"12 hours",
|
||||
"24 hours",
|
||||
"48 hours"
|
||||
titleRes = R.string.time_between_batches
|
||||
entriesRes = arrayOf(
|
||||
R.string.time_between_batches_never,
|
||||
R.string.time_between_batches_1_hour,
|
||||
R.string.time_between_batches_2_hours,
|
||||
R.string.time_between_batches_3_hours,
|
||||
R.string.time_between_batches_6_hours,
|
||||
R.string.time_between_batches_12_hours,
|
||||
R.string.time_between_batches_24_hours,
|
||||
R.string.time_between_batches_48_hours
|
||||
)
|
||||
entryValues = arrayOf("0", "1", "2", "3", "6", "12", "24", "48")
|
||||
defaultValue = "0"
|
||||
@@ -604,11 +593,9 @@ class SettingsEhController : SettingsController() {
|
||||
preferences.eh_autoUpdateFrequency().asFlow()
|
||||
.onEach { newVal ->
|
||||
summary = if (newVal == 0) {
|
||||
"${context.getString(R.string.app_name)} will currently never check galleries in your library for updates."
|
||||
context.getString(R.string.time_between_batches_summary_1, context.getString(R.string.app_name))
|
||||
} else {
|
||||
"${context.getString(R.string.app_name)} checks/updates galleries in batches. " +
|
||||
"This means it will wait $newVal hour(s), check ${EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION} galleries," +
|
||||
" wait $newVal hour(s), check ${EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION} and so on..."
|
||||
context.getString(R.string.time_between_batches_summary_2, context.getString(R.string.app_name), newVal, EHentaiUpdateWorkerConstants.UPDATES_PER_ITERATION)
|
||||
}
|
||||
}
|
||||
.launchIn(scope)
|
||||
@@ -622,7 +609,7 @@ class SettingsEhController : SettingsController() {
|
||||
|
||||
multiSelectListPreference {
|
||||
key = PreferenceKeys.eh_autoUpdateRestrictions
|
||||
title = "Auto update restrictions"
|
||||
titleRes = R.string.auto_update_restrictions
|
||||
entriesRes = arrayOf(R.string.wifi, R.string.charging)
|
||||
entryValues = arrayOf("wifi", "ac")
|
||||
summaryRes = R.string.pref_library_update_restriction_summary
|
||||
@@ -639,11 +626,11 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
preference {
|
||||
title = "Show updater statistics"
|
||||
titleRes = R.string.show_updater_statistics
|
||||
|
||||
onClick {
|
||||
val progress = MaterialDialog(context)
|
||||
.message(R.string.eh_show_update_statistics_dialog)
|
||||
.message(R.string.gallery_updater_statistics_collection)
|
||||
.cancelable(false)
|
||||
progress.show()
|
||||
|
||||
@@ -655,8 +642,8 @@ class SettingsEhController : SettingsController() {
|
||||
}
|
||||
|
||||
val statsText = if (stats != null) {
|
||||
"The updater last ran ${Humanize.naturalTime(Date(stats.startTime))}, and checked ${stats.updateCount} out of the ${stats.possibleUpdates} galleries that were ready for checking."
|
||||
} else "The updater has not ran yet."
|
||||
context.getString(R.string.gallery_updater_stats_text, Humanize.naturalTime(Date(stats.startTime)), stats.updateCount, stats.possibleUpdates)
|
||||
} else context.getString(R.string.gallery_updater_not_ran_yet)
|
||||
|
||||
val allMeta = db.getFavoriteMangaWithMetadata().await().filter {
|
||||
it.source == EH_SOURCE_ID || it.source == EXH_SOURCE_ID
|
||||
@@ -672,26 +659,24 @@ class SettingsEhController : SettingsController() {
|
||||
}.count()
|
||||
}
|
||||
|
||||
"""
|
||||
$statsText
|
||||
|
||||
Galleries that were checked in the last:
|
||||
- hour: ${metaInRelativeDuration(1.hours)}
|
||||
- 6 hours: ${metaInRelativeDuration(6.hours)}
|
||||
- 12 hours: ${metaInRelativeDuration(12.hours)}
|
||||
- day: ${metaInRelativeDuration(1.days)}
|
||||
- 2 days: ${metaInRelativeDuration(2.days)}
|
||||
- week: ${metaInRelativeDuration(7.days)}
|
||||
- month: ${metaInRelativeDuration(30.days)}
|
||||
- year: ${metaInRelativeDuration(365.days)}
|
||||
""".trimIndent()
|
||||
statsText + "\n\n" + context.getString(
|
||||
R.string.gallery_updater_stats_time,
|
||||
metaInRelativeDuration(1.hours),
|
||||
metaInRelativeDuration(6.hours),
|
||||
metaInRelativeDuration(12.hours),
|
||||
metaInRelativeDuration(1.days),
|
||||
metaInRelativeDuration(2.days),
|
||||
metaInRelativeDuration(7.days),
|
||||
metaInRelativeDuration(30.days),
|
||||
metaInRelativeDuration(365.days)
|
||||
)
|
||||
} finally {
|
||||
progress.dismiss()
|
||||
}
|
||||
|
||||
withContext(Dispatchers.Main) {
|
||||
MaterialDialog(context)
|
||||
.title(text = "Gallery updater statistics")
|
||||
.title(R.string.gallery_updater_statistics)
|
||||
.message(text = updateInfo)
|
||||
.positiveButton(android.R.string.ok)
|
||||
.show()
|
||||
|
||||
@@ -16,6 +16,7 @@ import eu.kanade.tachiyomi.util.preference.onChange
|
||||
import eu.kanade.tachiyomi.util.preference.onClick
|
||||
import eu.kanade.tachiyomi.util.preference.preference
|
||||
import eu.kanade.tachiyomi.util.preference.preferenceCategory
|
||||
import eu.kanade.tachiyomi.util.preference.summaryRes
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
import eu.kanade.tachiyomi.util.system.LocaleHelper
|
||||
@@ -252,19 +253,18 @@ class SettingsGeneralController : SettingsController() {
|
||||
}
|
||||
// --> EXH
|
||||
preferenceCategory {
|
||||
titleRes = R.string.eh_settings_category
|
||||
titleRes = R.string.pref_category_fork
|
||||
|
||||
switchPreference {
|
||||
key = Keys.eh_expandFilters
|
||||
title = "Expand all search filters by default"
|
||||
titleRes = R.string.toggle_expand_search_filters
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
switchPreference {
|
||||
key = Keys.eh_autoSolveCaptchas
|
||||
title = "Automatically solve captcha"
|
||||
summary =
|
||||
"Use HIGHLY EXPERIMENTAL automatic ReCAPTCHA solver. Will be grayed out if unsupported by your device."
|
||||
titleRes = R.string.auto_solve_captchas
|
||||
summaryRes = R.string.auto_solve_captchas_summary
|
||||
defaultValue = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys
|
||||
import eu.kanade.tachiyomi.util.preference.defaultValue
|
||||
import eu.kanade.tachiyomi.util.preference.summaryRes
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
|
||||
/**
|
||||
* hitomi.la Settings fragment
|
||||
@@ -11,11 +14,11 @@ import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
|
||||
class SettingsHlController : SettingsController() {
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
title = "hitomi.la"
|
||||
titleRes = R.string.pref_category_hl
|
||||
|
||||
switchPreference {
|
||||
title = "Use high-quality thumbnails"
|
||||
summary = "May slow down search results"
|
||||
titleRes = R.string.high_quality_thumbnails
|
||||
summaryRes = R.string.high_quality_thumbnails_summary
|
||||
key = PreferenceKeys.eh_hl_useHighQualityThumbs
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
@@ -219,11 +219,11 @@ class SettingsLibraryController : SettingsController() {
|
||||
.isNotEmpty()
|
||||
) {
|
||||
preferenceCategory {
|
||||
title = "Migration"
|
||||
titleRes = R.string.migration
|
||||
|
||||
switchPreference {
|
||||
key = Keys.skipPreMigration
|
||||
titleRes = R.string.pref_skip_pre_migration
|
||||
titleRes = R.string.skip_pre_migration
|
||||
summaryRes = R.string.pref_skip_pre_migration_summary
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
@@ -1,9 +1,12 @@
|
||||
package eu.kanade.tachiyomi.ui.setting
|
||||
|
||||
import androidx.preference.PreferenceScreen
|
||||
import eu.kanade.tachiyomi.R
|
||||
import eu.kanade.tachiyomi.data.preference.PreferenceKeys
|
||||
import eu.kanade.tachiyomi.util.preference.defaultValue
|
||||
import eu.kanade.tachiyomi.util.preference.summaryRes
|
||||
import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
import eu.kanade.tachiyomi.util.preference.titleRes
|
||||
|
||||
/**
|
||||
* nhentai Settings fragment
|
||||
@@ -11,11 +14,11 @@ import eu.kanade.tachiyomi.util.preference.switchPreference
|
||||
|
||||
class SettingsNhController : SettingsController() {
|
||||
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
|
||||
title = "nhentai"
|
||||
titleRes = R.string.pref_category_nh
|
||||
|
||||
switchPreference {
|
||||
title = "Use high-quality thumbnails"
|
||||
summary = "May slow down search results"
|
||||
titleRes = R.string.high_quality_thumbnails
|
||||
summaryRes = R.string.high_quality_thumbnails_summary
|
||||
key = PreferenceKeys.eh_nh_useHighQualityThumbs
|
||||
defaultValue = false
|
||||
}
|
||||
|
||||
@@ -140,34 +140,31 @@ class SettingsReaderController : SettingsController() {
|
||||
|
||||
// EXH -->
|
||||
preferenceCategory {
|
||||
titleRes = R.string.eh_settings_category
|
||||
titleRes = R.string.pref_category_fork
|
||||
|
||||
intListPreference {
|
||||
key = Keys.eh_readerThreads
|
||||
title = "Download threads"
|
||||
titleRes = R.string.download_threads
|
||||
entries = arrayOf("1", "2", "3", "4", "5")
|
||||
entryValues = entries
|
||||
defaultValue = "2"
|
||||
summary =
|
||||
"Higher values can speed up image downloading significantly, but can also trigger bans. Recommended value is 2 or 3. Current value is: %s"
|
||||
summaryRes = R.string.download_threads_summary
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.eh_aggressivePageLoading
|
||||
title = "Aggressively load pages"
|
||||
summary =
|
||||
"Slowly download the entire gallery while reading instead of just loading the pages you are viewing."
|
||||
titleRes = R.string.aggressively_load_pages
|
||||
summaryRes = R.string.aggressively_load_pages_summary
|
||||
defaultValue = false
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.eh_readerInstantRetry
|
||||
title = "Skip queue on retry"
|
||||
summary =
|
||||
"Normally, pressing the retry button on a failed download will wait until the downloader has finished downloading the last page before beginning to re-download the failed page. Enabling this will force the downloader to begin re-downloading the failed page as soon as you press the retry button."
|
||||
titleRes = R.string.skip_queue_on_retry
|
||||
summaryRes = R.string.skip_queue_on_retry_summary
|
||||
defaultValue = true
|
||||
}
|
||||
intListPreference {
|
||||
key = Keys.eh_preload_size
|
||||
title = "Reader Preload amount"
|
||||
titleRes = R.string.reader_preload_amount
|
||||
entryValues = arrayOf(
|
||||
"1",
|
||||
"2",
|
||||
@@ -180,25 +177,24 @@ class SettingsReaderController : SettingsController() {
|
||||
"14",
|
||||
"16"
|
||||
)
|
||||
entries = arrayOf(
|
||||
"1 Page",
|
||||
"2 Pages",
|
||||
"3 Pages",
|
||||
"4 Pages",
|
||||
"6 Pages",
|
||||
"8 Pages",
|
||||
"10 Pages",
|
||||
"12 Pages",
|
||||
"14 Pages",
|
||||
"16 Pages"
|
||||
entriesRes = arrayOf(
|
||||
R.string.reader_preload_amount_1_page,
|
||||
R.string.reader_preload_amount_2_pages,
|
||||
R.string.reader_preload_amount_3_pages,
|
||||
R.string.reader_preload_amount_4_pages,
|
||||
R.string.reader_preload_amount_6_pages,
|
||||
R.string.reader_preload_amount_8_pages,
|
||||
R.string.reader_preload_amount_10_pages,
|
||||
R.string.reader_preload_amount_12_pages,
|
||||
R.string.reader_preload_amount_14_pages,
|
||||
R.string.reader_preload_amount_16_pages
|
||||
)
|
||||
defaultValue = "4"
|
||||
summary =
|
||||
"The amount of pages to preload when reading. Higher values will result in a smoother reading experience, at the cost of higher cache usage, it is recommended to increase the amount of cache you allocate when using larger values"
|
||||
summaryRes = R.string.reader_preload_amount_summary
|
||||
}
|
||||
listPreference {
|
||||
key = Keys.eh_cacheSize
|
||||
title = "Reader cache size"
|
||||
titleRes = R.string.reader_cache_size
|
||||
entryValues = arrayOf(
|
||||
"50",
|
||||
"75",
|
||||
@@ -236,18 +232,17 @@ class SettingsReaderController : SettingsController() {
|
||||
"5 GB"
|
||||
)
|
||||
defaultValue = "75"
|
||||
summary =
|
||||
"The amount of images to save on device while reading. Higher values will result in a smoother reading experience, at the cost of higher disk space usage"
|
||||
summaryRes = R.string.reader_cache_size_summary
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.eh_preserveReadingPosition
|
||||
title = "Preserve reading position on read manga"
|
||||
titleRes = R.string.preserve_reading_position
|
||||
defaultValue = false
|
||||
}
|
||||
switchPreference {
|
||||
key = Keys.eh_use_auto_webtoon
|
||||
title = "Auto Webtoon Mode"
|
||||
summary = "Use auto webtoon mode for manga that are detected to likely use the long strip format"
|
||||
titleRes = R.string.auto_webtoon_mode
|
||||
summaryRes = R.string.auto_webtoon_mode_summary
|
||||
defaultValue = true
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,7 +4,6 @@ import android.content.Context
|
||||
import android.widget.ArrayAdapter
|
||||
import android.widget.Filter
|
||||
import android.widget.Filterable
|
||||
import timber.log.Timber
|
||||
|
||||
class AutoCompleteAdapter(context: Context, resource: Int, var objects: List<String>, val excludePrefix: String?) :
|
||||
ArrayAdapter<String>(context, resource, objects),
|
||||
@@ -35,8 +34,6 @@ class AutoCompleteAdapter(context: Context, resource: Int, var objects: List<Str
|
||||
mOriginalValues = objects
|
||||
}
|
||||
|
||||
Timber.d("$prefix ")
|
||||
|
||||
if (prefix == null || prefix.isEmpty()) {
|
||||
val list = mOriginalValues!!
|
||||
results.values = list
|
||||
@@ -44,7 +41,6 @@ class AutoCompleteAdapter(context: Context, resource: Int, var objects: List<Str
|
||||
} else {
|
||||
val prefixString = prefix.toString()
|
||||
val containsPrefix: Boolean = excludePrefix?.let { prefixString.startsWith(it) } ?: false
|
||||
Timber.d(prefixString)
|
||||
val filterResults = mOriginalValues!!.filter { it.contains(if (excludePrefix != null) prefixString.removePrefix(excludePrefix) else prefixString, true) }
|
||||
results.values = if (containsPrefix) filterResults.map { excludePrefix + it } else filterResults
|
||||
results.count = filterResults.size
|
||||
|
||||
Reference in New Issue
Block a user