From 1ab07d169d2e7b04930de8d83a6c1b2e98cc917a Mon Sep 17 00:00:00 2001 From: arkon Date: Fri, 1 May 2020 21:40:36 -0400 Subject: [PATCH] Add gray reader background option (closes #3019) --- .../eu/kanade/tachiyomi/ui/reader/ReaderActivity.kt | 3 ++- .../kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt | 2 +- .../tachiyomi/ui/setting/SettingsReaderController.kt | 4 ++-- app/src/main/res/values/arrays.xml | 6 ++++-- app/src/main/res/values/strings.xml | 1 + app/src/main/res/values/themes.xml | 10 +++++----- 6 files changed, 15 insertions(+), 11 deletions(-) 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 d30bf879b..e1c71eea7 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 @@ -128,7 +128,8 @@ class ReaderActivity : BaseRxActivity() setTheme( when (preferences.readerTheme().get()) { 0 -> R.style.Theme_Reader_Light - else -> R.style.Theme_Reader + 2 -> R.style.Theme_Reader_Dark_Grey + else -> R.style.Theme_Reader_Dark } ) super.onCreate(savedInstanceState) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt index b69a6e503..00839dc56 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/reader/ReaderSettingsSheet.kt @@ -81,7 +81,7 @@ class ReaderSettingsSheet(private val activity: ReaderActivity) : BottomSheetDia viewer.setSelection(activity.presenter.manga?.viewer ?: 0, false) rotation_mode.bindToPreference(preferences.rotation(), 1) - background_color.bindToPreference(preferences.readerTheme()) + background_color.bindToIntPreference(preferences.readerTheme(), R.array.reader_themes_values) show_page_number.bindToPreference(preferences.showPageNumber()) fullscreen.bindToPreference(preferences.fullscreen()) cutout_short.bindToPreference(preferences.cutoutShort()) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt index c8900a9f4..b341fba31 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/setting/SettingsReaderController.kt @@ -68,8 +68,8 @@ class SettingsReaderController : SettingsController() { intListPreference { key = Keys.readerTheme titleRes = R.string.pref_reader_theme - entriesRes = arrayOf(R.string.white_background, R.string.black_background) - entryValues = arrayOf("0", "1") + entriesRes = arrayOf(R.string.black_background, R.string.gray_background, R.string.white_background) + entryValues = arrayOf("1", "2", "0") defaultValue = "1" summary = "%s" } diff --git a/app/src/main/res/values/arrays.xml b/app/src/main/res/values/arrays.xml index af08b8abc..cc83d497e 100644 --- a/app/src/main/res/values/arrays.xml +++ b/app/src/main/res/values/arrays.xml @@ -24,13 +24,15 @@ - @string/white_background @string/black_background + @string/gray_background + @string/white_background - 0 1 + 2 + 0 diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index ba7c51562..9af80d36e 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -240,6 +240,7 @@ Long tap dialog Background color White + Gray Black Default viewer Default diff --git a/app/src/main/res/values/themes.xml b/app/src/main/res/values/themes.xml index 6d27d0d80..e48c2f70e 100644 --- a/app/src/main/res/values/themes.xml +++ b/app/src/main/res/values/themes.xml @@ -217,13 +217,13 @@ @style/Theme.Widget.BasicSwitch - - +