Skip to content

Commit cffa2ef

Browse files
committed
Merge branch 'develop' of https://github.com/wordpress-mobile/WordPress-Android into feature/master-remote-previews
2 parents 94ef5ca + 865d69d commit cffa2ef

File tree

29 files changed

+250
-112
lines changed

29 files changed

+250
-112
lines changed

WordPress/build.gradle

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ android {
4949

5050
defaultConfig {
5151
applicationId "org.wordpress.android"
52-
versionName "alpha-183"
53-
versionCode 762
52+
versionName "alpha-185"
53+
versionCode 766
5454
minSdkVersion 21
5555
targetSdkVersion 28
5656

@@ -74,8 +74,8 @@ android {
7474
productFlavors {
7575
vanilla { // used for release and beta
7676
dimension "buildType"
77-
versionName "13.0-rc-1"
78-
versionCode 761
77+
versionName "13.0-rc-3"
78+
versionCode 765
7979
}
8080

8181
zalpha { // alpha version - enable experimental features

WordPress/metadata/PlayStoreStrings.po

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,23 @@ msgstr ""
1010
"X-Generator: VsCode\n"
1111
"Project-Id-Version: Release Notes & Play Store Descriptions\n"
1212

13+
#. translators: Release notes for this version to be displayed in the Play Store. Limit to 500 characters including spaces and commas!
14+
msgctxt "release_note_130"
15+
msgid ""
16+
"13.0:\n"
17+
"* Block editor improvements: the editor is auto-enabled when you open a block post (unless you opted out in v12.9), or you can enable it on a per-site basis.\n"
18+
"* Accessibility improvements: screen readers can now read more of the stats screen.\n"
19+
"* General usability improvements: logging in is speedier, colors are more consistent across screens, and bug fixes put an end to some crashes.\n"
20+
msgstr ""
21+
1322
#. translators: Release notes for this version to be displayed in the Play Store. Limit to 500 characters including spaces and commas!
1423
msgctxt "release_note_129"
1524
msgid ""
1625
"12.9:\n"
1726
"* Customers with unclaimed domain credits can register domains in the app.\n"
1827
"* You can expand the Comment Editor to Full Screen for more space while editing.\n"
1928
"* The Block editor has a few improvements: Video blocks are available, and a some issues that led to content loss when using unsupported blocks have been resolved.\n"
29+
"* The block editor is now the default for new posts after you open a block-based post for the first time.\n"
2030
msgstr ""
2131

2232
msgctxt "release_note_128"
Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
* Fixes a crash that could happen when viewing help from the login screen
2-
* Allow setting which editor to use on a per-site basis
3-
* Improves accessibility in stats
4-
* Makes it easier to log in by validating the URL to your site more quickly.
5-
* Some minor tweaks to the colour scheme
1+
* Block editor improvements: the editor is auto-enabled when you open a block post (unless you opted out in v12.9), or you can enable it on a per-site basis.
2+
* Accessibility improvements: screen readers can now read more of the stats screen.
3+
* General usability improvements: logging in is speedier, colors are more consistent across screens, and bug fixes put an end to some crashes.

WordPress/src/main/java/org/wordpress/android/WordPress.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ public void onAppComesFromBackground() {
880880
sDeleteExpiredStats.runIfNotLimited();
881881

882882
// Let's migrate the old editor preference if available in AppPrefs to the remote backend
883-
SiteUtils.migrateAppWideMobileEditorPreferenceToRemote(mContext, mDispatcher, mSiteStore);
883+
SiteUtils.migrateAppWideMobileEditorPreferenceToRemote(mContext, mDispatcher);
884884

885885
if (mFirstActivityResumed) {
886886
deferredInit();

WordPress/src/main/java/org/wordpress/android/ui/FullScreenDialogFragment.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@ private void initToolbar(View view) {
258258
mToolbar.setSubtitleTextAppearance(view.getContext(), R.style.Toolbar_Subtitle);
259259
mToolbar.setBackgroundColor(getResources().getColor(mToolbarColor));
260260
mToolbar.setNavigationIcon(ContextCompat.getDrawable(view.getContext(), R.drawable.ic_close_white_24dp));
261+
mToolbar.setNavigationContentDescription(R.string.close_dialog_button_desc);
261262
mToolbar.setNavigationOnClickListener(new View.OnClickListener() {
262263
@Override
263264
public void onClick(View view) {

WordPress/src/main/java/org/wordpress/android/ui/main/SitePickerActivity.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ protected void onActivityResult(int requestCode, int resultCode, Intent data) {
227227
case RequestCodes.CREATE_SITE:
228228
if (data != null) {
229229
int newSiteLocalID = data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1);
230-
SiteUtils.enableBlockEditor(mDispatcher, mSiteStore, newSiteLocalID);
230+
SiteUtils.enableBlockEditorOnSiteCreation(mDispatcher, mSiteStore, newSiteLocalID);
231231
// Mark the site to show the GB popup at first editor run
232232
SiteModel newSiteModel = mSiteStore.getSiteByLocalId(newSiteLocalID);
233233
if (newSiteModel != null) {

WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
import org.wordpress.android.fluxc.store.QuickStartStore.QuickStartTask;
5050
import org.wordpress.android.fluxc.store.SiteStore;
5151
import org.wordpress.android.fluxc.store.SiteStore.CompleteQuickStartPayload;
52+
import org.wordpress.android.fluxc.store.SiteStore.OnAllSitesMobileEditorChanged;
5253
import org.wordpress.android.fluxc.store.SiteStore.OnQuickStartCompleted;
5354
import org.wordpress.android.fluxc.store.SiteStore.OnSiteChanged;
5455
import org.wordpress.android.fluxc.store.SiteStore.OnSiteEditorsChanged;
@@ -775,7 +776,7 @@ public void onClick(View v) {
775776
// Enable the block editor on sites created on mobile
776777
if (data != null) {
777778
int newSiteLocalID = data.getIntExtra(SitePickerActivity.KEY_LOCAL_ID, -1);
778-
SiteUtils.enableBlockEditor(mDispatcher, mSiteStore, newSiteLocalID);
779+
SiteUtils.enableBlockEditorOnSiteCreation(mDispatcher, mSiteStore, newSiteLocalID);
779780
// Mark the site to show the GB popup at first editor run
780781
SiteModel newSiteModel = mSiteStore.getSiteByLocalId(newSiteLocalID);
781782
if (newSiteModel != null) {
@@ -1157,6 +1158,26 @@ public void onSiteEditorsChanged(OnSiteEditorsChanged event) {
11571158
return;
11581159
}
11591160

1161+
refreshCurrentSelectedSiteAfterEditorChanges(false, event.site.getId());
1162+
}
1163+
1164+
@SuppressWarnings("unused")
1165+
@Subscribe(threadMode = ThreadMode.MAIN)
1166+
public void onAllSitesMobileEditorChanged(OnAllSitesMobileEditorChanged event) {
1167+
if (event.isError()) {
1168+
return;
1169+
}
1170+
if (event.isNetworkResponse) {
1171+
// We can remove the global app setting now, since we're sure the migration ended with success.
1172+
AppPrefs.removeAppWideEditorPreference();
1173+
}
1174+
refreshCurrentSelectedSiteAfterEditorChanges(true, -1);
1175+
}
1176+
1177+
private void refreshCurrentSelectedSiteAfterEditorChanges(boolean alwaysRefreshUI, int localSiteID) {
1178+
// Need to update the user property about GB enabled on any of the sites
1179+
AnalyticsUtils.refreshMetadata(mAccountStore, mSiteStore);
1180+
11601181
// "Reload" selected site from the db
11611182
// It would be better if the OnSiteChanged provided the list of changed sites.
11621183
if (getSelectedSite() == null && mSiteStore.hasSite()) {
@@ -1166,6 +1187,15 @@ public void onSiteEditorsChanged(OnSiteEditorsChanged event) {
11661187
return;
11671188
}
11681189

1190+
// When alwaysRefreshUI is `true` we need to refresh the UI regardless of the current site
1191+
if (!alwaysRefreshUI) {
1192+
// we need to refresh the UI only when the site IDs matches
1193+
if (getSelectedSite().getId() != localSiteID) {
1194+
// No need to refresh the UI, since the current selected site is another site
1195+
return;
1196+
}
1197+
}
1198+
11691199
SiteModel site = mSiteStore.getSiteByLocalId(getSelectedSite().getId());
11701200
if (site != null) {
11711201
mSelectedSite = site;

WordPress/src/main/java/org/wordpress/android/ui/plans/PlansListAdapter.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import android.app.Activity
44
import android.text.TextUtils
55
import android.view.LayoutInflater
66
import android.view.ViewGroup
7+
import android.view.accessibility.AccessibilityNodeInfo
78
import android.widget.ImageView
89
import android.widget.TextView
910
import androidx.recyclerview.widget.RecyclerView
@@ -62,7 +63,12 @@ class PlansListAdapter(
6263
private val subtitle: TextView = itemView.findViewById(R.id.plan_subtitle)
6364

6465
fun bind(planOffersModel: PlanOffersModel) {
65-
itemView.setOnClickListener { itemClickListener(planOffersModel) }
66+
itemView.setOnClickListener {
67+
itemView.performAccessibilityAction(
68+
AccessibilityNodeInfo.ACTION_CLEAR_ACCESSIBILITY_FOCUS, null
69+
)
70+
itemClickListener(planOffersModel)
71+
}
6672
title.text = planOffersModel.name
6773
subtitle.text = planOffersModel.tagline
6874

WordPress/src/main/java/org/wordpress/android/ui/posts/EditPostActivity.java

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@
165165
import org.wordpress.android.util.WPPermissionUtils;
166166
import org.wordpress.android.util.WPUrlUtils;
167167
import org.wordpress.android.util.analytics.AnalyticsUtils;
168+
import org.wordpress.android.util.analytics.AnalyticsUtils.BlockEditorEnabledSource;
168169
import org.wordpress.android.util.helpers.MediaFile;
169170
import org.wordpress.android.util.helpers.MediaGallery;
170171
import org.wordpress.android.util.helpers.MediaGalleryImageSpan;
@@ -1702,10 +1703,16 @@ private void showGutenbergInformativeDialog() {
17021703
}
17031704

17041705
private void setGutenbergEnabledIfNeeded() {
1705-
if ((TextUtils.isEmpty(mSite.getMobileEditor()) && !mIsNewPost)
1706-
|| AppPrefs.shouldShowGutenbergInfoPopup(mSite.getUrl())) {
1706+
boolean showPopup = AppPrefs.shouldShowGutenbergInfoPopup(mSite.getUrl());
1707+
1708+
if (TextUtils.isEmpty(mSite.getMobileEditor()) && !mIsNewPost) {
17071709
SiteUtils.enableBlockEditor(mDispatcher, mSite);
1708-
AnalyticsUtils.trackWithSiteDetails(Stat.EDITOR_GUTENBERG_ENABLED, mSite);
1710+
AnalyticsUtils.trackWithSiteDetails(Stat.EDITOR_GUTENBERG_ENABLED, mSite,
1711+
BlockEditorEnabledSource.ON_BLOCK_POST_OPENING.asPropertyMap());
1712+
showPopup = true;
1713+
}
1714+
1715+
if (showPopup) {
17091716
showGutenbergInformativeDialog();
17101717
}
17111718
}

WordPress/src/main/java/org/wordpress/android/ui/prefs/AppPrefs.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -648,6 +648,10 @@ public static boolean isGutenbergEditorEnabled() {
648648
return true;
649649
}
650650

651+
/**
652+
* @deprecated As of release 13.0, replaced by SiteSettings mobile editor value
653+
*/
654+
@Deprecated
651655
public static boolean isGutenbergDefaultForNewPosts() {
652656
return getBoolean(DeletablePrefKey.GUTENBERG_DEFAULT_FOR_NEW_POSTS, false);
653657
}

0 commit comments

Comments
 (0)