Conditionally hide offline Id3 Setting

This commit is contained in:
tzugen 2022-07-06 12:26:48 +02:00
parent b955d77152
commit 78bfab3753
No known key found for this signature in database
GPG Key ID: 61E9C34BC10EC930
1 changed files with 5 additions and 1 deletions

View File

@ -76,6 +76,7 @@ class SettingsFragment :
private var directoryCacheTime: ListPreference? = null private var directoryCacheTime: ListPreference? = null
private var mediaButtonsEnabled: CheckBoxPreference? = null private var mediaButtonsEnabled: CheckBoxPreference? = null
private var showArtistPicture: CheckBoxPreference? = null private var showArtistPicture: CheckBoxPreference? = null
private var useId3TagsOffline: CheckBoxPreference? = null
private var sharingDefaultDescription: EditTextPreference? = null private var sharingDefaultDescription: EditTextPreference? = null
private var sharingDefaultGreeting: EditTextPreference? = null private var sharingDefaultGreeting: EditTextPreference? = null
private var sharingDefaultExpiration: TimeSpanPreference? = null private var sharingDefaultExpiration: TimeSpanPreference? = null
@ -121,6 +122,7 @@ class SettingsFragment :
pauseOnBluetoothDevice = findPreference(Constants.PREFERENCES_KEY_PAUSE_ON_BLUETOOTH_DEVICE) pauseOnBluetoothDevice = findPreference(Constants.PREFERENCES_KEY_PAUSE_ON_BLUETOOTH_DEVICE)
debugLogToFile = findPreference(Constants.PREFERENCES_KEY_DEBUG_LOG_TO_FILE) debugLogToFile = findPreference(Constants.PREFERENCES_KEY_DEBUG_LOG_TO_FILE)
showArtistPicture = findPreference(Constants.PREFERENCES_KEY_SHOW_ARTIST_PICTURE) showArtistPicture = findPreference(Constants.PREFERENCES_KEY_SHOW_ARTIST_PICTURE)
useId3TagsOffline = findPreference(Constants.PREFERENCES_KEY_ID3_TAGS_OFFLINE)
customCacheLocation = findPreference(Constants.PREFERENCES_KEY_CUSTOM_CACHE_LOCATION) customCacheLocation = findPreference(Constants.PREFERENCES_KEY_CUSTOM_CACHE_LOCATION)
sharingDefaultGreeting?.text = shareGreeting sharingDefaultGreeting?.text = shareGreeting
@ -196,7 +198,8 @@ class SettingsFragment :
setDebugLogToFile(sharedPreferences.getBoolean(key, false)) setDebugLogToFile(sharedPreferences.getBoolean(key, false))
} }
Constants.PREFERENCES_KEY_ID3_TAGS -> { Constants.PREFERENCES_KEY_ID3_TAGS -> {
showArtistPicture!!.isEnabled = sharedPreferences.getBoolean(key, false) showArtistPicture?.isEnabled = sharedPreferences.getBoolean(key, false)
useId3TagsOffline?.isEnabled = sharedPreferences.getBoolean(key, false)
} }
Constants.PREFERENCES_KEY_THEME -> { Constants.PREFERENCES_KEY_THEME -> {
RxBus.themeChangedEventPublisher.onNext(Unit) RxBus.themeChangedEventPublisher.onNext(Unit)
@ -372,6 +375,7 @@ class SettingsFragment :
debugLogToFile?.summary = "" debugLogToFile?.summary = ""
} }
showArtistPicture?.isEnabled = shouldUseId3Tags showArtistPicture?.isEnabled = shouldUseId3Tags
useId3TagsOffline?.isEnabled = shouldUseId3Tags
} }
private fun setHideMedia(hide: Boolean) { private fun setHideMedia(hide: Boolean) {