[Android] Fix subtitle default settings
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> | Tue Sep 20 15:13:00 2022 +0200| [849b28960658a2aebd4287a58cbe38aaaafc7d54] | committer: Duncan McNamara
Fix subtitle default settings
> https://code.videolan.org/videolan/vlc-android/commit/849b28960658a2aebd4287a58cbe38aaaafc7d54
---
.../resources/src/main/java/org/videolan/resources/VLCOptions.kt | 4 ++--
application/resources/src/main/res/values/colors.xml | 1 -
.../videolan/television/ui/preferences/PreferencesSubtitles.kt | 6 +++---
application/vlc-android/res/xml/preferences_subtitles.xml | 4 ++--
.../src/org/videolan/vlc/gui/preferences/PreferencesSubtitles.kt | 8 ++++----
5 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt b/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
index 8b4b4c468..80a0ce009 100644
--- a/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
+++ b/application/resources/src/main/java/org/videolan/resources/VLCOptions.kt
@@ -98,8 +98,8 @@ object VLCOptions {
val freetypeShadowEnabled = pref.getBoolean("subtitles_shadow", true)
- val freetypeShadowColor = Integer.decode(String.format("0x%06X", (0xFFFFFF and pref.getInt("subtitles_shadow_color", ContextCompat.getColor(context, R.color.grey_subtitle_shadow)))))
- val freetypeShadowOpacity = pref.getInt("subtitles_shadow_color_opacity", 255)
+ val freetypeShadowColor = Integer.decode(String.format("0x%06X", (0xFFFFFF and pref.getInt("subtitles_shadow_color", ContextCompat.getColor(context, R.color.black)))))
+ val freetypeShadowOpacity = pref.getInt("subtitles_shadow_color_opacity", 128)
val opengl = Integer.parseInt(pref.getString("opengl", "-1")!!)
diff --git a/application/resources/src/main/res/values/colors.xml b/application/resources/src/main/res/values/colors.xml
index afa7d894a..0d96f23ed 100644
--- a/application/resources/src/main/res/values/colors.xml
+++ b/application/resources/src/main/res/values/colors.xml
@@ -49,7 +49,6 @@
<color name="grey875">#2a2a2a</color>
<color name="grey900">#212121</color>
- <color name="grey_subtitle_shadow">#808080</color>
<color name="dark_background">#131313</color>
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 9595db10a..8ac5624f7 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
@@ -179,15 +179,15 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
subtitlesOpacity.value = 255
subtitlesBackgroundEnabled.isChecked = false
- subtitlesBackgroundColor.saveValue(Color.BLACK)
+ subtitlesBackgroundColor.saveValue(ContextCompat.getColor(activity, R.color.black))
subtitlesBackgroundOpacity.value = 255
subtitlesShadowEnabled.isChecked = true
- subtitlesShadowColor.saveValue(ContextCompat.getColor(activity, R.color.grey_subtitle_shadow))
+ subtitlesShadowColor.saveValue(ContextCompat.getColor(activity, R.color.black))
subtitlesShadowOpacity.value = 255
subtitlesOutlineEnabled.isChecked = true
- subtitlesOutlineColor.saveValue(Color.BLACK)
+ subtitlesOutlineColor.saveValue(ContextCompat.getColor(activity, R.color.black))
subtitlesOutlineOpacity.value = 255
}
diff --git a/application/vlc-android/res/xml/preferences_subtitles.xml b/application/vlc-android/res/xml/preferences_subtitles.xml
index ae08ebf3d..a912aef83 100644
--- a/application/vlc-android/res/xml/preferences_subtitles.xml
+++ b/application/vlc-android/res/xml/preferences_subtitles.xml
@@ -88,13 +88,13 @@
android:title="@string/subtitles_shadow_title"
app:singleLineTitle="false" />
<com.jaredrummler.android.colorpicker.ColorPreferenceCompat
- android:defaultValue="@color/grey_subtitle_shadow"
+ android:defaultValue="@color/black"
android:key="subtitles_shadow_color"
app:isPreferenceVisible="false"
android:title="@string/subtitles_color" />
<SeekBarPreference
- android:defaultValue="255"
+ android:defaultValue="128"
android:key="subtitles_shadow_color_opacity"
app:iconSpaceReserved="false"
app:isPreferenceVisible="false"
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 27eaa729f..c585f0616 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
@@ -138,15 +138,15 @@ class PreferencesSubtitles : BasePreferenceFragment(), SharedPreferences.OnShare
subtitlesOpacity.value = 255
subtitlesBackgroundEnabled.isChecked = false
- subtitlesBackgroundColor.saveValue(Color.BLACK)
+ subtitlesBackgroundColor.saveValue(ContextCompat.getColor(requireActivity(), R.color.black))
subtitlesBackgroundOpacity.value = 255
subtitlesShadowEnabled.isChecked = true
- subtitlesShadowColor.saveValue(ContextCompat.getColor(requireActivity(), R.color.grey_subtitle_shadow))
- subtitlesShadowOpacity.value = 255
+ subtitlesShadowColor.saveValue(ContextCompat.getColor(requireActivity(), R.color.black))
+ subtitlesShadowOpacity.value = 128
subtitlesOutlineEnabled.isChecked = true
- subtitlesOutlineColor.saveValue(Color.BLACK)
+ subtitlesOutlineColor.saveValue(ContextCompat.getColor(requireActivity(), R.color.black))
subtitlesOutlineOpacity.value = 255
}
More information about the Android
mailing list