Search in sources :

Example 1 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project cw-omnibus by commonsguy.

the class MainActivity method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    TabPageIndicator tabs = (TabPageIndicator) findViewById(R.id.titles);
    pager = (ViewPager) findViewById(R.id.pager);
    adapter = new SlidesAdapter(this);
    pager.setAdapter(adapter);
    tabs.setViewPager(pager);
    tabs.setOnPageChangeListener(this);
    helper = new PresentationHelper(this, this);
}
Also used : TabPageIndicator(com.viewpagerindicator.TabPageIndicator) PresentationHelper(com.commonsware.cwac.preso.PresentationHelper)

Example 2 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project musicbrainz-android by jdamcd.

the class ArtistActivity method configurePager.

private void configurePager() {
    pagerAdapter = new ArtistPagerAdapter(getSupportFragmentManager());
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(pagerAdapter);
    TabPageIndicator indicator = (TabPageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(pager);
    pager.setCurrentItem(1);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);
}
Also used : TabPageIndicator(com.viewpagerindicator.TabPageIndicator) ArtistPagerAdapter(org.musicbrainz.mobile.adapter.pager.ArtistPagerAdapter) ViewPager(android.support.v4.view.ViewPager)

Example 3 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project musicbrainz-android by jdamcd.

the class ReleaseActivity method configurePager.

private void configurePager() {
    pagerAdapter = new ReleasePagerAdapter(getSupportFragmentManager());
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(pagerAdapter);
    TabPageIndicator indicator = (TabPageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(pager);
    pager.setOffscreenPageLimit(pagerAdapter.getCount() - 1);
}
Also used : ReleasePagerAdapter(org.musicbrainz.mobile.adapter.pager.ReleasePagerAdapter) TabPageIndicator(com.viewpagerindicator.TabPageIndicator) ViewPager(android.support.v4.view.ViewPager)

Example 4 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project musicbrainz-android by jdamcd.

the class SearchActivity method enableResultTabs.

private void enableResultTabs() {
    setContentView(R.layout.activity_search_all);
    SearchPagerAdapter adapter = new SearchPagerAdapter(this);
    ViewPager pager = (ViewPager) findViewById(R.id.pager);
    pager.setAdapter(adapter);
    TabPageIndicator indicator = (TabPageIndicator) findViewById(R.id.indicator);
    indicator.setViewPager(pager);
}
Also used : TabPageIndicator(com.viewpagerindicator.TabPageIndicator) SearchPagerAdapter(org.musicbrainz.mobile.adapter.pager.SearchPagerAdapter) ViewPager(android.support.v4.view.ViewPager)

Example 5 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator 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);
}
Also used : GlimmrPagerAdapter(com.bourke.glimmr.common.GlimmrPagerAdapter) TabPageIndicator(com.viewpagerindicator.TabPageIndicator) PageIndicator(com.viewpagerindicator.PageIndicator) TabPageIndicator(com.viewpagerindicator.TabPageIndicator) ViewPager(android.support.v4.view.ViewPager)

Aggregations

TabPageIndicator (com.viewpagerindicator.TabPageIndicator)10 ViewPager (android.support.v4.view.ViewPager)7 FragmentPagerAdapter (android.support.v4.app.FragmentPagerAdapter)3 TitlePageIndicator (com.viewpagerindicator.TitlePageIndicator)2 SpannableString (android.text.SpannableString)1 TextPaint (android.text.TextPaint)1 View (android.view.View)1 ViewTreeObserver (android.view.ViewTreeObserver)1 DecelerateInterpolator (android.view.animation.DecelerateInterpolator)1 AbsListView (android.widget.AbsListView)1 ImageView (android.widget.ImageView)1 TextView (android.widget.TextView)1 GlimmrPagerAdapter (com.bourke.glimmr.common.GlimmrPagerAdapter)1 PresentationHelper (com.commonsware.cwac.preso.PresentationHelper)1 PageIndicator (com.viewpagerindicator.PageIndicator)1 ArtistPagerAdapter (org.musicbrainz.mobile.adapter.pager.ArtistPagerAdapter)1 ReleasePagerAdapter (org.musicbrainz.mobile.adapter.pager.ReleasePagerAdapter)1 SearchPagerAdapter (org.musicbrainz.mobile.adapter.pager.SearchPagerAdapter)1