mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2025-03-18 12:18:48 +03:00
Code cleanup
This commit is contained in:
parent
a05caf6f0e
commit
c13b636bae
5 changed files with 11 additions and 21 deletions
|
@ -85,7 +85,7 @@ data class PushRule(
|
|||
*/
|
||||
fun removeNotificationSound(): PushRule {
|
||||
return copy(
|
||||
actions = (getActions().filter { it !is Action.Sound }).toJson()
|
||||
actions = getActions().filter { it !is Action.Sound }.toJson()
|
||||
)
|
||||
}
|
||||
|
||||
|
|
|
@ -45,7 +45,6 @@ class VectorPreferences @Inject constructor(private val context: Context) {
|
|||
const val SETTINGS_APP_TERM_CONDITIONS_PREFERENCE_KEY = "SETTINGS_APP_TERM_CONDITIONS_PREFERENCE_KEY"
|
||||
const val SETTINGS_PRIVACY_POLICY_PREFERENCE_KEY = "SETTINGS_PRIVACY_POLICY_PREFERENCE_KEY"
|
||||
|
||||
const val SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY"
|
||||
const val SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY"
|
||||
const val SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY"
|
||||
const val SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_OTHER_THIRD_PARTY_NOTICES_PREFERENCE_KEY"
|
||||
|
|
|
@ -77,21 +77,14 @@ class VectorSettingsActivity : VectorBaseActivity(),
|
|||
}
|
||||
|
||||
override fun onPreferenceStartFragment(caller: PreferenceFragmentCompat, pref: Preference): Boolean {
|
||||
val oFragment = when {
|
||||
VectorPreferences.SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY == pref.key ->
|
||||
supportFragmentManager.fragmentFactory.instantiate(classLoader, VectorSettingsNotificationsTroubleshootFragment::class.java.name)
|
||||
VectorPreferences.SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY == pref.key ->
|
||||
supportFragmentManager.fragmentFactory.instantiate(classLoader, VectorSettingsAdvancedNotificationPreferenceFragment::class.java.name)
|
||||
else ->
|
||||
try {
|
||||
pref.fragment?.let {
|
||||
supportFragmentManager.fragmentFactory.instantiate(classLoader, it)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
showSnackbar(getString(R.string.not_implemented))
|
||||
Timber.e(e)
|
||||
null
|
||||
}
|
||||
val oFragment = try {
|
||||
pref.fragment?.let {
|
||||
supportFragmentManager.fragmentFactory.instantiate(classLoader, it)
|
||||
}
|
||||
} catch (e: Throwable) {
|
||||
showSnackbar(getString(R.string.not_implemented))
|
||||
Timber.e(e)
|
||||
null
|
||||
}
|
||||
|
||||
if (oFragment != null) {
|
||||
|
|
|
@ -25,9 +25,8 @@ import im.vector.riotx.core.preference.VectorPreference
|
|||
import im.vector.riotx.core.utils.toast
|
||||
import javax.inject.Inject
|
||||
|
||||
class VectorSettingsAdvancedNotificationPreferenceFragment @Inject constructor(
|
||||
private val vectorPreferences: VectorPreferences
|
||||
) : VectorSettingsBaseFragment() {
|
||||
class VectorSettingsAdvancedNotificationPreferenceFragment @Inject constructor()
|
||||
: VectorSettingsBaseFragment() {
|
||||
|
||||
override var titleRes: Int = R.string.settings_notification_advanced
|
||||
|
||||
|
|
|
@ -136,7 +136,6 @@ class VectorSettingsNotificationPreferenceFragment @Inject constructor(
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
override fun onResume() {
|
||||
super.onResume()
|
||||
activeSessionHolder.getSafeActiveSession()?.refreshPushers()
|
||||
|
|
Loading…
Add table
Reference in a new issue