Skip to content

Instantly share code, notes, and snippets.

@marcauberer
Last active September 12, 2020 16:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcauberer/c69febc6f275dfdbc134883782f38531 to your computer and use it in GitHub Desktop.
Save marcauberer/c69febc6f275dfdbc134883782f38531 to your computer and use it in GitHub Desktop.
SimpleSettings - Customization
private fun showPreferences() {
val config = SimpleSettingsConfig().apply {
showResetOption = true
preferenceCallback = this@MainActivity
}
SimpleSettings(this@MainActivity, config).show(R.xml.preferences)
}
override fun onPreferenceClick(context: Context, key: String): Preference.OnPreferenceClickListener? {
return when(key) {
"preference" -> WebsiteClickListener(this@MainActivity, getString(R.string.url_github))
else -> super.onPreferenceClick(context, key)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment