use of com.bourke.glimmr.common.GlimmrPagerAdapter in project glimmr by brk3.
the class PhotoInfoFragment method initViewPager.
private void initViewPager() {
ViewPager viewPager = (ViewPager) mLayout.findViewById(R.id.viewPager);
/* http://stackoverflow.com/a/13684139/663370 */
GlimmrPagerAdapter adapter = new GlimmrPagerAdapter(getChildFragmentManager(), viewPager, mActivity.getActionBar(), CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case OVERVIEW_PAGE:
return PhotoOverviewFragment.newInstance(PhotoInfoFragment.this.mPhoto);
case MORE_PAGE:
return ExifInfoFragment.newInstance(PhotoInfoFragment.this.mPhoto);
}
return null;
}
};
viewPager.setAdapter(adapter);
PageIndicator indicator = (TabPageIndicator) mLayout.findViewById(R.id.indicator);
indicator.setViewPager(viewPager);
}
use of com.bourke.glimmr.common.GlimmrPagerAdapter in project glimmr by brk3.
the class PhotosetViewerActivity method initViewPager.
@Override
protected void initViewPager() {
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GlimmrPagerAdapter(getSupportFragmentManager(), mViewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case PHOTOSET_PAGE:
return PhotosetGridFragment.newInstance(mPhotoset);
}
return null;
}
};
super.initViewPager();
}
use of com.bourke.glimmr.common.GlimmrPagerAdapter in project glimmr by brk3.
the class ProfileViewerActivity method initViewPager.
@Override
protected void initViewPager() {
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GlimmrPagerAdapter(getSupportFragmentManager(), mViewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case PHOTO_STREAM_PAGE:
return PhotoStreamGridFragment.newInstance(mUser);
case FAVORITES_STREAM_PAGE:
return FavoritesGridFragment.newInstance(mUser);
case SETS_PAGE:
return PhotosetsFragment.newInstance(mUser);
case CONTACTS_PAGE:
// TODO
return PhotoStreamGridFragment.newInstance(mUser);
}
return null;
}
};
super.initViewPager();
}
use of com.bourke.glimmr.common.GlimmrPagerAdapter in project glimmr by brk3.
the class SearchActivity method initViewPager.
protected void initViewPager(final String searchQuery) {
mViewPager = (ViewPager) findViewById(R.id.viewPager);
mAdapter = new GlimmrPagerAdapter(getSupportFragmentManager(), mViewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case RESULT_PUBLIC_PHOTOS_PAGE:
return PublicPhotoSearchGridFragment.newInstance(searchQuery, AbstractPhotoSearchGridFragment.SORT_TYPE_RELAVANCE);
case RESULT_PHOTOSTREAM_PAGE:
return PhotostreamSearchGridFragment.newInstance(searchQuery, AbstractPhotoSearchGridFragment.SORT_TYPE_RELAVANCE, mUser);
}
return null;
}
};
super.initViewPager();
}
use of com.bourke.glimmr.common.GlimmrPagerAdapter in project glimmr by brk3.
the class ExploreActivity method initViewPager.
private void initViewPager() {
ViewPager viewPager = (ViewPager) findViewById(R.id.viewPager);
GlimmrPagerAdapter adapter = new GlimmrPagerAdapter(getSupportFragmentManager(), viewPager, mActionBar, CONTENT) {
@Override
public Fragment getItemImpl(int position) {
switch(position) {
case INTERESTING_PAGE:
return RecentPublicPhotosFragment.newInstance();
}
return null;
}
};
viewPager.setAdapter(adapter);
//TitlePageIndicator indicator =
//(TitlePageIndicator) findViewById(R.id.indicator);
//if (indicator != null) {
//indicator.setViewPager(viewPager);
//} else {
//mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
//viewPager.setOnPageChangeListener(adapter);
//for (String title : CONTENT) {
//ActionBar.Tab newTab = mActionBar.newTab().setText(title);
//newTab.setTabListener(adapter);
//mActionBar.addTab(newTab);
//}
//}
}
Aggregations