fix: Fix compile failure

This commit is contained in:
Ahmad Ansori Palembani 2024-06-23 09:55:32 +07:00
parent c5f4dacb57
commit a95e95ce66
Signed by: null2264
GPG key ID: BA64F8B60AF3EFB6
3 changed files with 11 additions and 9 deletions

View file

@ -5,6 +5,8 @@ import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import eu.kanade.tachiyomi.R
private const val SHIFT = 0x00000003
enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val stringRes: Int, @DrawableRes val iconRes: Int) {
DEFAULT(0, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.default_value, R.drawable.ic_screen_rotation_24dp),
FREE(1, ActivityInfo.SCREEN_ORIENTATION_UNSPECIFIED, R.string.free, R.drawable.ic_screen_rotation_24dp),
@ -14,11 +16,9 @@ enum class OrientationType(val prefValue: Int, val flag: Int, @StringRes val str
LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.locked_landscape, R.drawable.ic_screen_lock_landscape_24dp),
;
@Suppress("RemoveRedundantQualifierName")
val flagValue = prefValue shl OrientationType.SHIFT
val flagValue = prefValue shl SHIFT
companion object {
private const val SHIFT = 0x00000003
const val MASK = 7 shl SHIFT
fun fromPreference(preference: Int): OrientationType =

View file

@ -5,6 +5,8 @@ import androidx.annotation.StringRes
import eu.kanade.tachiyomi.R
import eu.kanade.tachiyomi.util.lang.next
private const val SHIFT = 0x00000000
enum class ReadingModeType(val prefValue: Int, @StringRes val stringRes: Int, @DrawableRes val iconRes: Int) {
DEFAULT(0, R.string.default_value, R.drawable.ic_reader_default_24dp),
LEFT_TO_RIGHT(1, R.string.left_to_right_viewer, R.drawable.ic_reader_ltr_24dp),
@ -14,12 +16,10 @@ enum class ReadingModeType(val prefValue: Int, @StringRes val stringRes: Int, @D
CONTINUOUS_VERTICAL(5, R.string.continuous_vertical, R.drawable.ic_reader_continuous_vertical_24dp),
;
@Suppress("RemoveRedundantQualifierName")
val flagValue = prefValue shl ReadingModeType.SHIFT
val flagValue = prefValue shl SHIFT
companion object {
fun fromPreference(preference: Int): ReadingModeType = entries.find { it.flagValue == preference } ?: DEFAULT
private const val SHIFT = 0x00000000
const val MASK = 7 shl SHIFT
fun getNextReadingMode(preference: Int): ReadingModeType {

View file

@ -1,7 +1,5 @@
package eu.kanade.tachiyomi.util.system
import android.annotation.TargetApi
import android.os.Build
import android.webkit.WebResourceError
import android.webkit.WebResourceRequest
import android.webkit.WebResourceResponse
@ -28,7 +26,6 @@ abstract class WebViewClientCompat : WebViewClient() {
) {
}
@TargetApi(Build.VERSION_CODES.N)
final override fun shouldOverrideUrlLoading(
view: WebView,
request: WebResourceRequest,
@ -36,6 +33,7 @@ abstract class WebViewClientCompat : WebViewClient() {
return shouldOverrideUrlCompat(view, request.url.toString())
}
@Deprecated("Deprecated in Java", ReplaceWith("shouldOverrideUrlCompat(view, url)"))
final override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
return shouldOverrideUrlCompat(view, url)
}
@ -47,6 +45,7 @@ abstract class WebViewClientCompat : WebViewClient() {
return shouldInterceptRequestCompat(view, request.url.toString())
}
@Deprecated("Deprecated in Java", ReplaceWith("shouldInterceptRequestCompat(view, url)"))
final override fun shouldInterceptRequest(
view: WebView,
url: String,
@ -68,6 +67,9 @@ abstract class WebViewClientCompat : WebViewClient() {
)
}
@Deprecated("Deprecated in Java",
ReplaceWith("onReceivedErrorCompat(view, errorCode, description, failingUrl, failingUrl == view.url)")
)
final override fun onReceivedError(
view: WebView,
errorCode: Int,