mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 02:34:39 +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 androidx.annotation.StringRes
|
||||||
import eu.kanade.tachiyomi.R
|
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) {
|
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),
|
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),
|
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),
|
LOCKED_LANDSCAPE(5, ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE, R.string.locked_landscape, R.drawable.ic_screen_lock_landscape_24dp),
|
||||||
;
|
;
|
||||||
|
|
||||||
@Suppress("RemoveRedundantQualifierName")
|
val flagValue = prefValue shl SHIFT
|
||||||
val flagValue = prefValue shl OrientationType.SHIFT
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
private const val SHIFT = 0x00000003
|
|
||||||
const val MASK = 7 shl SHIFT
|
const val MASK = 7 shl SHIFT
|
||||||
|
|
||||||
fun fromPreference(preference: Int): OrientationType =
|
fun fromPreference(preference: Int): OrientationType =
|
||||||
|
|
|
@ -5,6 +5,8 @@ import androidx.annotation.StringRes
|
||||||
import eu.kanade.tachiyomi.R
|
import eu.kanade.tachiyomi.R
|
||||||
import eu.kanade.tachiyomi.util.lang.next
|
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) {
|
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),
|
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),
|
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),
|
CONTINUOUS_VERTICAL(5, R.string.continuous_vertical, R.drawable.ic_reader_continuous_vertical_24dp),
|
||||||
;
|
;
|
||||||
|
|
||||||
@Suppress("RemoveRedundantQualifierName")
|
val flagValue = prefValue shl SHIFT
|
||||||
val flagValue = prefValue shl ReadingModeType.SHIFT
|
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
fun fromPreference(preference: Int): ReadingModeType = entries.find { it.flagValue == preference } ?: DEFAULT
|
fun fromPreference(preference: Int): ReadingModeType = entries.find { it.flagValue == preference } ?: DEFAULT
|
||||||
private const val SHIFT = 0x00000000
|
|
||||||
const val MASK = 7 shl SHIFT
|
const val MASK = 7 shl SHIFT
|
||||||
|
|
||||||
fun getNextReadingMode(preference: Int): ReadingModeType {
|
fun getNextReadingMode(preference: Int): ReadingModeType {
|
||||||
|
|
|
@ -1,7 +1,5 @@
|
||||||
package eu.kanade.tachiyomi.util.system
|
package eu.kanade.tachiyomi.util.system
|
||||||
|
|
||||||
import android.annotation.TargetApi
|
|
||||||
import android.os.Build
|
|
||||||
import android.webkit.WebResourceError
|
import android.webkit.WebResourceError
|
||||||
import android.webkit.WebResourceRequest
|
import android.webkit.WebResourceRequest
|
||||||
import android.webkit.WebResourceResponse
|
import android.webkit.WebResourceResponse
|
||||||
|
@ -28,7 +26,6 @@ abstract class WebViewClientCompat : WebViewClient() {
|
||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@TargetApi(Build.VERSION_CODES.N)
|
|
||||||
final override fun shouldOverrideUrlLoading(
|
final override fun shouldOverrideUrlLoading(
|
||||||
view: WebView,
|
view: WebView,
|
||||||
request: WebResourceRequest,
|
request: WebResourceRequest,
|
||||||
|
@ -36,6 +33,7 @@ abstract class WebViewClientCompat : WebViewClient() {
|
||||||
return shouldOverrideUrlCompat(view, request.url.toString())
|
return shouldOverrideUrlCompat(view, request.url.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java", ReplaceWith("shouldOverrideUrlCompat(view, url)"))
|
||||||
final override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
|
final override fun shouldOverrideUrlLoading(view: WebView, url: String): Boolean {
|
||||||
return shouldOverrideUrlCompat(view, url)
|
return shouldOverrideUrlCompat(view, url)
|
||||||
}
|
}
|
||||||
|
@ -47,6 +45,7 @@ abstract class WebViewClientCompat : WebViewClient() {
|
||||||
return shouldInterceptRequestCompat(view, request.url.toString())
|
return shouldInterceptRequestCompat(view, request.url.toString())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Deprecated("Deprecated in Java", ReplaceWith("shouldInterceptRequestCompat(view, url)"))
|
||||||
final override fun shouldInterceptRequest(
|
final override fun shouldInterceptRequest(
|
||||||
view: WebView,
|
view: WebView,
|
||||||
url: String,
|
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(
|
final override fun onReceivedError(
|
||||||
view: WebView,
|
view: WebView,
|
||||||
errorCode: Int,
|
errorCode: Int,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue