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:
parent
95bc75b2bf
commit
3d8d0f2726
1 changed files with 4 additions and 0 deletions
|
|
@ -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());
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue