chore: simplify settings intent #77
1 changed files with 11 additions and 16 deletions
|
@ -38,25 +38,20 @@ class SettingsFragment: PreferenceFragmentCompat() {
|
||||||
}.collect()
|
}.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
findPreference<Preference>("pref_info_app_version")
|
findPreference<Preference>("pref_info_app_version")?.apply {
|
||||||
?.apply {
|
summary = requireContext().selfAppVersion
|
||||||
summary = requireContext().selfAppVersion
|
|
||||||
|
|
||||||
// Enable developer options when this is clicked for 7 times
|
// Enable developer options when this is clicked for 7 times
|
||||||
setOnPreferenceClickListener(this@SettingsFragment::onAppVersionClicked)
|
setOnPreferenceClickListener(::onAppVersionClicked)
|
||||||
}
|
}
|
||||||
|
|
||||||
findPreference<Preference>("pref_info_source_code")
|
findPreference<Preference>("pref_info_source_code")?.apply {
|
||||||
?.setOnPreferenceClickListener {
|
intent = Intent(Intent.ACTION_VIEW, Uri.parse(summary.toString()))
|
||||||
startActivity(Intent(Intent.ACTION_VIEW, Uri.parse(it.summary.toString())))
|
}
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
findPreference<Preference>("pref_advanced_logs")
|
findPreference<Preference>("pref_advanced_logs")?.apply {
|
||||||
?.setOnPreferenceClickListener {
|
intent = Intent(requireContext(), LogsActivity::class.java)
|
||||||
startActivity(Intent(requireContext(), LogsActivity::class.java))
|
}
|
||||||
true
|
|
||||||
}
|
|
||||||
|
|
||||||
findPreference<CheckBoxPreference>("pref_notifications_download")
|
findPreference<CheckBoxPreference>("pref_notifications_download")
|
||||||
?.bindBooleanFlow(preferenceRepository.notificationDownloadFlow, PreferenceKeys.NOTIFICATION_DOWNLOAD)
|
?.bindBooleanFlow(preferenceRepository.notificationDownloadFlow, PreferenceKeys.NOTIFICATION_DOWNLOAD)
|
||||||
|
|
Loading…
Add table
Reference in a new issue