From 62e2a895f59a4d51259f1a67e8aee3ae6d44cc10 Mon Sep 17 00:00:00 2001 From: arkon Date: Thu, 21 May 2020 13:47:01 -0400 Subject: [PATCH] Update reader settings/rewording form upstream --- .../ui/setting/SettingsReaderController.kt | 197 ++++++++++-------- .../main/res/layout/reader_settings_sheet.xml | 2 +- app/src/main/res/values/strings.xml | 6 +- 3 files changed, 120 insertions(+), 85 deletions(-) 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 2d3724eece..f8fd2e70c9 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 @@ -10,92 +10,121 @@ class SettingsReaderController : SettingsController() { override fun setupPreferenceScreen(screen: PreferenceScreen) = with(screen) { titleRes = R.string.reader - intListPreference(activity) { - key = Keys.defaultViewer - titleRes = R.string.default_viewer - entriesRes = arrayOf(R.string.left_to_right_viewer, R.string.right_to_left_viewer, - R.string.vertical_viewer, R.string.webtoon, R.string.continuous_vertical) - entryRange = 1..5 - defaultValue = 1 - } - 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 - } - intListPreference(activity) { - key = Keys.rotation - titleRes = R.string.rotation - entriesRes = arrayOf(R.string.free, R.string.lock, - R.string.force_portrait, R.string.force_landscape) - entryRange = 1..4 - defaultValue = 1 - } - intListPreference(activity) { - key = Keys.readerTheme - titleRes = R.string.background_color - entriesRes = arrayOf(R.string.white, R.string.black, R.string - .smart_based_on_page, R.string.smart_based_on_page_and_theme) - entryRange = 0..3 - defaultValue = 2 - } - intListPreference(activity) { - key = Keys.doubleTapAnimationSpeed - titleRes = R.string.double_tap_anim_speed - entries = listOf(context.getString(R.string.no_animation), context.getString(R - .string.fast), context.getString(R.string.normal)) - entryValues = listOf(1, 250, 500) // using a value of 0 breaks the image viewer, so - // min is 1 - defaultValue = 500 - } - switchPreference { - key = Keys.skipRead - titleRes = R.string.skip_read_chapters - defaultValue = false - } - switchPreference { - key = Keys.fullscreen - titleRes = R.string.fullscreen - defaultValue = true - } - switchPreference { - key = Keys.keepScreenOn - titleRes = R.string.keep_screen_on - defaultValue = true - } - switchPreference { - key = Keys.showPageNumber - titleRes = R.string.show_page_number - defaultValue = true - } - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { - switchPreference { - key = Keys.trueColor - titleRes = R.string.true_32bit_color - defaultValue = false + preferenceCategory { + titleRes = R.string.general + intListPreference(activity) { + key = Keys.defaultViewer + titleRes = R.string.default_viewer + entriesRes = arrayOf( + R.string.left_to_right_viewer, + R.string.right_to_left_viewer, + R.string.vertical_viewer, + R.string.webtoon, + R.string.continuous_vertical + ) + entryRange = 1..5 + defaultValue = 1 + } + intListPreference(activity) { + key = Keys.rotation + titleRes = R.string.rotation + entriesRes = arrayOf( + R.string.free, R.string.lock, R.string.force_portrait, R.string.force_landscape + ) + entryRange = 1..4 + defaultValue = 1 + } + intListPreference(activity) { + key = Keys.readerTheme + titleRes = R.string.background_color + entriesRes = arrayOf( + R.string.white, + R.string.black, + R.string.smart_based_on_page, + R.string.smart_based_on_page_and_theme + ) + entryRange = 0..3 + defaultValue = 2 + } + intListPreference(activity) { + key = Keys.doubleTapAnimationSpeed + titleRes = R.string.double_tap_anim_speed + entries = listOf( + context.getString(R.string.no_animation), context.getString( + R.string.fast + ), context.getString(R.string.normal) + ) + entryValues = listOf(1, 250, 500) // using a value of 0 breaks the image viewer, so + // min is 1 + defaultValue = 500 + } + switchPreference { + key = Keys.fullscreen + titleRes = R.string.fullscreen + defaultValue = true + } + switchPreference { + key = Keys.keepScreenOn + titleRes = R.string.keep_screen_on + defaultValue = true + } + switchPreference { + key = Keys.showPageNumber + titleRes = R.string.show_page_number + defaultValue = true + } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + switchPreference { + key = Keys.trueColor + titleRes = R.string.true_32bit_color + summaryRes = R.string.reduces_banding_impacts_performance + defaultValue = false + } } - } - switchPreference { - key = Keys.alwaysShowChapterTransition - titleRes = R.string.always_show_chapter_transition - defaultValue = true } 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 { key = Keys.enableTransitions titleRes = R.string.page_transitions @@ -121,8 +150,10 @@ class SettingsReaderController : SettingsController() { titleRes = R.string.pref_webtoon_side_padding entriesRes = arrayOf( R.string.webtoon_side_padding_0, - R.string.webtoon_side_padding_10, R.string.webtoon_side_padding_15, - R.string.webtoon_side_padding_20, R.string.webtoon_side_padding_25 + R.string.webtoon_side_padding_10, + 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) defaultValue = "0" diff --git a/app/src/main/res/layout/reader_settings_sheet.xml b/app/src/main/res/layout/reader_settings_sheet.xml index e887365353..588e834c2b 100644 --- a/app/src/main/res/layout/reader_settings_sheet.xml +++ b/app/src/main/res/layout/reader_settings_sheet.xml @@ -158,7 +158,7 @@ android:layout_width="0dp" android:layout_height="wrap_content" android:layout_marginTop="16dp" - android:text="@string/pager_viewer" + android:text="@string/paged" android:textColor="?attr/colorAccent" android:textStyle="bold" app:layout_constraintStart_toStartOf="parent" diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 653fe74fc0..314b84b25f 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -291,6 +291,8 @@ Double tap animation speed Show page number 32-bit color + Reduces banding, but impacts + performance Crop borders Use custom brightness Use custom color filter @@ -317,7 +319,7 @@ Right to left Vertical Continuous vertical - Pager + Paged Scale type Fit screen Stretch @@ -335,6 +337,8 @@ Smart (based on page) Smart (based on page and theme) Always show chapter transition + If disabled, the transition page will be + skipped if the next chapter is loaded Side padding None 10%