Fix prefs

This commit is contained in:
tzugen 2022-04-20 22:54:59 +02:00
parent b6e890b26c
commit dda86b42c7
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 6 additions and 16 deletions

View File

@ -74,9 +74,6 @@ class SettingsFragment :
private var chatRefreshInterval: ListPreference? = null private var chatRefreshInterval: ListPreference? = null
private var directoryCacheTime: ListPreference? = null private var directoryCacheTime: ListPreference? = null
private var mediaButtonsEnabled: CheckBoxPreference? = null private var mediaButtonsEnabled: CheckBoxPreference? = null
private var lockScreenEnabled: CheckBoxPreference? = null
private var sendBluetoothNotifications: CheckBoxPreference? = null
private var sendBluetoothAlbumArt: CheckBoxPreference? = null
private var showArtistPicture: CheckBoxPreference? = null private var showArtistPicture: CheckBoxPreference? = null
private var sharingDefaultDescription: EditTextPreference? = null private var sharingDefaultDescription: EditTextPreference? = null
private var sharingDefaultGreeting: EditTextPreference? = null private var sharingDefaultGreeting: EditTextPreference? = null
@ -120,7 +117,7 @@ class SettingsFragment :
showArtistPicture = findPreference(Constants.PREFERENCES_KEY_SHOW_ARTIST_PICTURE) showArtistPicture = findPreference(Constants.PREFERENCES_KEY_SHOW_ARTIST_PICTURE)
customCacheLocation = findPreference(Constants.PREFERENCES_KEY_CUSTOM_CACHE_LOCATION) customCacheLocation = findPreference(Constants.PREFERENCES_KEY_CUSTOM_CACHE_LOCATION)
sharingDefaultGreeting!!.text = shareGreeting sharingDefaultGreeting?.text = shareGreeting
setupClearSearchPreference() setupClearSearchPreference()
setupCacheLocationPreference() setupCacheLocationPreference()
} }
@ -294,23 +291,16 @@ class SettingsFragment :
sharingDefaultExpiration!!.summary = sharingDefaultExpiration!!.text sharingDefaultExpiration!!.summary = sharingDefaultExpiration!!.text
sharingDefaultDescription!!.summary = sharingDefaultDescription!!.text sharingDefaultDescription!!.summary = sharingDefaultDescription!!.text
sharingDefaultGreeting!!.summary = sharingDefaultGreeting!!.text sharingDefaultGreeting!!.summary = sharingDefaultGreeting!!.text
if (!mediaButtonsEnabled!!.isChecked) {
lockScreenEnabled!!.isChecked = false if (debugLogToFile?.isChecked == true) {
lockScreenEnabled!!.isEnabled = false debugLogToFile?.summary = getString(
}
if (!sendBluetoothNotifications!!.isChecked) {
sendBluetoothAlbumArt!!.isChecked = false
sendBluetoothAlbumArt!!.isEnabled = false
}
if (debugLogToFile!!.isChecked) {
debugLogToFile!!.summary = getString(
R.string.settings_debug_log_path, R.string.settings_debug_log_path,
ultrasonicDirectory, FileLoggerTree.FILENAME ultrasonicDirectory, FileLoggerTree.FILENAME
) )
} else { } else {
debugLogToFile!!.summary = "" debugLogToFile?.summary = ""
} }
showArtistPicture!!.isEnabled = shouldUseId3Tags showArtistPicture?.isEnabled = shouldUseId3Tags
} }
private fun setHideMedia(hide: Boolean) { private fun setHideMedia(hide: Boolean) {