From ad3d303405bc2c3601829225b51849d8284daa64 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Wed, 26 Jun 2019 17:37:03 +0200 Subject: [PATCH] Fix issue in notification preference --- .../features/settings/PreferencesManager.java | 2 - .../VectorSettingsNotificationFragment.kt | 31 +------------ .../res/xml/vector_settings_notifications.xml | 45 ++----------------- 3 files changed, 5 insertions(+), 73 deletions(-) diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java b/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java index cf559797..c3942fac 100755 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/PreferencesManager.java @@ -51,8 +51,6 @@ public class PreferencesManager { public static final String SETTINGS_APP_TERM_CONDITIONS_PREFERENCE_KEY = "SETTINGS_APP_TERM_CONDITIONS_PREFERENCE_KEY"; public static final String SETTINGS_PRIVACY_POLICY_PREFERENCE_KEY = "SETTINGS_PRIVACY_POLICY_PREFERENCE_KEY"; - //TODO delete - public static final String SETTINGS_NOTIFICATION_PRIVACY_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_PRIVACY_PREFERENCE_KEY"; public static final String SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_TROUBLESHOOT_PREFERENCE_KEY"; public static final String SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY = "SETTINGS_NOTIFICATION_ADVANCED_PREFERENCE_KEY"; public static final String SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY = "SETTINGS_THIRD_PARTY_NOTICES_PREFERENCE_KEY"; diff --git a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt index e7ed9ee3..51b4aadc 100644 --- a/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt +++ b/vector/src/main/java/im/vector/riotredesign/features/settings/VectorSettingsNotificationFragment.kt @@ -59,19 +59,8 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment( private val notificationsSettingsCategory by lazy { findPreference(PreferencesManager.SETTINGS_NOTIFICATIONS_KEY) as PreferenceCategory } - private val mNotificationPrivacyPreference by lazy { - findPreference(PreferencesManager.SETTINGS_NOTIFICATION_PRIVACY_PREFERENCE_KEY) - } override fun bindPref() { - // Notification privacy - mNotificationPrivacyPreference.onPreferenceClickListener = Preference.OnPreferenceClickListener { - notImplemented() - // TODO startActivity(NotificationPrivacyActivity.getIntent(activity)) - true - } - refreshNotificationPrivacy() - for (preferenceKey in mPrefKeyToBingRuleId.keys) { val preference = findPreference(preferenceKey) @@ -81,7 +70,7 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment( // on some old android APIs, // the callback is called even if there is no user interaction // so the value will be checked to ensure there is really no update. - onPushRuleClick(preference.key, newValueAsVoid as Boolean) + // TODO onPushRuleClick(preference.key, newValueAsVoid as Boolean) true } } @@ -242,24 +231,6 @@ class VectorSettingsNotificationPreferenceFragment : VectorSettingsBaseFragment( */ } - /** - * Refresh the notification privacy setting - */ - private fun refreshNotificationPrivacy() { - /* TODO - val pushManager = Matrix.getInstance(activity).pushManager - - // this setting apply only with FCM for the moment - if (pushManager.useFcm()) { - val notificationPrivacyString = NotificationPrivacyActivity.getNotificationPrivacyString(activity, - pushManager.notificationPrivacy) - mNotificationPrivacyPreference.summary = notificationPrivacyString - } else { - notificationsSettingsCategory.removePreference(mNotificationPrivacyPreference) - } - */ - } - /** * Refresh the background sync preference */ diff --git a/vector/src/main/res/xml/vector_settings_notifications.xml b/vector/src/main/res/xml/vector_settings_notifications.xml index 27b8a1e1..04af29e4 100644 --- a/vector/src/main/res/xml/vector_settings_notifications.xml +++ b/vector/src/main/res/xml/vector_settings_notifications.xml @@ -2,51 +2,17 @@ - - - - - - - - - - - - - - - - - - - - - - @@ -56,17 +22,14 @@ android:key="SETTINGS_TURN_SCREEN_ON_PREFERENCE_KEY" android:title="@string/settings_turn_screen_on" /> - -