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 33073bab4f5b..b0da91659936 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
@@ -97,6 +97,9 @@ public class AppSettingsFragment extends PreferenceFragment
private WPSwitchPreference mStripImageLocation;
private WPSwitchPreference mReportCrashPref;
private WPSwitchPreference mOpenWebLinksWithJetpack;
+ @Nullable private PreferenceScreen mExperimentalFeaturesSettings;
+ @Nullable private WPSwitchPreference mExperimentalBlockEditorPref;
+ @Nullable private WPSwitchPreference mExperimentalBlockEditorStylesPref;
private Preference mWhatsNew;
@@ -177,12 +180,18 @@ public boolean onPreferenceChange(Preference preference, Object newValue) {
.getPrefAndSetChangeListener(this, R.string.pref_key_site_video_encoder_bitrate, this);
mPrivacySettings = (PreferenceScreen) WPPrefUtils
.getPrefAndSetClickListener(this, R.string.pref_key_privacy_settings, this);
+ mExperimentalFeaturesSettings = (PreferenceScreen) WPPrefUtils
+ .getPrefAndSetClickListener(this, R.string.pref_key_experimental_features_settings, this);
mStripImageLocation =
(WPSwitchPreference) WPPrefUtils
.getPrefAndSetChangeListener(this, R.string.pref_key_strip_image_location, this);
mReportCrashPref = (WPSwitchPreference) WPPrefUtils
.getPrefAndSetChangeListener(this, R.string.pref_key_send_crash, 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
@@ -260,6 +269,7 @@ public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container,
@Override public void onViewStateRestored(Bundle savedInstanceState) {
super.onViewStateRestored(savedInstanceState);
addPrivacyToolbar();
+ addExperimentalFeaturesToolbar();
}
private void addJetpackBadgeAsFooterIfEnabled(LayoutInflater inflater, ListView listView) {
@@ -405,6 +415,8 @@ public boolean onPreferenceClick(Preference preference) {
return handleDevicePreferenceClick();
} else if (preference == mPrivacySettings) {
return handlePrivacyClick();
+ } else if (preference == mExperimentalFeaturesSettings) {
+ return handleExperimentalFeaturesClick();
} else if (preference == mWhatsNew) {
return handleFeatureAnnouncementClick();
} else if (preference == mLanguagePreference) {
@@ -473,6 +485,12 @@ 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 == mExperimentalBlockEditorPref) {
+ AnalyticsTracker.track(Stat.EXPERIMENTAL_BLOCK_EDITOR_TOGGLED, Collections
+ .singletonMap(TRACK_ENABLED, newValue));
+ } 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);
}
@@ -617,6 +635,32 @@ private boolean addPrivacyToolbar() {
return true;
}
+ private boolean handleExperimentalFeaturesClick() {
+ AnalyticsTracker.track(Stat.APP_SETTINGS_EXPERIMENTAL_FEATURES_TAPPED);
+
+ boolean isToolbarAdded = addExperimentalFeaturesToolbar();
+
+ if (!isToolbarAdded) {
+ return false;
+ }
+
+ AnalyticsTracker.track(Stat.EXPERIMENTAL_FEATURES_SETTINGS_OPENED);
+ return true;
+ }
+
+ private boolean addExperimentalFeaturesToolbar() {
+ if (mExperimentalFeaturesSettings == null || !isAdded()) {
+ return false;
+ }
+
+ String title = getString(R.string.preference_experimental_features_settings);
+ Dialog dialog = mExperimentalFeaturesSettings.getDialog();
+ if (dialog != null) {
+ WPActivityUtils.addToolbarToDialog(this, dialog, title);
+ }
+ return true;
+ }
+
private boolean handleFeatureAnnouncementClick() {
if (getActivity() instanceof AppCompatActivity) {
AnalyticsTracker.track(Stat.FEATURE_ANNOUNCEMENT_SHOWN_FROM_APP_SETTINGS);
diff --git a/WordPress/src/main/res/values/key_strings.xml b/WordPress/src/main/res/values/key_strings.xml
index b9ba660c74b6..7c540dd5871b 100644
--- a/WordPress/src/main/res/values/key_strings.xml
+++ b/WordPress/src/main/res/values/key_strings.xml
@@ -12,6 +12,9 @@
wp_pref_privacy_settings
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
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 1299e8daa405..e89f49145bad 100644
--- a/WordPress/src/main/res/values/strings.xml
+++ b/WordPress/src/main/res/values/strings.xml
@@ -940,6 +940,9 @@
Privacy notice for California users
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 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 87c72b1fdfee..ce2acc568786 100644
--- a/WordPress/src/main/res/xml/app_settings.xml
+++ b/WordPress/src/main/res/xml/app_settings.xml
@@ -63,6 +63,23 @@
+
+
+
+
+
+
+
+
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 d8b4ceaa94c8..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
@@ -912,6 +912,7 @@ public enum Stat {
SETTINGS_DID_CHANGE,
APP_SETTINGS_APPEARANCE_CHANGED,
APP_SETTINGS_PRIVACY_SETTINGS_TAPPED,
+ APP_SETTINGS_EXPERIMENTAL_FEATURES_TAPPED,
APP_SETTINGS_OPEN_DEVICE_SETTINGS_TAPPED,
APP_SETTINGS_MAX_IMAGE_SIZE_CHANGED,
APP_SETTINGS_IMAGE_QUALITY_CHANGED,
@@ -921,6 +922,9 @@ public enum Stat {
APP_SETTINGS_VIDEO_QUALITY_CHANGED,
PRIVACY_SETTINGS_OPENED,
PRIVACY_SETTINGS_REPORT_CRASHES_TOGGLED,
+ EXPERIMENTAL_FEATURES_SETTINGS_OPENED,
+ 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,