|
|
@ -75,6 +75,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), |
|
|
|
private lateinit var notificationFiltersPreference: Preference |
|
|
|
private lateinit var notificationFiltersPreference: Preference |
|
|
|
private lateinit var publicFiltersPreference: Preference |
|
|
|
private lateinit var publicFiltersPreference: Preference |
|
|
|
private lateinit var threadFiltersPreference: Preference |
|
|
|
private lateinit var threadFiltersPreference: Preference |
|
|
|
|
|
|
|
private lateinit var accountFiltersPreference: Preference |
|
|
|
|
|
|
|
|
|
|
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
|
|
|
override fun onCreatePreferences(savedInstanceState: Bundle?, rootKey: String?) { |
|
|
|
addPreferencesFromResource(R.xml.account_preferences) |
|
|
|
addPreferencesFromResource(R.xml.account_preferences) |
|
|
@ -94,6 +95,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), |
|
|
|
notificationFiltersPreference = requirePreference("notificationFilters") |
|
|
|
notificationFiltersPreference = requirePreference("notificationFilters") |
|
|
|
publicFiltersPreference = requirePreference("publicFilters") |
|
|
|
publicFiltersPreference = requirePreference("publicFilters") |
|
|
|
threadFiltersPreference = requirePreference("threadFilters") |
|
|
|
threadFiltersPreference = requirePreference("threadFilters") |
|
|
|
|
|
|
|
accountFiltersPreference = requirePreference("accountFilters") |
|
|
|
|
|
|
|
|
|
|
|
notificationPreference.icon = IconicsDrawable(notificationPreference.context, GoogleMaterial.Icon.gmd_notifications).apply { sizeRes = R.dimen.preference_icon_size; colorInt = ThemeUtils.getColor(notificationPreference.context, R.attr.iconColor) } |
|
|
|
notificationPreference.icon = IconicsDrawable(notificationPreference.context, GoogleMaterial.Icon.gmd_notifications).apply { sizeRes = R.dimen.preference_icon_size; colorInt = ThemeUtils.getColor(notificationPreference.context, R.attr.iconColor) } |
|
|
|
mutedUsersPreference.icon = getTintedIcon(R.drawable.ic_mute_24dp) |
|
|
|
mutedUsersPreference.icon = getTintedIcon(R.drawable.ic_mute_24dp) |
|
|
@ -109,6 +111,7 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), |
|
|
|
notificationFiltersPreference.onPreferenceClickListener = this |
|
|
|
notificationFiltersPreference.onPreferenceClickListener = this |
|
|
|
publicFiltersPreference.onPreferenceClickListener = this |
|
|
|
publicFiltersPreference.onPreferenceClickListener = this |
|
|
|
threadFiltersPreference.onPreferenceClickListener = this |
|
|
|
threadFiltersPreference.onPreferenceClickListener = this |
|
|
|
|
|
|
|
accountFiltersPreference.onPreferenceClickListener = this |
|
|
|
|
|
|
|
|
|
|
|
defaultPostPrivacyPreference.onPreferenceChangeListener = this |
|
|
|
defaultPostPrivacyPreference.onPreferenceChangeListener = this |
|
|
|
defaultMediaSensitivityPreference.onPreferenceChangeListener = this |
|
|
|
defaultMediaSensitivityPreference.onPreferenceChangeListener = this |
|
|
@ -249,6 +252,9 @@ class AccountPreferencesFragment : PreferenceFragmentCompat(), |
|
|
|
threadFiltersPreference -> { |
|
|
|
threadFiltersPreference -> { |
|
|
|
launchFilterActivity(Filter.THREAD, R.string.pref_title_thread_filter_keywords) |
|
|
|
launchFilterActivity(Filter.THREAD, R.string.pref_title_thread_filter_keywords) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
accountFiltersPreference -> { |
|
|
|
|
|
|
|
launchFilterActivity(Filter.ACCOUNT, R.string.title_accounts) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
else -> false |
|
|
|
else -> false |
|
|
|
} |
|
|
|
} |
|
|
|