mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
fix: Fix compile failure
This commit is contained in:
parent
c5f4dacb57
commit
a95e95ce66
3 changed files with 11 additions and 9 deletions
|
@ -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 =
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue