Search in sources :

Example 6 with Tab

use of org.wikipedia.page.tabs.Tab in project apps-android-wikipedia by wikimedia.

the class PageFragment method setCurrentTab.

private void setCurrentTab(int position, boolean updatePrevBackStackItem) {
    // (but only if it's a different tab than the one currently in view!
    if (position < tabList.size() - 1) {
        Tab tab = tabList.remove(position);
        tabList.add(tab);
        tabsProvider.invalidate();
        if (updatePrevBackStackItem) {
            pageFragmentLoadState.updateCurrentBackStackItem();
        }
        pageFragmentLoadState.setBackStack(tab.getBackStack());
        pageFragmentLoadState.loadFromBackStack();
    }
}
Also used : PageActionTab(org.wikipedia.page.action.PageActionTab) Tab(org.wikipedia.page.tabs.Tab)

Aggregations

Tab (org.wikipedia.page.tabs.Tab)6 PageBackStackItem (org.wikipedia.page.PageBackStackItem)4 Date (java.util.Date)3 Test (org.junit.Test)3 HistoryEntry (org.wikipedia.history.HistoryEntry)3 PageTitle (org.wikipedia.page.PageTitle)3 WikiSite (org.wikipedia.dataclient.WikiSite)2 PageActionTab (org.wikipedia.page.action.PageActionTab)2 NonNull (android.support.annotation.NonNull)1 RemoteLogException (org.wikipedia.crash.RemoteLogException)1