From 1228fcda0d4913d6d306da45fb2432b478240c2a Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 28 Feb 2020 19:14:15 +0100 Subject: [PATCH] Rename class --- ...ificationTroubleshootTestManagerFactory.kt | 6 ++--- ...ulePreference.kt => PushRulePreference.kt} | 4 ++-- ...sAdvancedNotificationPreferenceFragment.kt | 4 ++-- ...esSettings.kt => TestPushRulesSettings.kt} | 2 +- ...le.xml => vector_preference_push_rule.xml} | 0 ...ings_notification_advanced_preferences.xml | 22 +++++++++---------- 6 files changed, 19 insertions(+), 19 deletions(-) rename vector/src/main/java/im/vector/riotx/core/preference/{BingRulePreference.kt => PushRulePreference.kt} (98%) rename vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/{TestBingRulesSettings.kt => TestPushRulesSettings.kt} (98%) rename vector/src/main/res/layout/{vector_preference_bing_rule.xml => vector_preference_push_rule.xml} (100%) diff --git a/vector/src/fdroid/java/im/vector/riotx/push/fcm/NotificationTroubleshootTestManagerFactory.kt b/vector/src/fdroid/java/im/vector/riotx/push/fcm/NotificationTroubleshootTestManagerFactory.kt index 723a0b9327..b88a379450 100644 --- a/vector/src/fdroid/java/im/vector/riotx/push/fcm/NotificationTroubleshootTestManagerFactory.kt +++ b/vector/src/fdroid/java/im/vector/riotx/push/fcm/NotificationTroubleshootTestManagerFactory.kt @@ -20,7 +20,7 @@ import im.vector.riotx.fdroid.features.settings.troubleshoot.TestAutoStartBoot import im.vector.riotx.fdroid.features.settings.troubleshoot.TestBackgroundRestrictions import im.vector.riotx.features.settings.troubleshoot.NotificationTroubleshootTestManager import im.vector.riotx.features.settings.troubleshoot.TestAccountSettings -import im.vector.riotx.features.settings.troubleshoot.TestBingRulesSettings +import im.vector.riotx.features.settings.troubleshoot.TestPushRulesSettings import im.vector.riotx.features.settings.troubleshoot.TestDeviceSettings import im.vector.riotx.features.settings.troubleshoot.TestSystemSettings import javax.inject.Inject @@ -28,7 +28,7 @@ import javax.inject.Inject class NotificationTroubleshootTestManagerFactory @Inject constructor(private val testSystemSettings: TestSystemSettings, private val testAccountSettings: TestAccountSettings, private val testDeviceSettings: TestDeviceSettings, - private val testBingRulesSettings: TestBingRulesSettings, + private val testPushRulesSettings: TestPushRulesSettings, private val testAutoStartBoot: TestAutoStartBoot, private val testBackgroundRestrictions: TestBackgroundRestrictions) { @@ -37,7 +37,7 @@ class NotificationTroubleshootTestManagerFactory @Inject constructor(private val mgr.addTest(testSystemSettings) mgr.addTest(testAccountSettings) mgr.addTest(testDeviceSettings) - mgr.addTest(testBingRulesSettings) + mgr.addTest(testPushRulesSettings) mgr.addTest(testAutoStartBoot) mgr.addTest(testBackgroundRestrictions) return mgr diff --git a/vector/src/main/java/im/vector/riotx/core/preference/BingRulePreference.kt b/vector/src/main/java/im/vector/riotx/core/preference/PushRulePreference.kt similarity index 98% rename from vector/src/main/java/im/vector/riotx/core/preference/BingRulePreference.kt rename to vector/src/main/java/im/vector/riotx/core/preference/PushRulePreference.kt index 1f074261a4..16dd1bb486 100755 --- a/vector/src/main/java/im/vector/riotx/core/preference/BingRulePreference.kt +++ b/vector/src/main/java/im/vector/riotx/core/preference/PushRulePreference.kt @@ -27,7 +27,7 @@ import im.vector.matrix.android.api.pushrules.rest.PushRule import im.vector.matrix.android.api.pushrules.rest.PushRuleAndKind import im.vector.riotx.R -class BingRulePreference : VectorPreference { +class PushRulePreference : VectorPreference { /** * @return the selected push rule and its kind @@ -42,7 +42,7 @@ class BingRulePreference : VectorPreference { constructor(context: Context, attrs: AttributeSet, defStyle: Int) : super(context, attrs, defStyle) init { - layoutResource = R.layout.vector_preference_bing_rule + layoutResource = R.layout.vector_preference_push_rule } /** diff --git a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsAdvancedNotificationPreferenceFragment.kt b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsAdvancedNotificationPreferenceFragment.kt index 772e9df3d3..5fa822ea92 100644 --- a/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsAdvancedNotificationPreferenceFragment.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/VectorSettingsAdvancedNotificationPreferenceFragment.kt @@ -25,7 +25,7 @@ import im.vector.matrix.android.api.MatrixCallback import im.vector.matrix.android.api.pushrules.rest.PushRule import im.vector.matrix.android.api.pushrules.rest.PushRuleAndKind import im.vector.riotx.R -import im.vector.riotx.core.preference.BingRulePreference +import im.vector.riotx.core.preference.PushRulePreference import im.vector.riotx.core.preference.VectorPreference import im.vector.riotx.core.utils.toast import im.vector.riotx.features.notifications.NotificationUtils @@ -92,7 +92,7 @@ class VectorSettingsAdvancedNotificationPreferenceFragment @Inject constructor( for (preferenceKey in prefKeyToPushRuleId.keys) { val preference = findPreference(preferenceKey) - if (preference is BingRulePreference) { + if (preference is PushRulePreference) { // preference.isEnabled = null != rules && isConnected && pushManager.areDeviceNotificationsAllowed() val ruleAndKind: PushRuleAndKind? = session.getPushRules().findDefaultRule(prefKeyToPushRuleId[preferenceKey]) diff --git a/vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestBingRulesSettings.kt b/vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestPushRulesSettings.kt similarity index 98% rename from vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestBingRulesSettings.kt rename to vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestPushRulesSettings.kt index 52c1ceb07c..bbdf8fa62c 100644 --- a/vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestBingRulesSettings.kt +++ b/vector/src/main/java/im/vector/riotx/features/settings/troubleshoot/TestPushRulesSettings.kt @@ -23,7 +23,7 @@ import im.vector.riotx.core.resources.StringProvider import im.vector.riotx.features.notifications.toNotificationAction import javax.inject.Inject -class TestBingRulesSettings @Inject constructor(private val activeSessionHolder: ActiveSessionHolder, +class TestPushRulesSettings @Inject constructor(private val activeSessionHolder: ActiveSessionHolder, private val stringProvider: StringProvider) : TroubleshootTest(R.string.settings_troubleshoot_test_bing_settings_title) { diff --git a/vector/src/main/res/layout/vector_preference_bing_rule.xml b/vector/src/main/res/layout/vector_preference_push_rule.xml similarity index 100% rename from vector/src/main/res/layout/vector_preference_bing_rule.xml rename to vector/src/main/res/layout/vector_preference_push_rule.xml diff --git a/vector/src/main/res/xml/vector_settings_notification_advanced_preferences.xml b/vector/src/main/res/xml/vector_settings_notification_advanced_preferences.xml index d5768235f1..a58a2d8f19 100644 --- a/vector/src/main/res/xml/vector_settings_notification_advanced_preferences.xml +++ b/vector/src/main/res/xml/vector_settings_notification_advanced_preferences.xml @@ -5,59 +5,59 @@ android:key="SETTINGS_NOTIFICATION_LEVEL" android:title="@string/settings_notification_by_event"> - - - - - - - - - - -