Update dependencies

This commit is contained in:
Koitharu
2025-03-21 08:37:22 +02:00
parent 0b8fbf892a
commit 1a5c3c1f6f
3 changed files with 15 additions and 12 deletions

View File

@@ -3,6 +3,7 @@ package org.koitharu.kotatsu.core.util.ext
import android.annotation.SuppressLint
import android.content.Context
import android.content.res.Resources
import android.os.Build
import androidx.annotation.PluralsRes
import androidx.annotation.Px
import androidx.core.util.TypedValueCompat
@@ -30,7 +31,10 @@ fun Context.getSystemBoolean(resName: String, fallback: Boolean): Boolean {
fun Resources.getQuantityStringSafe(@PluralsRes resId: Int, quantity: Int, vararg formatArgs: Any): String = try {
getQuantityString(resId, quantity, *formatArgs)
} catch (e: Resources.NotFoundException) {
e.report(silent = true)
e.printStackTraceDebug()
formatArgs.firstOrNull()?.toString() ?: quantity.toString()
if (Build.VERSION.SDK_INT == Build.VERSION_CODES.VANILLA_ICE_CREAM) { // known issue
e.printStackTraceDebug()
formatArgs.firstOrNull()?.toString() ?: quantity.toString()
} else {
throw e
}
}

View File

@@ -6,7 +6,6 @@ import org.koitharu.kotatsu.core.model.getLocalizedTitle
import org.koitharu.kotatsu.core.ui.model.DateTimeAgo
import org.koitharu.kotatsu.parsers.model.MangaChapter
@ConsistentCopyVisibility
data class ListHeader private constructor(
private val textRaw: Any,
@StringRes val buttonTextRes: Int,