Address some deprecation warnings
This commit is contained in:
@@ -170,22 +170,22 @@ object DebugFunctions {
|
||||
fun clearSavedSearches() = prefs.savedSearches().set(emptySet())
|
||||
|
||||
fun listAllSources() = sourceManager.getCatalogueSources().joinToString("\n") {
|
||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
||||
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||
}
|
||||
|
||||
fun listAllSourcesClassName() = sourceManager.getCatalogueSources().joinToString("\n") {
|
||||
"${it::class.qualifiedName}: ${it.name} (${it.lang.toUpperCase()})"
|
||||
"${it::class.qualifiedName}: ${it.name} (${it.lang.uppercase()})"
|
||||
}
|
||||
|
||||
fun listVisibleSources() = sourceManager.getVisibleCatalogueSources().joinToString("\n") {
|
||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
||||
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||
}
|
||||
|
||||
fun listAllHttpSources() = sourceManager.getOnlineSources().joinToString("\n") {
|
||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
||||
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||
}
|
||||
fun listVisibleHttpSources() = sourceManager.getVisibleOnlineSources().joinToString("\n") {
|
||||
"${it.id}: ${it.name} (${it.lang.toUpperCase()})"
|
||||
"${it.id}: ${it.name} (${it.lang.uppercase()})"
|
||||
}
|
||||
|
||||
fun convertAllEhentaiGalleriesToExhentai() = convertSources(EH_SOURCE_ID, EXH_SOURCE_ID)
|
||||
|
||||
@@ -31,7 +31,7 @@ class SettingsDebugController : SettingsController() {
|
||||
it.visibility == KVisibility.PUBLIC
|
||||
}.forEach {
|
||||
preference {
|
||||
title = it.name.replace("(.)(\\p{Upper})".toRegex(), "$1 $2").toLowerCase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||
title = it.name.replace("(.)(\\p{Upper})".toRegex(), "$1 $2").lowercase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||
isPersistent = false
|
||||
|
||||
onClick {
|
||||
@@ -62,7 +62,7 @@ class SettingsDebugController : SettingsController() {
|
||||
|
||||
DebugToggles.values().forEach {
|
||||
switchPreference {
|
||||
title = it.name.replace('_', ' ').toLowerCase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||
title = it.name.replace('_', ' ').lowercase(Locale.getDefault()).capitalize(Locale.getDefault())
|
||||
key = it.prefKey
|
||||
defaultValue = it.default
|
||||
summaryOn = if (it.default) "" else MODIFIED_TEXT
|
||||
|
||||
@@ -62,7 +62,7 @@ class EHDebugModeOverlay(private val context: Context) : OverlayModule<String>(n
|
||||
<b>Debug mode:</b> ${BuildConfig.DEBUG.asEnabledString()}<br>
|
||||
<b>Version code:</b> ${BuildConfig.VERSION_CODE}<br>
|
||||
<b>Commit SHA:</b> ${BuildConfig.COMMIT_SHA}<br>
|
||||
<b>Log level:</b> ${EHLogLevel.currentLogLevel.name.toLowerCase(Locale.getDefault())}<br>
|
||||
<b>Log level:</b> ${EHLogLevel.currentLogLevel.name.lowercase(Locale.getDefault())}<br>
|
||||
<b>Source blacklist:</b> ${preferences.enableSourceBlacklist().get().asEnabledString()}
|
||||
""".trimIndent()
|
||||
|
||||
|
||||
@@ -193,7 +193,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
||||
if (rating.state) {
|
||||
addQueryParameter(
|
||||
"contentRating[]",
|
||||
rating.name.toLowerCase(Locale.US)
|
||||
rating.name.lowercase(Locale.US)
|
||||
)
|
||||
}
|
||||
}
|
||||
@@ -203,7 +203,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
||||
if (demographic.state) {
|
||||
addQueryParameter(
|
||||
"publicationDemographic[]",
|
||||
demographic.name.toLowerCase(
|
||||
demographic.name.lowercase(
|
||||
Locale.US
|
||||
)
|
||||
)
|
||||
@@ -215,7 +215,7 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
||||
if (status.state) {
|
||||
addQueryParameter(
|
||||
"status[]",
|
||||
status.name.toLowerCase(
|
||||
status.name.lowercase(
|
||||
Locale.US
|
||||
)
|
||||
)
|
||||
@@ -246,13 +246,13 @@ class FilterHandler(private val preferencesHelper: PreferencesHelper) {
|
||||
is TagInclusionMode -> {
|
||||
addQueryParameter(
|
||||
"includedTagsMode",
|
||||
filter.values[filter.state].toUpperCase(Locale.US)
|
||||
filter.values[filter.state].uppercase(Locale.US)
|
||||
)
|
||||
}
|
||||
is TagExclusionMode -> {
|
||||
addQueryParameter(
|
||||
"excludedTagsMode",
|
||||
filter.values[filter.state].toUpperCase(Locale.US)
|
||||
filter.values[filter.state].uppercase(Locale.US)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ class FollowsHandler(
|
||||
return withIOContext {
|
||||
val status = when (followStatus == FollowStatus.UNFOLLOWED) {
|
||||
true -> null
|
||||
false -> followStatus.name.toLowerCase(Locale.US)
|
||||
false -> followStatus.name.lowercase(Locale.US)
|
||||
}
|
||||
|
||||
val jsonString = MdUtil.jsonParser.encodeToString(UpdateReadingStatus(status))
|
||||
@@ -247,7 +247,7 @@ class FollowsHandler(
|
||||
val mangaStatusUrl = MdUtil.mangaStatus.toHttpUrl().newBuilder()
|
||||
|
||||
if (status != null) {
|
||||
mangaStatusUrl.addQueryParameter("status", status.name.toLowerCase(Locale.US))
|
||||
mangaStatusUrl.addQueryParameter("status", status.name.lowercase(Locale.US))
|
||||
}
|
||||
|
||||
return GET(mangaStatusUrl.build().toString(), MdUtil.getAuthHeaders(headers, preferences, mdList), CacheControl.FORCE_NETWORK)
|
||||
|
||||
@@ -12,7 +12,7 @@ enum class FollowStatus(val int: Int) {
|
||||
RE_READING(6);
|
||||
|
||||
companion object {
|
||||
fun fromDex(value: String?): FollowStatus = values().firstOrNull { it.name.toLowerCase(Locale.US) == value } ?: UNFOLLOWED
|
||||
fun fromDex(value: String?): FollowStatus = values().firstOrNull { it.name.lowercase(Locale.US) == value } ?: UNFOLLOWED
|
||||
fun fromInt(value: Int): FollowStatus = values().firstOrNull { it.int == value } ?: UNFOLLOWED
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +163,7 @@ class SearchEngine {
|
||||
}
|
||||
}
|
||||
|
||||
query.toLowerCase(Locale.getDefault()).forEach { char ->
|
||||
query.lowercase(Locale.getDefault()).forEach { char ->
|
||||
if (char == '"') {
|
||||
inQuotes = !inQuotes
|
||||
} else if (enableWildcard && (char == '?' || char == '_')) {
|
||||
|
||||
@@ -99,7 +99,7 @@ class SmartSearchEngine(
|
||||
}
|
||||
|
||||
private fun cleanSmartSearchTitle(title: String): String {
|
||||
val preTitle = title.toLowerCase(Locale.getDefault())
|
||||
val preTitle = title.lowercase(Locale.getDefault())
|
||||
|
||||
// Remove text in brackets
|
||||
var cleanedTitle = removeTextInBrackets(preTitle, true)
|
||||
|
||||
@@ -65,7 +65,7 @@ class EHConfigurator(val context: Context) {
|
||||
val hathPerks = EHHathPerksResponse()
|
||||
|
||||
perksPage.select(".stuffbox tr").forEach {
|
||||
val name = it.child(0).text().toLowerCase(Locale.getDefault())
|
||||
val name = it.child(0).text().lowercase(Locale.getDefault())
|
||||
val purchased = it.child(2).getElementsByTag("form").isEmpty()
|
||||
|
||||
when (name) {
|
||||
|
||||
@@ -14,7 +14,7 @@ class EhUConfigBuilder {
|
||||
configItems += when (
|
||||
preferences.imageQuality()
|
||||
.get()
|
||||
.toLowerCase(Locale.getDefault())
|
||||
.lowercase(Locale.getDefault())
|
||||
) {
|
||||
"ovrs_2400" -> Entry.ImageSize.`2400`
|
||||
"ovrs_1600" -> Entry.ImageSize.`1600`
|
||||
|
||||
@@ -233,7 +233,7 @@ class EhLoginActivity : BaseViewBindingActivity<EhActivityLoginBinding>() {
|
||||
var igneous: String? = null
|
||||
|
||||
parsed.forEach {
|
||||
when (it.name.toLowerCase(Locale.getDefault())) {
|
||||
when (it.name.lowercase(Locale.getDefault())) {
|
||||
MEMBER_ID_COOKIE -> memberId = it.value
|
||||
PASS_HASH_COOKIE -> passHash = it.value
|
||||
IGNEOUS_COOKIE -> igneous = this.igneous ?: it.value
|
||||
|
||||
@@ -18,7 +18,7 @@ fun Manga.mangaType(context: Context): String {
|
||||
MangaType.TYPE_COMIC -> R.string.comic
|
||||
else -> R.string.manga
|
||||
}
|
||||
).toLowerCase(Locale.getDefault())
|
||||
).lowercase(Locale.getDefault())
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user