Update reader settings/rewording form upstream

This commit is contained in:
arkon 2020-05-21 13:47:01 -04:00 committed by Jay
parent 172702e177
commit 62e2a895f5
3 changed files with 120 additions and 85 deletions

View File

@ -10,92 +10,121 @@ class SettingsReaderController : SettingsController() {
override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) { override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) {
titleRes = R.string.reader titleRes = R.string.reader
intListPreference(activity) { preferenceCategory {
key = Keys.defaultViewer titleRes = R.string.general
titleRes = R.string.default_viewer intListPreference(activity) {
entriesRes = arrayOf(R.string.left_to_right_viewer, R.string.right_to_left_viewer, key = Keys.defaultViewer
R.string.vertical_viewer, R.string.webtoon, R.string.continuous_vertical) titleRes = R.string.default_viewer
entryRange = 1..5 entriesRes = arrayOf(
defaultValue = 1 R.string.left_to_right_viewer,
} R.string.right_to_left_viewer,
intListPreference(activity) { R.string.vertical_viewer,
key = Keys.imageScaleType R.string.webtoon,
titleRes = R.string.scale_type R.string.continuous_vertical
entriesRes = arrayOf(R.string.fit_screen, R.string.stretch, )
R.string.fit_width, R.string.fit_height, entryRange = 1..5
R.string.original_size, R.string.smart_fit) defaultValue = 1
entryRange = 1..6 }
defaultValue = 1 intListPreference(activity) {
} key = Keys.rotation
intListPreference(activity) { titleRes = R.string.rotation
key = Keys.zoomStart entriesRes = arrayOf(
titleRes = R.string.zoom_start_position R.string.free, R.string.lock, R.string.force_portrait, R.string.force_landscape
entriesRes = arrayOf(R.string.automatic, R.string.left, )
R.string.right, R.string.center) entryRange = 1..4
entryRange = 1..4 defaultValue = 1
defaultValue = 1 }
} intListPreference(activity) {
intListPreference(activity) { key = Keys.readerTheme
key = Keys.rotation titleRes = R.string.background_color
titleRes = R.string.rotation entriesRes = arrayOf(
entriesRes = arrayOf(R.string.free, R.string.lock, R.string.white,
R.string.force_portrait, R.string.force_landscape) R.string.black,
entryRange = 1..4 R.string.smart_based_on_page,
defaultValue = 1 R.string.smart_based_on_page_and_theme
} )
intListPreference(activity) { entryRange = 0..3
key = Keys.readerTheme defaultValue = 2
titleRes = R.string.background_color }
entriesRes = arrayOf(R.string.white, R.string.black, R.string intListPreference(activity) {
.smart_based_on_page, R.string.smart_based_on_page_and_theme) key = Keys.doubleTapAnimationSpeed
entryRange = 0..3 titleRes = R.string.double_tap_anim_speed
defaultValue = 2 entries = listOf(
} context.getString(R.string.no_animation), context.getString(
intListPreference(activity) { R.string.fast
key = Keys.doubleTapAnimationSpeed ), context.getString(R.string.normal)
titleRes = R.string.double_tap_anim_speed )
entries = listOf(context.getString(R.string.no_animation), context.getString(R entryValues = listOf(1, 250, 500) // using a value of 0 breaks the image viewer, so
.string.fast), context.getString(R.string.normal)) // min is 1
entryValues = listOf(1, 250, 500) // using a value of 0 breaks the image viewer, so defaultValue = 500
// min is 1 }
defaultValue = 500 switchPreference {
} key = Keys.fullscreen
switchPreference { titleRes = R.string.fullscreen
key = Keys.skipRead defaultValue = true
titleRes = R.string.skip_read_chapters }
defaultValue = false switchPreference {
} key = Keys.keepScreenOn
switchPreference { titleRes = R.string.keep_screen_on
key = Keys.fullscreen defaultValue = true
titleRes = R.string.fullscreen }
defaultValue = true switchPreference {
} key = Keys.showPageNumber
switchPreference { titleRes = R.string.show_page_number
key = Keys.keepScreenOn defaultValue = true
titleRes = R.string.keep_screen_on }
defaultValue = true if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
} switchPreference {
switchPreference { key = Keys.trueColor
key = Keys.showPageNumber titleRes = R.string.true_32bit_color
titleRes = R.string.show_page_number summaryRes = R.string.reduces_banding_impacts_performance
defaultValue = true defaultValue = false
} }
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
switchPreference {
key = Keys.trueColor
titleRes = R.string.true_32bit_color
defaultValue = false
} }
}
switchPreference {
key = Keys.alwaysShowChapterTransition
titleRes = R.string.always_show_chapter_transition
defaultValue = true
} }
preferenceCategory { preferenceCategory {
titleRes = R.string.pager_viewer titleRes = R.string.reading
switchPreference {
key = Keys.skipRead
titleRes = R.string.skip_read_chapters
defaultValue = false
}
switchPreference {
key = Keys.alwaysShowChapterTransition
titleRes = R.string.always_show_chapter_transition
summaryRes = R.string.if_disabled_transition_will_skip
defaultValue = true
}
}
preferenceCategory {
titleRes = R.string.paged
intListPreference(activity) {
key = Keys.imageScaleType
titleRes = R.string.scale_type
entriesRes = arrayOf(
R.string.fit_screen,
R.string.stretch,
R.string.fit_width,
R.string.fit_height,
R.string.original_size,
R.string.smart_fit
)
entryRange = 1..6
defaultValue = 1
}
intListPreference(activity) {
key = Keys.zoomStart
titleRes = R.string.zoom_start_position
entriesRes = arrayOf(
R.string.automatic, R.string.left, R.string.right, R.string.center
)
entryRange = 1..4
defaultValue = 1
}
switchPreference { switchPreference {
key = Keys.enableTransitions key = Keys.enableTransitions
titleRes = R.string.page_transitions titleRes = R.string.page_transitions
@ -121,8 +150,10 @@ class SettingsReaderController : SettingsController() {
titleRes = R.string.pref_webtoon_side_padding titleRes = R.string.pref_webtoon_side_padding
entriesRes = arrayOf( entriesRes = arrayOf(
R.string.webtoon_side_padding_0, R.string.webtoon_side_padding_0,
R.string.webtoon_side_padding_10, R.string.webtoon_side_padding_15, R.string.webtoon_side_padding_10,
R.string.webtoon_side_padding_20, R.string.webtoon_side_padding_25 R.string.webtoon_side_padding_15,
R.string.webtoon_side_padding_20,
R.string.webtoon_side_padding_25
) )
entryValues = listOf(0, 10, 15, 20, 25) entryValues = listOf(0, 10, 15, 20, 25)
defaultValue = "0" defaultValue = "0"

View File

@ -158,7 +158,7 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="16dp" android:layout_marginTop="16dp"
android:text="@string/pager_viewer" android:text="@string/paged"
android:textColor="?attr/colorAccent" android:textColor="?attr/colorAccent"
android:textStyle="bold" android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"

View File

@ -291,6 +291,8 @@
<string name="double_tap_anim_speed">Double tap animation speed</string> <string name="double_tap_anim_speed">Double tap animation speed</string>
<string name="show_page_number">Show page number</string> <string name="show_page_number">Show page number</string>
<string name="true_32bit_color">32-bit color</string> <string name="true_32bit_color">32-bit color</string>
<string name="reduces_banding_impacts_performance">Reduces banding, but impacts
performance</string>
<string name="crop_borders">Crop borders</string> <string name="crop_borders">Crop borders</string>
<string name="use_custom_brightness">Use custom brightness</string> <string name="use_custom_brightness">Use custom brightness</string>
<string name="use_custom_color_filter">Use custom color filter</string> <string name="use_custom_color_filter">Use custom color filter</string>
@ -317,7 +319,7 @@
<string name="right_to_left_viewer">Right to left</string> <string name="right_to_left_viewer">Right to left</string>
<string name="vertical_viewer">Vertical</string> <string name="vertical_viewer">Vertical</string>
<string name="continuous_vertical">Continuous vertical</string> <string name="continuous_vertical">Continuous vertical</string>
<string name="pager_viewer">Pager</string> <string name="paged">Paged</string>
<string name="scale_type">Scale type</string> <string name="scale_type">Scale type</string>
<string name="fit_screen">Fit screen</string> <string name="fit_screen">Fit screen</string>
<string name="stretch">Stretch</string> <string name="stretch">Stretch</string>
@ -335,6 +337,8 @@
<string name="smart_based_on_page">Smart (based on page)</string> <string name="smart_based_on_page">Smart (based on page)</string>
<string name="smart_based_on_page_and_theme">Smart (based on page and theme)</string> <string name="smart_based_on_page_and_theme">Smart (based on page and theme)</string>
<string name="always_show_chapter_transition">Always show chapter transition</string> <string name="always_show_chapter_transition">Always show chapter transition</string>
<string name="if_disabled_transition_will_skip">If disabled, the transition page will be
skipped if the next chapter is loaded</string>
<string name="pref_webtoon_side_padding">Side padding</string> <string name="pref_webtoon_side_padding">Side padding</string>
<string name="webtoon_side_padding_0">None</string> <string name="webtoon_side_padding_0">None</string>
<string name="webtoon_side_padding_10">10%</string> <string name="webtoon_side_padding_10">10%</string>