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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue