Java Code Examples for android.support.v13.app.FragmentStatePagerAdapter

The following are top voted examples for showing how to use android.support.v13.app.FragmentStatePagerAdapter. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: fakeweibo   File: GalleryPagerFragment.java   View source code 6 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
	ViewPager viewPager = (ViewPager) view;
	viewPager.setAdapter(new FragmentStatePagerAdapter(getFragmentManager()) {
		@Override
		public Fragment getItem(int position) {
			return SimpleImageFragment.getFragment(mUrls.get(position));
		}

		@Override
		public int getCount() {
			return mUrls.size();
		}
	});
	viewPager.setPageTransformer(true, new PageTransformer.ZoomOutPageTransformer());
	viewPager.setCurrentItem(mCurrentIndex);
}
 
Example 2
Project: catnut   File: GalleryPagerFragment.java   View source code 6 votes vote down vote up
@Override
public void onViewCreated(View view, Bundle savedInstanceState) {
	ViewPager viewPager = (ViewPager) view;
	viewPager.setAdapter(new FragmentStatePagerAdapter(getFragmentManager()) {
		@Override
		public Fragment getItem(int position) {
			return SimpleImageFragment.getFragment(mUrls.get(position));
		}

		@Override
		public int getCount() {
			return mUrls.size();
		}
	});
	viewPager.setPageTransformer(true, new PageTransformer.ZoomOutPageTransformer());
	viewPager.setCurrentItem(mCurrentIndex);
}
 
Example 3
Project: RedditInPictures   File: ImgurAlbumActivity.java   View source code 4 votes vote down vote up
@Override
public FragmentStatePagerAdapter getPagerAdapter() {
    return new ImgurAlbumPagerAdapter(getFragmentManager(), getImages());
}
 
Example 4
Project: RedditInPictures   File: ImageDetailActivity.java   View source code 4 votes vote down vote up
public FragmentStatePagerAdapter getPagerAdapter() {
    return new CursorPagerAdapter(getFragmentManager(), null);
}
 
Example 5
Project: RedditInPictures   File: ImageDetailActivityFree.java   View source code 4 votes vote down vote up
@Override
public FragmentStatePagerAdapter getPagerAdapter() {
    return new CursorPagerAdapterFree(getFragmentManager(), null);
}
 
Example 6
Project: RedditInPictures   File: ImgurAlbumActivityFree.java   View source code 4 votes vote down vote up
public FragmentStatePagerAdapter getPagerAdapter() {
    return new ImgurAlbumPagerAdapterFree(getFragmentManager(), getImages());
}
 
Example 7
Project: RedditInPictures   File: ImageViewerActivity.java   View source code 2 votes vote down vote up
/**
 * Get the adapter for the ViewPager. It is expected that it will return a subclass of
 * FragmentStatePagerAdapter
 *
 * @return The adapter for the ViewPager
 */
public abstract FragmentStatePagerAdapter getPagerAdapter();