Dbrant has uploaded a new change for review.
https://gerrit.wikimedia.org/r/312839
Change subject: TEST (DO NOT MERGE): Always open pages from Intent in a new
foreground tab.
......................................................................
TEST (DO NOT MERGE): Always open pages from Intent in a new foreground tab.
Some users, as well as our own dogfooding, have expressed some confusion
around the behavior of the hardware Back button when reading articles.
(There does *not* appear to be confusion about the behavior of the
Home-as-up button, i.e. it is agreed that this button should always take
the user back to MainActivity, regardless of how many pages are in the
backstack of the current tab.)
The confusion seems to stem from the following:
When a user opens a page from within MainActivity (from the feed, History,
etc), it causes PageActivity to open, and load the requested page into the
*current tab* that may have been previously open. This causes some
unexpected behavior: if the user presses the hardware Back button,
PageActivity will go backwards in the backstack of pages that had already
existed in the current tab. This is contrary to the intuition that the
Back button should simply close the current page and go back to
MainActivity from where we launched it.
One proposed idea to alleviate the confusion is to always load pages in a
new tab (that is, pages that are loaded from an Intent that causes
PageActivity to start). Here are the benefits to this approach:
- This introduces better "navigational consistency", meaning that every
launch of PageActivity will now be a proper self-contained browsing
"session".
- The user will still be able to navigate to links and build a backstack
in the current tab, but the number of Back presses to return to the
parent Activity will now make intuitive sense, since the newly-opened
page will not be pushed onto the existing backstack of the current tab.
- Notice that when the app is launched from an external Intent (e.g. from
a deeplink) we do already open the requested page in a new tab,
precisely for the purpose of maintaining consistent Back behavior. We
should simply treat "internal" Intents coming from MainActivity the same
way we treat external intents.
This patch prototypes this behavior. Please take it for a spin and see how it
feels.
Change-Id: I861b2822942f28c95ac0c3d3fb6f56ed18a8fd00
---
M app/src/main/java/org/wikipedia/page/PageActivity.java
1 file changed, 1 insertion(+), 5 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia
refs/changes/39/312839/1
diff --git a/app/src/main/java/org/wikipedia/page/PageActivity.java
b/app/src/main/java/org/wikipedia/page/PageActivity.java
index ddc3c7c..da32e1e 100644
--- a/app/src/main/java/org/wikipedia/page/PageActivity.java
+++ b/app/src/main/java/org/wikipedia/page/PageActivity.java
@@ -278,11 +278,7 @@
} else if (ACTION_PAGE_FOR_TITLE.equals(intent.getAction())) {
PageTitle title = intent.getParcelableExtra(EXTRA_PAGETITLE);
HistoryEntry historyEntry =
intent.getParcelableExtra(EXTRA_HISTORYENTRY);
- if (intent.getBooleanExtra(EXTRA_NEWTAB, false)) {
- loadPage(title, historyEntry, TabPosition.NEW_TAB_BACKGROUND);
- } else {
- loadPage(title, historyEntry);
- }
+ loadPageInForegroundTab(title, historyEntry);
} else if (ACTION_SHOW_TAB_LIST.equals(intent.getAction())) {
showTabList();
} else if (ACTION_RESUME_READING.equals(intent.getAction())) {
--
To view, visit https://gerrit.wikimedia.org/r/312839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I861b2822942f28c95ac0c3d3fb6f56ed18a8fd00
Gerrit-PatchSet: 1
Gerrit-Project: apps/android/wikipedia
Gerrit-Branch: master
Gerrit-Owner: Dbrant <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits