Always hide single-tab pager

Right now the pager does not remain hidden after restarting phonograph.

Hiding the tabs when setting up the view pager makes the change to persist between runs.
This commit is contained in:
undu 2018-01-07 19:08:34 +00:00 committed by GitHub
commit 3d8d0f2726
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -133,6 +133,10 @@ public class LibraryFragment extends AbsMainActivityFragment implements CabHolde
tabs.setTabTextColors(normalColor, selectedColor);
tabs.setSelectedTabIndicatorColor(ThemeStore.accentColor(getActivity()));
// hide the tab bar with single tab
tabs.setVisibility(pagerAdapter.getCount() == 1 ? View.GONE : View.VISIBLE);
if (PreferenceUtil.getInstance(getContext()).rememberLastTab()) {
pager.setCurrentItem(PreferenceUtil.getInstance(getContext()).getLastPage());
}