From 8534443b95bb03758181b7c96014cb706d4f264d Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 17 Apr 2020 14:07:49 +0100 Subject: [PATCH 1/4] Set MySiteFragment title to be "My site", instead of using site title --- .../wordpress/android/ui/main/MySiteFragment.java | 14 ++++---------- .../wordpress/android/ui/main/WPMainActivity.java | 11 ++--------- 2 files changed, 6 insertions(+), 19 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/MySiteFragment.java b/WordPress/src/main/java/org/wordpress/android/ui/main/MySiteFragment.java index dee8eccccb0b..9daa65cd3723 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/MySiteFragment.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/MySiteFragment.java @@ -377,7 +377,7 @@ public View onCreateView(@NonNull LayoutInflater inflater, ViewGroup container, setupClickListeners(rootView); mToolbar = rootView.findViewById(R.id.toolbar_main); - mToolbar.setTitle(mToolbarTitle); + mToolbar.setTitle(R.string.my_site_section_screen_title); mToolbar.inflateMenu(R.menu.my_site_menu); @@ -955,9 +955,6 @@ private void refreshSelectedSiteDetails(SiteModel site) { } else { mQuickActionButtonsContainer.setWeightSum(75f); } - - // Refresh the title - setTitle(site.getName()); } private void toggleAdminVisibility(@Nullable final SiteModel site) { @@ -1009,12 +1006,9 @@ public void onStart() { @Override public void setTitle(@NonNull final String title) { - if (isAdded()) { - mToolbarTitle = (title.isEmpty()) ? getString(R.string.wordpress) : title; - - if (mToolbar != null) { - mToolbar.setTitle(mToolbarTitle); - } + mToolbarTitle = title; + if (mToolbar != null) { + mToolbar.setTitle(title); } } diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java index 8d28c59acee4..639233b1ac41 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java @@ -813,12 +813,8 @@ private void updateTitle() { } private void updateTitle(PageType pageType) { - if (pageType == PageType.MY_SITE && mSelectedSite != null) { - ((MainToolbarFragment) mBottomNav.getActiveFragment()).setTitle(mSelectedSite.getName()); - } else { - ((MainToolbarFragment) mBottomNav.getActiveFragment()) - .setTitle(mBottomNav.getTitleForPageType(pageType).toString()); - } + ((MainToolbarFragment) mBottomNav.getActiveFragment()) + .setTitle(mBottomNav.getTitleForPageType(pageType).toString()); } private void trackLastVisiblePage(PageType pageType, boolean trackAnalytics) { @@ -1192,8 +1188,6 @@ public void setSelectedSite(@Nullable SiteModel selectedSite) { // Make selected site visible selectedSite.setIsVisible(true); AppPrefs.setSelectedSite(selectedSite.getId()); - - updateTitle(); } /** @@ -1209,7 +1203,6 @@ public void initSelectedSite() { mSelectedSite = mSiteStore.getSiteByLocalId(siteLocalId); // If saved site exist, then return, else (site has been removed?) try to select another site if (mSelectedSite != null) { - updateTitle(); return; } } From 9efe89e8a6b2047aa25534027fb807e2f459964e Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 17 Apr 2020 14:19:21 +0100 Subject: [PATCH 2/4] Updated release notes --- RELEASE-NOTES.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/RELEASE-NOTES.txt b/RELEASE-NOTES.txt index b81beb3a7338..692943a5b082 100644 --- a/RELEASE-NOTES.txt +++ b/RELEASE-NOTES.txt @@ -7,6 +7,7 @@ * Block editor: Fix a bug which caused to show URL settings modal randomly when changing the device orientation multiple times during the time Starter Page Template Preview is open * Block editor: "Choose media from device" now opens our built-in media picker instead of the OS default media picker. * Added user Gravatar to the Me menu in My Site. +* Updated site details screen title to "My site", to avoid duplicating the title of the current site which is displayed in the screen's header area. 14.6 ----- From 50a69ce352a6f321076dbf213ed26e9493af6249 Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 17 Apr 2020 14:42:19 +0100 Subject: [PATCH 3/4] Remove unused `updateTitle()` method --- .../java/org/wordpress/android/ui/main/WPMainActivity.java | 4 ---- 1 file changed, 4 deletions(-) diff --git a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java index 639233b1ac41..0aa800ca7e5a 100644 --- a/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java +++ b/WordPress/src/main/java/org/wordpress/android/ui/main/WPMainActivity.java @@ -808,10 +808,6 @@ public void handleNewPostAction(PagePostCreationSourcesDetail source) { ActivityLauncher.addNewPostForResult(this, getSelectedSite(), false, source); } - private void updateTitle() { - updateTitle(mBottomNav.getCurrentSelectedPage()); - } - private void updateTitle(PageType pageType) { ((MainToolbarFragment) mBottomNav.getActiveFragment()) .setTitle(mBottomNav.getTitleForPageType(pageType).toString()); From 3888e64ab202602c7d0f4e2f107885deade533a0 Mon Sep 17 00:00:00 2001 From: James Frost Date: Fri, 17 Apr 2020 15:13:05 +0100 Subject: [PATCH 4/4] Removed unused string from resources --- WordPress/src/main/res/values/strings.xml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/WordPress/src/main/res/values/strings.xml b/WordPress/src/main/res/values/strings.xml index a5614d5facb3..0a0b9e1bc7cc 100644 --- a/WordPress/src/main/res/values/strings.xml +++ b/WordPress/src/main/res/values/strings.xml @@ -45,10 +45,7 @@ Pick site Edit Photo Notification detail %s - - - WordPress - + Posts Sites