Moved some code to its right place
This commit is contained in:
parent
7d4b34e7b8
commit
193f716029
2 changed files with 4 additions and 4 deletions
|
|
@ -41,6 +41,10 @@ public class PagerAdapter extends FragmentPagerAdapter {
|
|||
context.getResources().getString(R.string.artists),
|
||||
context.getResources().getString(R.string.playlists)
|
||||
};
|
||||
final MusicFragments[] fragments = MusicFragments.values();
|
||||
for (final PagerAdapter.MusicFragments fragment : fragments) {
|
||||
add(fragment.getFragmentClass(), null);
|
||||
}
|
||||
}
|
||||
|
||||
@SuppressWarnings("synthetic-access")
|
||||
|
|
|
|||
|
|
@ -127,10 +127,6 @@ public class MainActivity extends AbsSlidingMusicPanelActivity
|
|||
|
||||
private void setUpViewPager() {
|
||||
pagerAdapter = new PagerAdapter(this, getSupportFragmentManager());
|
||||
final PagerAdapter.MusicFragments[] fragments = PagerAdapter.MusicFragments.values();
|
||||
for (final PagerAdapter.MusicFragments fragment : fragments) {
|
||||
pagerAdapter.add(fragment.getFragmentClass(), null);
|
||||
}
|
||||
pager.setAdapter(pagerAdapter);
|
||||
pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue