Dbrant has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/226611

Change subject: Make new tabs appear behind the current tab.
......................................................................

Make new tabs appear behind the current tab.

Bug: T106707
Change-Id: I35ffd6647d4a2917b968ab244f28674e096a3b4b
---
M wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java
1 file changed, 8 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/apps/android/wikipedia 
refs/changes/11/226611/1

diff --git 
a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java 
b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java
index 2da638a..c14db07 100755
--- a/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java
+++ b/wikipedia/src/main/java/org/wikipedia/page/PageViewFragmentInternal.java
@@ -563,11 +563,15 @@
     private void openInNewTab(PageTitle title, HistoryEntry entry) {
         // create a new tab
         Tab tab = new Tab();
-        // make this tab current
-        tabList.add(tab);
-        pageLoadStrategy.setBackStack(tab.getBackStack());
+        // put this tab behind the current tab
+        if (tabList.size() > 0) {
+            tabList.add(tabList.size() - 1, tab);
+        } else {
+            tabList.add(tab);
+        }
+        // add the requested page to its backstack
+        tab.getBackStack().add(new PageBackStackItem(title, entry));
         // and... that should be it.
-        ((PageActivity) getActivity()).displayNewPage(title, entry);
         tabsProvider.showAndHideTabs();
     }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/226611
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I35ffd6647d4a2917b968ab244f28674e096a3b4b
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

Reply via email to