[Android] Add a subtitle preset with size and contrast set to the max
Nicolas Pomepuy
git at videolan.org
Tue Sep 20 15:06:15 UTC 2022
vlc-android | branch: 3.5.x | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Sep 12 08:08:40 2022 +0200| [ffd9cf5781adc5611e8e16ffc4a8bed150d524df] | committer: Duncan McNamara
Add a subtitle preset with size and contrast set to the max
> https://code.videolan.org/videolan/vlc-android/commit/ffd9cf5781adc5611e8e16ffc4a8bed150d524df
---
application/resources/src/main/res/values/arrays.xml | 2 ++
application/resources/src/main/res/values/strings.xml | 1 +
.../television/ui/preferences/PreferencesSubtitles.kt | 11 +++++++++--
.../org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt | 11 +++++++++--
4 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/application/resources/src/main/res/values/arrays.xml b/application/resources/src/main/res/values/arrays.xml
index aedf6d5f6..424968c73 100644
--- a/application/resources/src/main/res/values/arrays.xml
+++ b/application/resources/src/main/res/values/arrays.xml
@@ -175,6 +175,7 @@
<string-array name="subtitles_presets_entries">
<item>@string/subtitles_preset_default</item>
<item>@string/subtitles_preset_default_large</item>
+ <item>@string/subtitles_preset_default_largest</item>
<item>@string/subtitles_preset_white_background</item>
<item>@string/subtitles_yellow</item>
<item>@string/subtitles_yellow_background</item>
@@ -186,6 +187,7 @@
<item>2</item>
<item>3</item>
<item>4</item>
+ <item>5</item>
</string-array>
diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index 5df0a34c7..ca707a1c8 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -385,6 +385,7 @@
<string name="new_color">New color</string>
<string name="subtitles_preset_default">Default</string>
<string name="subtitles_preset_default_large">Large text</string>
+ <string name="subtitles_preset_default_largest">Largest text and contrast</string>
<string name="subtitles_preset_white_background">With background</string>
<string name="subtitles_yellow">Yellow</string>
<string name="subtitles_yellow_background">Yellow with background</string>
diff --git a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt
index 96759ba75..9595db10a 100644
--- a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesSubtitles.kt
@@ -118,12 +118,19 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
when (newValue) {
"1" -> subtitlesSize.value = "13"
"2" -> {
+ subtitlesSize.value = "10"
+ subtitlesBackgroundEnabled.isChecked = true
+ subtitlesBackgroundOpacity.value = 255
+ subtitlesShadowEnabled.isChecked = false
+ subtitlesOutlineEnabled.isChecked = false
+ }
+ "3" -> {
subtitlesBackgroundEnabled.isChecked = true
subtitlesBackgroundOpacity.value = 128
subtitlesShadowEnabled.isChecked = false
}
- "3" -> subtitlesColor.saveValue(Color.YELLOW)
- "4" -> {
+ "4" -> subtitlesColor.saveValue(Color.YELLOW)
+ "5" -> {
subtitlesColor.saveValue(Color.YELLOW)
subtitlesBackgroundEnabled.isChecked = true
subtitlesBackgroundOpacity.value = 128
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt
index cb22ff17f..27eaa729f 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt
@@ -104,12 +104,19 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
when (newValue) {
"1" -> subtitlesSize.value = "13"
"2" -> {
+ subtitlesSize.value = "10"
+ subtitlesBackgroundEnabled.isChecked = true
+ subtitlesBackgroundOpacity.value = 255
+ subtitlesShadowEnabled.isChecked = false
+ subtitlesOutlineEnabled.isChecked = false
+ }
+ "3" -> {
subtitlesBackgroundEnabled.isChecked = true
subtitlesBackgroundOpacity.value = 128
subtitlesShadowEnabled.isChecked = false
}
- "3" -> subtitlesColor.saveValue(Color.YELLOW)
- "4" -> {
+ "4" -> subtitlesColor.saveValue(Color.YELLOW)
+ "5" -> {
subtitlesColor.saveValue(Color.YELLOW)
subtitlesBackgroundEnabled.isChecked = true
subtitlesBackgroundOpacity.value = 128
More information about the Android
mailing list