feat(ui): add security preference to settings

Add a new security preference in the settings screen that links to the
SECURITY.md file on GitHub. This includes a new security icon and
localized strings for multiple languages.
This commit is contained in:
2026-05-15 21:51:07 +02:00
parent f7ddc30127
commit 5d7df9550e
12 changed files with 45 additions and 0 deletions
@@ -309,6 +309,21 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
return@setOnPreferenceClickListener true
}
// set up "Security" preference
val preferenceSecurity = Preference(context)
preferenceSecurity.title = getString(R.string.pref_security_title)
preferenceSecurity.setIcon(R.drawable.ic_security_24dp)
preferenceSecurity.summary = getString(R.string.pref_security_summary)
preferenceSecurity.setOnPreferenceClickListener {
// open web browser
val intent = Intent().apply {
action = Intent.ACTION_VIEW
data = "https://github.com/michatec/Radio/blob/master/SECURITY.md".toUri()
}
startActivity(intent)
return@setOnPreferenceClickListener true
}
val preferenceLanguageSelection = Preference(context)
preferenceLanguageSelection.title = getString(R.string.pref_language_selection_title)
preferenceLanguageSelection.setIcon(R.drawable.ic_language_24dp)
@@ -375,6 +390,7 @@ class SettingsFragment : PreferenceFragmentCompat(), YesNoDialog.YesNoDialogList
screen.addPreference(preferenceCategoryLinks)
preferenceCategoryLinks.addPreference(preferenceGitHub)
preferenceCategoryLinks.addPreference(preferenceLicense)
preferenceCategoryLinks.addPreference(preferenceSecurity)
preferenceScreen = screen
}