From 8d18621e15bb70412ecfa9a37e90d44f4fda1b2c Mon Sep 17 00:00:00 2001 From: David Calhoun Date: Wed, 13 Nov 2024 13:08:43 -0500 Subject: [PATCH] refactor: Rename keys and assignments Improve consistency with existing keys and the iOS implementation. --- .../android/ui/prefs/AppSettingsFragment.java | 22 +++++++++---------- WordPress/src/main/res/values/key_strings.xml | 4 ++-- WordPress/src/main/res/values/strings.xml | 4 ++-- WordPress/src/main/res/xml/app_settings.xml | 8 +++---- .../android/analytics/AnalyticsTracker.java | 4 ++-- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java index b50cac72db6f..6310c42ba5f8 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/prefs/AppSettingsFragment.java @@ -94,12 +94,12 @@ public class AppSettingsFragment extends PreferenceFragment private DetailListPreference mVideoWidthPref; private DetailListPreference mVideoEncorderBitratePref; private PreferenceScreen mPrivacySettings; - private PreferenceScreen mExperimentalFeaturesSettings; private WPSwitchPreference mStripImageLocation; private WPSwitchPreference mReportCrashPref; - private WPSwitchPreference mExperimentalEditorPref; - private WPSwitchPreference mExperimentalEditorStylesPref; private WPSwitchPreference mOpenWebLinksWithJetpack; + private PreferenceScreen mExperimentalFeaturesSettings; + private WPSwitchPreference mExperimentalBlockEditorPref; + private WPSwitchPreference mExperimentalBlockEditorStylesPref; private Preference mWhatsNew; @@ -188,10 +188,10 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { .getPrefAndSetChangeListener(this, R.string.pref_key_strip_image_location, this); mReportCrashPref = (WPSwitchPreference) WPPrefUtils .getPrefAndSetChangeListener(this, R.string.pref_key_send_crash, this); - mExperimentalEditorPref = (WPSwitchPreference) WPPrefUtils - .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_editor, this); - mExperimentalEditorStylesPref = (WPSwitchPreference) WPPrefUtils - .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_editor_styles, this); + mExperimentalBlockEditorPref = (WPSwitchPreference) WPPrefUtils + .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_block_editor, this); + mExperimentalBlockEditorStylesPref = (WPSwitchPreference) WPPrefUtils + .getPrefAndSetChangeListener(this, R.string.pref_key_experimental_block_editor_theme_styles, this); mOpenWebLinksWithJetpack = (WPSwitchPreference) WPPrefUtils @@ -485,11 +485,11 @@ public boolean onPreferenceChange(Preference preference, Object newValue) { } else if (preference == mReportCrashPref) { AnalyticsTracker.track(Stat.PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED, Collections .singletonMap(TRACK_ENABLED, newValue)); - } else if (preference == mExperimentalEditorPref) { - AnalyticsTracker.track(Stat.EXPERIMENTAL_EDITOR_TOGGLED, Collections + } else if (preference == mExperimentalBlockEditorPref) { + AnalyticsTracker.track(Stat.EXPERIMENTAL_BLOCK_EDITOR_TOGGLED, Collections .singletonMap(TRACK_ENABLED, newValue)); - } else if (preference == mExperimentalEditorStylesPref) { - AnalyticsTracker.track(Stat.EXPERIMENTAL_EDITOR_STYLES_TOGGLED, Collections + } else if (preference == mExperimentalBlockEditorStylesPref) { + AnalyticsTracker.track(Stat.EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES_TOGGLED, Collections .singletonMap(TRACK_ENABLED, newValue)); } else if (preference == mOpenWebLinksWithJetpack) { handleOpenLinksInJetpack((Boolean) newValue); diff --git a/WordPress/src/main/res/values/key_strings.xml b/WordPress/src/main/res/values/key_strings.xml index fbb7df0d00f9..7c540dd5871b 100644 --- a/WordPress/src/main/res/values/key_strings.xml +++ b/WordPress/src/main/res/values/key_strings.xml @@ -13,8 +13,8 @@ wp_pref_send_usage_stats wp_pref_send_crash_stats wp_pref_experimental_features_settings - MANUAL_FEATURE_CONFIGexperimental_block_editor - MANUAL_FEATURE_CONFIGexperimental_block_editor_theme_styles + MANUAL_FEATURE_CONFIGexperimental_block_editor + MANUAL_FEATURE_CONFIGexperimental_block_editor_theme_styles wp_pref_device_settings wp_pref_app_experimental_section wp_pref_language diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index ac97ef021e3e..397062d004df 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -941,8 +941,8 @@ The California Consumer Privacy Act ("CCPA") requires us to provide California residents with some additional information about the categories of personal information we collect and share, where we get that personal information, and how and why we use it. Read CCPA privacy notice Experimental features - Experimental editor - Experimental editor styles + Experimental block editor + Experimental block editor styles Remove location from media Appearance Light diff --git a/WordPress/src/main/res/xml/app_settings.xml b/WordPress/src/main/res/xml/app_settings.xml index f03a14673fed..ce2acc568786 100644 --- a/WordPress/src/main/res/xml/app_settings.xml +++ b/WordPress/src/main/res/xml/app_settings.xml @@ -70,13 +70,13 @@ + android:key="@string/pref_key_experimental_block_editor" + android:title="@string/preference_experimental_block_editor" /> + android:key="@string/pref_key_experimental_block_editor_theme_styles" + android:title="@string/preference_experimental_block_editor_theme_styles" /> diff --git a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java index 7fe3089d0c6b..46efebe88cf2 100644 --- a/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java +++ b/libs/analytics/src/main/java/org/wordpress/android/analytics/AnalyticsTracker.java @@ -923,8 +923,8 @@ public enum Stat { PRIVACY_SETTINGS_OPENED, PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED, EXPERIMENTAL_FEATURES_SETTINGS_OPENED, - EXPERIMENTAL_EDITOR_TOGGLED, - EXPERIMENTAL_EDITOR_STYLES_TOGGLED, + EXPERIMENTAL_BLOCK_EDITOR_TOGGLED, + EXPERIMENTAL_BLOCK_EDITOR_THEME_STYLES_TOGGLED, SHARING_BUTTONS_EDIT_SHARING_BUTTONS_CHANGED, SHARING_BUTTONS_EDIT_MORE_SHARING_BUTTONS_CHANGED, PEOPLE_MANAGEMENT_USER_INVITED,