mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-19 01:59:19 +01:00
Image is now the default decoder
This commit is contained in:
parent
f514d466a6
commit
2e39be6625
@ -8,6 +8,7 @@ import eu.kanade.tachiyomi.R
|
||||
* in the file "keys.xml". By using this class we can define preferences in one place and get them
|
||||
* referenced here.
|
||||
*/
|
||||
@Suppress("HasPlatformType")
|
||||
class PreferenceKeys(context: Context) {
|
||||
|
||||
val theme = context.getString(R.string.pref_theme_key)
|
||||
@ -94,6 +95,6 @@ class PreferenceKeys(context: Context) {
|
||||
|
||||
fun syncPassword(syncId: Int) = "pref_mangasync_password_$syncId"
|
||||
|
||||
val libraryAsList = context.getString(R.string.pref_display_library_as_list)
|
||||
val libraryAsList = context.getString(R.string.pref_display_library_as_list)
|
||||
|
||||
}
|
||||
|
@ -16,9 +16,9 @@ abstract class BaseReader : BaseFragment() {
|
||||
|
||||
companion object {
|
||||
/**
|
||||
* Rapid decoder.
|
||||
* Image decoder.
|
||||
*/
|
||||
const val RAPID_DECODER = 0
|
||||
const val IMAGE_DECODER = 0
|
||||
|
||||
/**
|
||||
* Skia decoder.
|
||||
@ -26,9 +26,9 @@ abstract class BaseReader : BaseFragment() {
|
||||
const val SKIA_DECODER = 1
|
||||
|
||||
/**
|
||||
* Image decoder.
|
||||
* Rapid decoder.
|
||||
*/
|
||||
const val IMAGE_DECODER = 2
|
||||
const val RAPID_DECODER = 2
|
||||
}
|
||||
|
||||
/**
|
||||
@ -205,17 +205,17 @@ abstract class BaseReader : BaseFragment() {
|
||||
*/
|
||||
fun setDecoderClass(value: Int) {
|
||||
when (value) {
|
||||
RAPID_DECODER -> {
|
||||
bitmapDecoderClass = RapidImageDecoder::class.java
|
||||
regionDecoderClass = RapidImageRegionDecoder::class.java
|
||||
IMAGE_DECODER -> {
|
||||
bitmapDecoderClass = IImageDecoder::class.java
|
||||
regionDecoderClass = IImageRegionDecoder::class.java
|
||||
}
|
||||
SKIA_DECODER -> {
|
||||
bitmapDecoderClass = SkiaImageDecoder::class.java
|
||||
regionDecoderClass = SkiaImageRegionDecoder::class.java
|
||||
}
|
||||
IMAGE_DECODER -> {
|
||||
bitmapDecoderClass = IImageDecoder::class.java
|
||||
regionDecoderClass = IImageRegionDecoder::class.java
|
||||
RAPID_DECODER -> {
|
||||
bitmapDecoderClass = RapidImageDecoder::class.java
|
||||
regionDecoderClass = RapidImageRegionDecoder::class.java
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,7 +3,6 @@ package eu.kanade.tachiyomi.widget.preference
|
||||
import android.annotation.TargetApi
|
||||
import android.content.Context
|
||||
import android.content.res.TypedArray
|
||||
import android.os.Build
|
||||
import android.os.Build.VERSION_CODES.ICE_CREAM_SANDWICH
|
||||
import android.support.v7.preference.PreferenceViewHolder
|
||||
import android.support.v7.widget.SwitchCompat
|
||||
@ -11,7 +10,6 @@ import android.util.AttributeSet
|
||||
import android.view.View
|
||||
import android.widget.Checkable
|
||||
import android.widget.CompoundButton
|
||||
import android.widget.Switch
|
||||
import eu.kanade.tachiyomi.util.getResourceColor
|
||||
import net.xpece.android.support.preference.PreferenceCategory
|
||||
import net.xpece.android.support.preference.R
|
||||
@ -52,16 +50,12 @@ CompoundButton.OnCheckedChangeListener {
|
||||
|
||||
if (view is SwitchCompat) {
|
||||
view.setOnCheckedChangeListener(null)
|
||||
} else if (NATIVE_SWITCH_CAPABLE && view is Switch) {
|
||||
view.setOnCheckedChangeListener(null)
|
||||
}
|
||||
|
||||
view.toggle()
|
||||
|
||||
if (view is SwitchCompat) {
|
||||
view.setOnCheckedChangeListener(this)
|
||||
} else if (NATIVE_SWITCH_CAPABLE && view is Switch) {
|
||||
view.setOnCheckedChangeListener(this)
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -130,8 +124,4 @@ CompoundButton.OnCheckedChangeListener {
|
||||
defaultValue as Boolean)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private val NATIVE_SWITCH_CAPABLE = Build.VERSION.SDK_INT >= ICE_CREAM_SANDWICH
|
||||
}
|
||||
|
||||
}
|
@ -67,9 +67,9 @@
|
||||
</string-array>
|
||||
|
||||
<string-array name="image_decoders">
|
||||
<item>Image</item>
|
||||
<item>Rapid</item>
|
||||
<item>Skia</item>
|
||||
<item>Image</item>
|
||||
</string-array>
|
||||
|
||||
<string-array name="image_decoders_values">
|
||||
|
@ -36,7 +36,7 @@
|
||||
<string name="pref_color_filter_value_key">color_filter_value</string>
|
||||
<string name="pref_red_filter_value_key">pref_red_filter_value</string>
|
||||
<string name="pref_reader_theme_key">pref_reader_theme_key</string>
|
||||
<string name="pref_image_decoder_key">pref_image_decoder_key</string>
|
||||
<string name="pref_image_decoder_key">image_decoder</string>
|
||||
<string name="pref_read_with_volume_keys_key">reader_volume_keys</string>
|
||||
<string name="pref_read_with_tapping_key">reader_tap</string>
|
||||
<string name="pref_filter_downloaded_key">pref_filter_downloaded_key</string>
|
||||
|
Loading…
Reference in New Issue
Block a user