Search in sources :

Example 1 with MultiViewPager

use of com.naman14.timber.widgets.MultiViewPager in project Timber by naman14.

the class ArtistBioFragment method onCreateView.

@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
    View rootView = inflater.inflate(R.layout.fragment_artist_bio, container, false);
    Artist artist = ArtistLoader.getArtist(getActivity(), artistID);
    LastFmClient.getInstance(getActivity()).getArtistInfo(new ArtistQuery(artist.name), new ArtistInfoListener() {

        @Override
        public void artistInfoSucess(LastfmArtist artist) {
        }

        @Override
        public void artistInfoFailed() {
        }
    });
    final MultiViewPager pager = (MultiViewPager) rootView.findViewById(R.id.tagspager);
    final FragmentStatePagerAdapter adapter = new FragmentStatePagerAdapter(getActivity().getSupportFragmentManager()) {

        @Override
        public int getCount() {
            return 20;
        }

        @Override
        public Fragment getItem(int position) {
            return ArtistTagFragment.newInstance(position);
        }
    };
    pager.setAdapter(adapter);
    return rootView;
}
Also used : LastfmArtist(com.naman14.timber.lastfmapi.models.LastfmArtist) Artist(com.naman14.timber.models.Artist) FragmentStatePagerAdapter(android.support.v4.app.FragmentStatePagerAdapter) ArtistInfoListener(com.naman14.timber.lastfmapi.callbacks.ArtistInfoListener) MultiViewPager(com.naman14.timber.widgets.MultiViewPager) View(android.view.View) ArtistQuery(com.naman14.timber.lastfmapi.models.ArtistQuery) LastfmArtist(com.naman14.timber.lastfmapi.models.LastfmArtist)

Aggregations

FragmentStatePagerAdapter (android.support.v4.app.FragmentStatePagerAdapter)1 View (android.view.View)1 ArtistInfoListener (com.naman14.timber.lastfmapi.callbacks.ArtistInfoListener)1 ArtistQuery (com.naman14.timber.lastfmapi.models.ArtistQuery)1 LastfmArtist (com.naman14.timber.lastfmapi.models.LastfmArtist)1 Artist (com.naman14.timber.models.Artist)1 MultiViewPager (com.naman14.timber.widgets.MultiViewPager)1