[Android] Add a dedicated setting for the nightly auto update opt-in

Nicolas Pomepuy git at videolan.org
Mon Aug 5 12:28:59 UTC 2024


vlc-android | branch: master | Nicolas Pomepuy <nicolas at videolabs.io> | Mon Aug  5 11:38:18 2024 +0200| [60da867fe353437c6ac50209c3ac473e97c65757] | committer: Duncan McNamara

Add a dedicated setting for the nightly auto update opt-in

> https://code.videolan.org/videolan/vlc-android/commit/60da867fe353437c6ac50209c3ac473e97c65757
---

 application/resources/src/main/res/values/strings.xml              | 1 +
 .../org/videolan/television/ui/preferences/PreferencesAdvanced.kt  | 2 ++
 application/vlc-android/res/xml/preferences_adv.xml                | 7 +++++++
 .../src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt    | 2 ++
 4 files changed, 12 insertions(+)

diff --git a/application/resources/src/main/res/values/strings.xml b/application/resources/src/main/res/values/strings.xml
index 0f54e94fec..133370a883 100644
--- a/application/resources/src/main/res/values/strings.xml
+++ b/application/resources/src/main/res/values/strings.xml
@@ -628,6 +628,7 @@
     <string name="nightly_version">Found version: %2$s - %1$s</string>
     <string name="update_nightly_alert">You are running a nightly version. Would you like to periodically look for updates?</string>
     <string name="update_nightly">Auto update</string>
+    <string name="update_nightly_summary">Search for nightly update periodically</string>
 
 
     <!-- Accessibility -->
diff --git a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt
index 54444b3964..baabb788db 100644
--- a/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt
+++ b/application/television/src/main/java/org/videolan/television/ui/preferences/PreferencesAdvanced.kt
@@ -66,6 +66,7 @@ import org.videolan.tools.BitmapCache
 import org.videolan.tools.DAV1D_THREAD_NUMBER
 import org.videolan.tools.Settings
 import org.videolan.tools.putSingle
+import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.MediaParsingService
 import org.videolan.vlc.R
 import org.videolan.vlc.gui.DebugLogActivity
@@ -118,6 +119,7 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
             }
             return
         }
+        if (!BuildConfig.DEBUG) findPreference<Preference>("show_update")?.isVisible  = false
         super.onDisplayPreferenceDialog(preference)
     }
 
diff --git a/application/vlc-android/res/xml/preferences_adv.xml b/application/vlc-android/res/xml/preferences_adv.xml
index f298a28cf0..8882f94b02 100644
--- a/application/vlc-android/res/xml/preferences_adv.xml
+++ b/application/vlc-android/res/xml/preferences_adv.xml
@@ -132,6 +132,13 @@
                 android:key="nightly_install"
                 android:title="@string/install_nightly"/>
 
+        <CheckBoxPreference
+                app:singleLineTitle="false"
+                android:defaultValue="false"
+                android:key="show_update"
+                android:summary="@string/update_nightly_summary"
+                android:title="@string/update_nightly"/>
+
         <EditTextPreference
                 android:defaultValue=""
                 android:inputType="textMultiLine"
diff --git a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
index 51de6f60c5..ec76154385 100644
--- a/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
+++ b/application/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAdvanced.kt
@@ -64,6 +64,7 @@ import org.videolan.tools.BitmapCache
 import org.videolan.tools.DAV1D_THREAD_NUMBER
 import org.videolan.tools.Settings
 import org.videolan.tools.putSingle
+import org.videolan.vlc.BuildConfig
 import org.videolan.vlc.R
 import org.videolan.vlc.gui.DebugLogActivity
 import org.videolan.vlc.gui.browser.EXTRA_MRL
@@ -106,6 +107,7 @@ class PreferencesAdvanced : BasePreferenceFragment(), SharedPreferences.OnShared
             it.filters = arrayOf<InputFilter>(InputFilter.LengthFilter(5))
             it.setSelection(it.editableText.length)
         }
+        if (!BuildConfig.DEBUG) findPreference<Preference>("show_update")?.isVisible  = false
     }
 
     override fun onStart() {



More information about the Android mailing list