diff --git a/app/build.gradle b/app/build.gradle index 5c9fd56d1..cca143523 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -165,7 +165,6 @@ dependencies { compile 'com.afollestad.material-dialogs:core:0.8.6.2' compile 'net.xpece.android:support-preference:0.8.1' compile 'me.zhanghai.android.systemuihelper:library:1.0.0' - compile 'org.adw.library:discrete-seekbar:1.0.1' compile 'de.hdodenhof:circleimageview:2.1.0' // Tests diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt index 99432b13e..76e7932b2 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferenceKeys.kt @@ -26,6 +26,10 @@ class PreferenceKeys(context: Context) { val customBrightnessValue = context.getString(R.string.pref_custom_brightness_value_key) + val colorFilter = context.getString(R.string.pref_color_filter_key) + + val colorFilterValue = context.getString(R.string.pref_color_filter_value_key) + val defaultViewer = context.getString(R.string.pref_default_viewer_key) val imageScaleType = context.getString(R.string.pref_image_scale_type_key) diff --git a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt index 3acee36aa..a9210fbef 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/data/preference/PreferencesHelper.kt @@ -52,6 +52,10 @@ class PreferencesHelper(context: Context) { fun customBrightnessValue() = rxPrefs.getInteger(keys.customBrightnessValue, 0) + fun colorFilter() = rxPrefs.getBoolean(keys.colorFilter, false) + + fun colorFilterValue() = rxPrefs.getInteger(keys.colorFilterValue, 0) + fun defaultViewer() = prefs.getInt(keys.defaultViewer, 1) fun imageScaleType() = rxPrefs.getInteger(keys.imageScaleType, 1) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt index c148383a6..0b935c873 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt @@ -38,10 +38,12 @@ import me.zhanghai.android.systemuihelper.SystemUiHelper import me.zhanghai.android.systemuihelper.SystemUiHelper.* import nucleus.factory.RequiresPresenter import rx.Subscription +import rx.android.schedulers.AndroidSchedulers import rx.subscriptions.CompositeSubscription import timber.log.Timber import uy.kohesive.injekt.injectLazy import java.text.DecimalFormat +import java.util.concurrent.TimeUnit @RequiresPresenter(ReaderPresenter::class) class ReaderActivity : BaseRxActivity() { @@ -70,6 +72,8 @@ class ReaderActivity : BaseRxActivity() { private var customBrightnessSubscription: Subscription? = null + private var customFilterColorSubscription: Subscription? = null + var readerTheme: Int = 0 private set @@ -140,6 +144,7 @@ class ReaderActivity : BaseRxActivity() { override fun onOptionsItemSelected(item: MenuItem): Boolean { when (item.itemId) { R.id.action_settings -> ReaderSettingsDialog().show(supportFragmentManager, "settings") + R.id.action_custom_filter -> ReaderCustomFilterDialog().show(supportFragmentManager, "filter") else -> return super.onOptionsItemSelected(item) } return true @@ -354,9 +359,9 @@ class ReaderActivity : BaseRxActivity() { reader_menu_bottom.setOnTouchListener { v, event -> true } page_seekbar.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { - override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { if (fromUser) { - gotoPageInCurrentChapter(progress) + gotoPageInCurrentChapter(value) } } }) @@ -378,6 +383,9 @@ class ReaderActivity : BaseRxActivity() { subscriptions += preferences.customBrightness().asObservable() .subscribe { setCustomBrightness(it) } + subscriptions += preferences.colorFilter().asObservable() + .subscribe { setColorFilter(it) } + subscriptions += preferences.readerTheme().asObservable() .distinctUntilChanged() .subscribe { applyTheme(it) } @@ -424,6 +432,7 @@ class ReaderActivity : BaseRxActivity() { private fun setCustomBrightness(enabled: Boolean) { if (enabled) { customBrightnessSubscription = preferences.customBrightnessValue().asObservable() + .sample(100, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) .subscribe { setCustomBrightnessValue(it) } subscriptions.add(customBrightnessSubscription) @@ -433,6 +442,19 @@ class ReaderActivity : BaseRxActivity() { } } + private fun setColorFilter(enabled: Boolean) { + if (enabled) { + customFilterColorSubscription = preferences.colorFilterValue().asObservable() + .sample(100, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) + .subscribe { setColorFilterValue(it) } + + subscriptions.add(customFilterColorSubscription) + } else { + customFilterColorSubscription?.let { subscriptions.remove(it) } + color_overlay.visibility = View.GONE + } + } + /** * Sets the brightness of the screen. Range is [-75, 100]. * From -75 to -1 a semi-transparent black view is shown at the top with the minimum brightness. @@ -459,6 +481,11 @@ class ReaderActivity : BaseRxActivity() { } } + private fun setColorFilterValue(value: Int) { + color_overlay.visibility = View.VISIBLE + color_overlay.setBackgroundColor(value) + } + private fun applyTheme(theme: Int) { readerTheme = theme val rootView = window.decorView.rootView diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderCustomFilterDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderCustomFilterDialog.kt new file mode 100644 index 000000000..dc820106e --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderCustomFilterDialog.kt @@ -0,0 +1,329 @@ +package eu.kanade.tachiyomi.ui.reader + +import android.app.Dialog +import android.graphics.Color +import android.os.Bundle +import android.support.annotation.ColorInt +import android.support.v4.app.DialogFragment +import android.view.View +import android.widget.SeekBar +import com.afollestad.materialdialogs.MaterialDialog +import eu.kanade.tachiyomi.R +import eu.kanade.tachiyomi.data.preference.PreferencesHelper +import eu.kanade.tachiyomi.data.preference.getOrDefault +import eu.kanade.tachiyomi.util.plusAssign +import eu.kanade.tachiyomi.widget.SimpleSeekBarListener +import kotlinx.android.synthetic.main.dialog_reader_custom_filter.view.* +import rx.Subscription +import rx.android.schedulers.AndroidSchedulers +import rx.subscriptions.CompositeSubscription +import uy.kohesive.injekt.injectLazy +import java.util.concurrent.TimeUnit + +/** + * Custom dialog which can be used to set overlay value's + */ +class ReaderCustomFilterDialog : DialogFragment() { + + companion object { + /** Integer mask of alpha value **/ + private const val ALPHA_MASK: Long = 0xFF000000 + + /** Integer mask of red value **/ + private const val RED_MASK: Long = 0x00FF0000 + + /** Integer mask of green value **/ + private const val GREEN_MASK: Long = 0x0000FF00 + + /** Integer mask of blue value **/ + private const val BLUE_MASK: Long = 0x000000FF + } + + /** + * Provides operations to manage preferences + */ + private val preferences by injectLazy() + + /** + * Subscription used for filter overlay + */ + private lateinit var subscriptions: CompositeSubscription + + /** + * Subscription used for custom brightness overlay + */ + private var customBrightnessSubscription: Subscription? = null + + /** + * Subscription used for color filter overlay + */ + private var customFilterColorSubscription: Subscription? = null + + /** + * This method will be called after onCreate(Bundle) + * @param savedState The last saved instance state of the Fragment. + */ + override fun onCreateDialog(savedState: Bundle?): Dialog { + val dialog = MaterialDialog.Builder(activity) + .customView(R.layout.dialog_reader_custom_filter, false) + .positiveText(android.R.string.ok) + .build() + + subscriptions = CompositeSubscription() + onViewCreated(dialog.view, savedState) + + return dialog + } + + /** + * Called immediately after onCreateView() + * @param view The View returned by onCreateDialog. + * @param savedInstanceState If non-null, this fragment is being re-constructed + */ + override fun onViewCreated(view: View, savedInstanceState: Bundle?) = with(view) { + // Initialize subscriptions. + subscriptions += preferences.colorFilter().asObservable() + .subscribe { setColorFilter(it, view) } + + subscriptions += preferences.customBrightness().asObservable() + .subscribe { setCustomBrightness(it, view) } + + // Get color and update values + val color = preferences.colorFilterValue().getOrDefault() + val brightness = preferences.customBrightnessValue().getOrDefault() + + val argb = setValues(color, view) + + // Set brightness value + txt_brightness_seekbar_value.text = brightness.toString() + + // Initialize seekBar progress + seekbar_color_filter_alpha.progress = argb[0] + seekbar_color_filter_red.progress = argb[1] + seekbar_color_filter_green.progress = argb[2] + seekbar_color_filter_blue.progress = argb[3] + + // Set listeners + switch_color_filter.isChecked = preferences.colorFilter().getOrDefault() + switch_color_filter.setOnCheckedChangeListener { v, isChecked -> + preferences.colorFilter().set(isChecked) + } + + custom_brightness.isChecked = preferences.customBrightness().getOrDefault() + custom_brightness.setOnCheckedChangeListener { v, isChecked -> + preferences.customBrightness().set(isChecked) + } + + seekbar_color_filter_alpha.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + if (fromUser) { + setColorValue(value, ALPHA_MASK, 24) + } + } + }) + + seekbar_color_filter_red.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + if (fromUser) { + setColorValue(value, RED_MASK, 16) + } + } + }) + + seekbar_color_filter_green.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + if (fromUser) { + setColorValue(value, GREEN_MASK, 8) + } + } + }) + + seekbar_color_filter_blue.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + if (fromUser) { + setColorValue(value, BLUE_MASK, 0) + } + } + }) + brightness_seekbar.progress = preferences.customBrightnessValue().getOrDefault() + brightness_seekbar.setOnSeekBarChangeListener(object : SimpleSeekBarListener() { + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + if (fromUser) { + preferences.customBrightnessValue().set(value) + } + } + }) + + } + + /** + * Set enabled status of seekBars belonging to color filter + * @param enabled determines if seekBar gets enabled + * @param view view of the dialog + */ + private fun setColorFilterSeekBar(enabled: Boolean, view: View) = with(view) { + seekbar_color_filter_red.isEnabled = enabled + seekbar_color_filter_green.isEnabled = enabled + seekbar_color_filter_blue.isEnabled = enabled + seekbar_color_filter_alpha.isEnabled = enabled + } + + /** + * Set enabled status of seekBars belonging to custom brightness + * @param enabled value which determines if seekBar gets enabled + * @param view view of the dialog + */ + private fun setCustomBrightnessSeekBar(enabled: Boolean, view: View) = with(view) { + brightness_seekbar.isEnabled = enabled + } + + /** + * Set the text value's of color filter + * @param color integer containing color information + * @param view view of the dialog + */ + fun setValues(color: Int, view: View): Array { + val alpha = getAlphaFromColor(color) + val red = getRedFromColor(color) + val green = getGreenFromColor(color) + val blue = getBlueFromColor(color) + + //Initialize values + with(view) { + txt_color_filter_alpha_value.text = alpha.toString() + + txt_color_filter_red_value.text = red.toString() + + txt_color_filter_green_value.text = green.toString() + + txt_color_filter_blue_value.text = blue.toString() + } + return arrayOf(alpha, red, green, blue) + } + + /** + * Manages the custom brightness value subscription + * @param enabled determines if the subscription get (un)subscribed + * @param view view of the dialog + */ + private fun setCustomBrightness(enabled: Boolean, view: View) { + if (enabled) { + customBrightnessSubscription = preferences.customBrightnessValue().asObservable() + .sample(100, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) + .subscribe { setCustomBrightnessValue(it, view) } + + subscriptions.add(customBrightnessSubscription) + } else { + customBrightnessSubscription?.let { subscriptions.remove(it) } + setCustomBrightnessValue(0, view, true) + } + setCustomBrightnessSeekBar(enabled, view) + } + + /** + * Sets the brightness of the screen. Range is [-75, 100]. + * From -75 to -1 a semi-transparent black view is shown at the top with the minimum brightness. + * From 1 to 100 it sets that value as brightness. + * 0 sets system brightness and hides the overlay. + */ + private fun setCustomBrightnessValue(value: Int, view: View, isDisabled: Boolean = false) = with(view) { + // Set black overlay visibility. + if (value < 0) { + brightness_overlay.visibility = View.VISIBLE + val alpha = (Math.abs(value) * 2.56).toInt() + brightness_overlay.setBackgroundColor(Color.argb(alpha, 0, 0, 0)) + } else { + brightness_overlay.visibility = View.GONE + } + + if (!isDisabled) + txt_brightness_seekbar_value.text = value.toString() + } + + /** + * Manages the color filter value subscription + * @param enabled determines if the subscription get (un)subscribed + * @param view view of the dialog + */ + private fun setColorFilter(enabled: Boolean, view: View) { + if (enabled) { + customFilterColorSubscription = preferences.colorFilterValue().asObservable() + .sample(100, TimeUnit.MILLISECONDS, AndroidSchedulers.mainThread()) + .subscribe { setColorFilterValue(it, view) } + + subscriptions.add(customFilterColorSubscription) + } else { + customFilterColorSubscription?.let { subscriptions.remove(it) } + view.color_overlay.visibility = View.GONE + } + setColorFilterSeekBar(enabled, view) + } + + /** + * Sets the color filter overlay of the screen. Determined by HEX of integer + * @param color hex of color. + * @param view view of the dialog + */ + private fun setColorFilterValue(@ColorInt color: Int, view: View) = with(view) { + color_overlay.visibility = View.VISIBLE + color_overlay.setBackgroundColor(color) + setValues(color, view) + } + + /** + * Updates the color value in preference + * @param color value of color range [0,255] + * @param mask contains hex mask of chosen color + * @param bitShift amounts of bits that gets shifted to receive value + */ + fun setColorValue(color: Int, mask: Long, bitShift: Int) { + val currentColor = preferences.colorFilterValue().getOrDefault() + val updatedColor = (color shl bitShift) or (currentColor and mask.inv().toInt()) + preferences.colorFilterValue().set(updatedColor) + } + + /** + * Returns the alpha value from the Color Hex + * @param color color hex as int + * @return alpha of color + */ + fun getAlphaFromColor(color: Int): Int { + return color shr 24 and 0xFF + } + + /** + * Returns the red value from the Color Hex + * @param color color hex as int + * @return red of color + */ + fun getRedFromColor(color: Int): Int { + return color shr 16 and 0xFF + } + + /** + * Returns the green value from the Color Hex + * @param color color hex as int + * @return green of color + */ + fun getGreenFromColor(color: Int): Int { + return color shr 8 and 0xFF + } + + /** + * Returns the blue value from the Color Hex + * @param color color hex as int + * @return blue of color + */ + fun getBlueFromColor(color: Int): Int { + return color and 0xFF + } + + /** + * Called when dialog is dismissed + */ + override fun onDestroyView() { + subscriptions.unsubscribe() + super.onDestroyView() + } + +} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt index 75f78806b..56659e637 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsDialog.kt @@ -11,7 +11,6 @@ import eu.kanade.tachiyomi.data.preference.getOrDefault import eu.kanade.tachiyomi.util.plusAssign import eu.kanade.tachiyomi.widget.IgnoreFirstSpinnerListener import kotlinx.android.synthetic.main.dialog_reader_settings.view.* -import org.adw.library.widgets.discreteseekbar.DiscreteSeekBar import rx.Observable import rx.android.schedulers.AndroidSchedulers import rx.subscriptions.CompositeSubscription @@ -84,24 +83,6 @@ class ReaderSettingsDialog : DialogFragment() { fullscreen.setOnCheckedChangeListener { v, isChecked -> preferences.fullscreen().set(isChecked) } - - custom_brightness.isChecked = preferences.customBrightness().getOrDefault() - custom_brightness.setOnCheckedChangeListener { v, isChecked -> - preferences.customBrightness().set(isChecked) - } - - brightness_seekbar.progress = preferences.customBrightnessValue().getOrDefault() - brightness_seekbar.setOnProgressChangeListener(object : DiscreteSeekBar.OnProgressChangeListener { - override fun onProgressChanged(seekBar: DiscreteSeekBar, value: Int, fromUser: Boolean) { - if (fromUser) { - preferences.customBrightnessValue().set(value) - } - } - - override fun onStartTrackingTouch(seekBar: DiscreteSeekBar) {} - - override fun onStopTrackingTouch(seekBar: DiscreteSeekBar) {} - }) } override fun onDestroyView() { diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/NegativeSeekBar.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/NegativeSeekBar.kt new file mode 100644 index 000000000..44c9ee150 --- /dev/null +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/NegativeSeekBar.kt @@ -0,0 +1,61 @@ +package eu.kanade.tachiyomi.widget + +import android.content.Context +import android.util.AttributeSet +import android.widget.SeekBar +import eu.kanade.tachiyomi.R + + +class NegativeSeekBar @JvmOverloads constructor(context: Context, attrs: AttributeSet? = null) : + SeekBar(context, attrs) { + + private var minValue: Int = 0 + private var maxValue: Int = 0 + private var listener: OnSeekBarChangeListener? = null + + init { + val styledAttributes = context.obtainStyledAttributes( + attrs, + R.styleable.NegativeSeekBar, 0, 0) + + try { + setMinSeek(styledAttributes.getInt(R.styleable.NegativeSeekBar_min_seek, 0)) + setMaxSeek(styledAttributes.getInt(R.styleable.NegativeSeekBar_max_seek, 0)) + } finally { + styledAttributes.recycle() + } + + super.setOnSeekBarChangeListener(object : OnSeekBarChangeListener { + override fun onProgressChanged(seekBar: SeekBar?, value: Int, fromUser: Boolean) { + listener?.let { it.onProgressChanged(seekBar, minValue + value, fromUser) } + } + + override fun onStartTrackingTouch(p0: SeekBar?) { + listener?.let { it.onStartTrackingTouch(p0) } + } + + override fun onStopTrackingTouch(p0: SeekBar?) { + listener?.let { it.onStopTrackingTouch(p0) } + } + }) + } + + override fun setProgress(progress: Int) { + super.setProgress(Math.abs(minValue) + progress) + } + + fun setMinSeek(minValue: Int) { + this.minValue = minValue + max = (this.maxValue - this.minValue) + } + + fun setMaxSeek(maxValue: Int) { + this.maxValue = maxValue + max = (this.maxValue - this.minValue) + } + + override fun setOnSeekBarChangeListener(listener: OnSeekBarChangeListener?) { + this.listener = listener + } + +} \ No newline at end of file diff --git a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt index f0599159d..77f815bd3 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/widget/SimpleSeekBarListener.kt @@ -1,11 +1,13 @@ package eu.kanade.tachiyomi.widget - import android.widget.SeekBar open class SimpleSeekBarListener : SeekBar.OnSeekBarChangeListener { - override fun onProgressChanged(seekBar: SeekBar, progress: Int, fromUser: Boolean) {} + override fun onProgressChanged(seekBar: SeekBar, value: Int, fromUser: Boolean) { + } - override fun onStartTrackingTouch(seekBar: SeekBar) {} + override fun onStartTrackingTouch(seekBar: SeekBar) { + } - override fun onStopTrackingTouch(seekBar: SeekBar) {} + override fun onStopTrackingTouch(seekBar: SeekBar) { + } } \ No newline at end of file diff --git a/app/src/main/res/drawable/filter_mock.png b/app/src/main/res/drawable/filter_mock.png new file mode 100644 index 000000000..a6d6a0c00 Binary files /dev/null and b/app/src/main/res/drawable/filter_mock.png differ diff --git a/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml b/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml new file mode 100644 index 000000000..09f16c1d3 --- /dev/null +++ b/app/src/main/res/drawable/ic_brightness_4_white_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/drawable/ic_brightness_5_black_24dp.xml b/app/src/main/res/drawable/ic_brightness_5_black_24dp.xml new file mode 100644 index 000000000..54301c0aa --- /dev/null +++ b/app/src/main/res/drawable/ic_brightness_5_black_24dp.xml @@ -0,0 +1,9 @@ + + + diff --git a/app/src/main/res/layout/activity_reader.xml b/app/src/main/res/layout/activity_reader.xml index 8812abbbd..0cbec3f42 100644 --- a/app/src/main/res/layout/activity_reader.xml +++ b/app/src/main/res/layout/activity_reader.xml @@ -105,4 +105,10 @@ android:layout_height="match_parent" android:visibility="gone"/> + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_reader_custom_filter.xml b/app/src/main/res/layout/dialog_reader_custom_filter.xml new file mode 100644 index 000000000..4abe82fdd --- /dev/null +++ b/app/src/main/res/layout/dialog_reader_custom_filter.xml @@ -0,0 +1,257 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/app/src/main/res/layout/dialog_reader_settings.xml b/app/src/main/res/layout/dialog_reader_settings.xml index f78b724ae..67244208d 100644 --- a/app/src/main/res/layout/dialog_reader_settings.xml +++ b/app/src/main/res/layout/dialog_reader_settings.xml @@ -1,9 +1,9 @@ - - - - - \ No newline at end of file diff --git a/app/src/main/res/menu/reader.xml b/app/src/main/res/menu/reader.xml index 72121c053..6abc4e3e0 100644 --- a/app/src/main/res/menu/reader.xml +++ b/app/src/main/res/menu/reader.xml @@ -2,11 +2,18 @@ + + \ No newline at end of file diff --git a/app/src/main/res/values/attrs.xml b/app/src/main/res/values/attrs.xml index 6af90d376..0d37df9c3 100644 --- a/app/src/main/res/values/attrs.xml +++ b/app/src/main/res/values/attrs.xml @@ -17,6 +17,11 @@ + + + + + diff --git a/app/src/main/res/values/keys.xml b/app/src/main/res/values/keys.xml index b6e36a54a..8d293cef5 100644 --- a/app/src/main/res/values/keys.xml +++ b/app/src/main/res/values/keys.xml @@ -32,6 +32,9 @@ pref_keep_screen_on_key pref_custom_brightness_key custom_brightness_value + pref_color_filter_key + color_filter_value + pref_red_filter_value pref_reader_theme_key pref_image_decoder_key reader_volume_keys diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ab4563c2f..1447866d9 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -105,6 +105,7 @@ Enable transitions Show page number Use custom brightness + Use custom color filter Keep screen on Navigation Volume keys @@ -138,6 +139,11 @@ Lock Force portrait Force landscape + R + G + B + A + Downloads directory diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index 46f79b995..ebd7a695f 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -91,6 +91,10 @@ 16sp + + @@ -107,6 +111,10 @@ 20sp + + diff --git a/app/src/main/res/xml/pref_reader.xml b/app/src/main/res/xml/pref_reader.xml index 995688876..aefdf7335 100644 --- a/app/src/main/res/xml/pref_reader.xml +++ b/app/src/main/res/xml/pref_reader.xml @@ -69,11 +69,6 @@ android:key="@string/pref_show_page_number_key" android:defaultValue="true" /> - -