[Android] Fix ClassCastException for Audio output preference
Nicolas Pomepuy
git at videolan.org
Tue Aug 13 10:27:06 CEST 2019
vlc-android | branch: 3.2.x | Nicolas Pomepuy <nicolas.pomepuy at gmail.com> | Mon Aug 12 07:06:58 2019 +0200| [47ec6fabb948613daf53bd08062b1e5650994830] | committer: Geoffrey Métais
Fix ClassCastException for Audio output preference
(cherry picked from commit 597da4fd2ee30040e3b2f8a3af853fc9ce569dcd)
> https://code.videolan.org/videolan/vlc-android/commit/47ec6fabb948613daf53bd08062b1e5650994830
---
vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt | 4 ++--
.../src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.kt | 4 ++--
2 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt
index fabd3bdac..60288053b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/preferences/PreferencesAudio.kt
@@ -24,8 +24,8 @@ package org.videolan.vlc.gui.preferences
import android.content.SharedPreferences
import android.os.Bundle
+import androidx.preference.CheckBoxPreference
import androidx.preference.Preference
-import androidx.preference.SwitchPreference
import androidx.preference.TwoStatePreference
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
@@ -92,7 +92,7 @@ class PreferencesAudio : BasePreferenceFragment(), SharedPreferences.OnSharedPre
VLCInstance.restart()
(activity as PreferencesActivity).restartMediaPlayer()
val opensles = "1" == preferenceManager.sharedPreferences.getString("aout", "0")
- if (opensles) findPreference<SwitchPreference>("audio_digital_output")?.isChecked = false
+ if (opensles) findPreference<CheckBoxPreference>("audio_digital_output")?.isChecked = false
findPreference<Preference>("audio_digital_output")?.isVisible = !opensles
}
"audio_digital_output" -> updatePassThroughSummary()
diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.kt b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.kt
index ad409d63f..2763394c0 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.kt
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/preferences/PreferencesAudio.kt
@@ -26,8 +26,8 @@ import android.annotation.TargetApi
import android.content.SharedPreferences
import android.os.Build
import android.os.Bundle
+import androidx.preference.CheckBoxPreference
import androidx.preference.Preference
-import androidx.preference.SwitchPreference
import kotlinx.coroutines.ExperimentalCoroutinesApi
import kotlinx.coroutines.ObsoleteCoroutinesApi
import org.videolan.libvlc.util.AndroidUtil
@@ -86,7 +86,7 @@ class PreferencesAudio : BasePreferenceFragment(), SharedPreferences.OnSharedPre
VLCInstance.restart()
if (activity != null) (activity as PreferencesActivity).restartMediaPlayer()
val opensles = "1" == preferenceManager.sharedPreferences.getString("aout", "0")
- if (opensles) findPreference<SwitchPreference>("audio_digital_output")?.isChecked = false
+ if (opensles) findPreference<CheckBoxPreference>("audio_digital_output")?.isChecked = false
findPreference<Preference>("audio_digital_output")?.isVisible = !opensles
}
}
More information about the Android
mailing list