Add gray reader background option (closes #3019)

This commit is contained in:
arkon 2020-05-01 21:40:36 -04:00
parent abf2d4b718
commit 1ab07d169d
6 changed files with 15 additions and 11 deletions

View file

@ -128,7 +128,8 @@ class ReaderActivity : BaseRxActivity<ReaderActivityBinding, ReaderPresenter>()
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)

View file

@ -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())

View file

@ -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"
}

View file

@ -24,13 +24,15 @@
</string-array>
<string-array name="reader_themes">
<item>@string/white_background</item>
<item>@string/black_background</item>
<item>@string/gray_background</item>
<item>@string/white_background</item>
</string-array>
<string-array name="reader_themes_values">
<item>0</item>
<item>1</item>
<item>2</item>
<item>0</item>
</string-array>
<string-array name="image_decoders">

View file

@ -240,6 +240,7 @@
<string name="pref_read_with_long_tap">Long tap dialog</string>
<string name="pref_reader_theme">Background color</string>
<string name="white_background">White</string>
<string name="gray_background">Gray</string>
<string name="black_background">Black</string>
<string name="pref_viewer_type">Default viewer</string>
<string name="default_viewer">Default</string>

View file

@ -217,13 +217,13 @@
<item name="switchStyle">@style/Theme.Widget.BasicSwitch</item>
</style>
<style name="Theme.Reader" parent="Theme.Base.Reader.Dark">
<!-- Attributes specific for SDK 16 to SDK 20 -->
<style name="Theme.Reader.Dark" parent="Theme.Base.Reader.Dark" />
<style name="Theme.Reader.Dark.Grey" parent="Theme.Base.Reader.Dark">
<item name="android:colorBackground">@color/backgroundDark</item>
</style>
<style name="Theme.Reader.Light" parent="Theme.Base.Reader.Light">
<!-- Attributes specific for SDK 16 to SDK 20 -->
</style>
<style name="Theme.Reader.Light" parent="Theme.Base.Reader.Light" />
<!--===============-->