Skip to content

Commit

Permalink
refactor: Rename keys and assignments
Browse files Browse the repository at this point in the history
Improve consistency with existing keys and the iOS implementation.
  • Loading branch information
dcalhoun committed Nov 13, 2024
1 parent 850c2d1 commit 8d18621
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Check notice

Code scanning / Android Lint

Nullable/NonNull annotation missing on field Note

Missing null annotation
private WPSwitchPreference mExperimentalBlockEditorPref;

Check notice

Code scanning / Android Lint

Nullable/NonNull annotation missing on field Note

Missing null annotation
private WPSwitchPreference mExperimentalBlockEditorStylesPref;

Check notice

Code scanning / Android Lint

Nullable/NonNull annotation missing on field Note

Missing null annotation

private Preference mWhatsNew;

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions WordPress/src/main/res/values/key_strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
<string name="pref_key_send_usage" translatable="false">wp_pref_send_usage_stats</string>
<string name="pref_key_send_crash" translatable="false">wp_pref_send_crash_stats</string>
<string name="pref_key_experimental_features_settings" translatable="false">wp_pref_experimental_features_settings</string>
<string name="pref_key_experimental_editor" translatable="false">MANUAL_FEATURE_CONFIGexperimental_block_editor</string>
<string name="pref_key_experimental_editor_styles" translatable="false">MANUAL_FEATURE_CONFIGexperimental_block_editor_theme_styles</string>
<string name="pref_key_experimental_block_editor" translatable="false">MANUAL_FEATURE_CONFIGexperimental_block_editor</string>
<string name="pref_key_experimental_block_editor_theme_styles" translatable="false">MANUAL_FEATURE_CONFIGexperimental_block_editor_theme_styles</string>
<string name="pref_key_device_settings" translatable="false">wp_pref_device_settings</string>
<string name="pref_key_experimental_section" translatable="false">wp_pref_app_experimental_section</string>
<string name="pref_key_language" translatable="false">wp_pref_language</string>
Expand Down
4 changes: 2 additions & 2 deletions WordPress/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -941,8 +941,8 @@
<string name="ccpa_privacy_notice_caption">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.</string>
<string name="ccpa_privacy_notice_read">Read CCPA privacy notice</string>
<string name="preference_experimental_features_settings">Experimental features</string>
<string name="preference_experimental_editor">Experimental editor</string>
<string name="preference_experimental_editor_styles">Experimental editor styles</string>
<string name="preference_experimental_block_editor">Experimental block editor</string>
<string name="preference_experimental_block_editor_theme_styles">Experimental block editor styles</string>
<string name="preference_strip_image_location">Remove location from media</string>
<string name="app_theme">Appearance</string>
<string name="app_theme_light">Light</string>
Expand Down
8 changes: 4 additions & 4 deletions WordPress/src/main/res/xml/app_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@

<org.wordpress.android.ui.prefs.WPSwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_experimental_editor"
android:title="@string/preference_experimental_editor" />
android:key="@string/pref_key_experimental_block_editor"
android:title="@string/preference_experimental_block_editor" />

<org.wordpress.android.ui.prefs.WPSwitchPreference
android:defaultValue="false"
android:key="@string/pref_key_experimental_editor_styles"
android:title="@string/preference_experimental_editor_styles" />
android:key="@string/pref_key_experimental_block_editor_theme_styles"
android:title="@string/preference_experimental_block_editor_theme_styles" />

</PreferenceScreen>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 8d18621

Please sign in to comment.