Search in sources :

Example 6 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTabsDefault method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_tabs);
    FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
    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) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) ViewPager(android.support.v4.view.ViewPager)

Example 7 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project Klyph by jonathangerbaud.

the class ProfileActivity method onCreate.

@Override
public void onCreate(final Bundle savedInstanceState) {
    requestWindowFeature(Window.FEATURE_ACTION_BAR_OVERLAY);
    final float ratio = getRatio();
    final int coverImageHeaderHeight = (int) (KlyphDevice.getDeviceWidth() * ratio);
    super.onCreate(savedInstanceState);
    getActionBar().setBackgroundDrawable(getResources().getDrawable(R.drawable.ab_background_transparent_gradient));
    // Let the Application class know that the first launch is complete
    // If we come from a notification, then do not show the ads
    // When going back to main activity
    KlyphApplication.getInstance().launchComplete();
    id = getIntent().getStringExtra(getBundleIdParameter());
    String name = getIntent().getStringExtra(getBundleNameParameter());
    TitlePageIndicator titleIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);
    TabPageIndicator tabIndicator = (TabPageIndicator) findViewById(R.id.tab_indicator);
    if (KlyphPreferences.showTabPageIndicator())
        titleIndicator.setVisibility(View.GONE);
    else
        tabIndicator.setVisibility(View.GONE);
    mHeader = findViewById(R.id.header);
    mHeaderPicture = (ImageView) findViewById(R.id.header_picture);
    mHeaderLogo = (ImageView) findViewById(R.id.header_logo);
    headerNameButton = findViewById(R.id.header_name_button);
    pageIndicator = getPageIndicator();
    errorView = findViewById(R.id.error_layout);
    errorTextView = (TextView) findViewById(R.id.error_text);
    errorButton = (Button) findViewById(R.id.retry_button);
    ImageLoader.display((ImageView) mHeaderPicture, ImageLoader.FAKE_URI, true, R.drawable.cover_place_holder);
    if (mHeaderLogo != null)
        ImageLoader.display((ImageView) mHeaderLogo, ImageLoader.FAKE_URI, true, KlyphUtil.getProfilePlaceHolder(this));
    initComponents();
    mSmoothInterpolator = new DecelerateInterpolator();
    mMinHeaderTranslation = -coverImageHeaderHeight + getActionBarHeight();
    mActionBarTitleColor = 0xFFFFFF;
    mSpannableString = new SpannableString(name);
    mAlphaForegroundColorSpan = new AlphaForegroundColorSpan(mActionBarTitleColor);
    setupActionBar();
    final View content = findViewById(android.R.id.content);
    if (hasCachedData(savedInstanceState)) {
        content.getViewTreeObserver().addOnGlobalLayoutListener(new ViewTreeObserver.OnGlobalLayoutListener() {

            @SuppressWarnings("deprecation")
            @Override
            public void onGlobalLayout() {
                content.getViewTreeObserver().removeGlobalOnLayoutListener(this);
                loadCachedData(savedInstanceState);
            }
        });
    } else {
        loadData();
    }
}
Also used : DecelerateInterpolator(android.view.animation.DecelerateInterpolator) TabPageIndicator(com.viewpagerindicator.TabPageIndicator) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) View(android.view.View) AbsListView(android.widget.AbsListView) TextView(android.widget.TextView) TextPaint(android.text.TextPaint) SpannableString(android.text.SpannableString) ImageView(android.widget.ImageView) TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator) ViewTreeObserver(android.view.ViewTreeObserver)

Example 8 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project Klyph by jonathangerbaud.

the class TitledViewPagerActivity method getPageIndicator.

@Override
protected PageIndicator getPageIndicator() {
    TitlePageIndicator titleIndicator = (TitlePageIndicator) findViewById(R.id.title_indicator);
    TabPageIndicator tabIndicator = (TabPageIndicator) findViewById(R.id.tab_indicator);
    if (KlyphPreferences.showTabPageIndicator())
        return tabIndicator;
    else
        return titleIndicator;
}
Also used : TabPageIndicator(com.viewpagerindicator.TabPageIndicator) TitlePageIndicator(com.viewpagerindicator.TitlePageIndicator)

Example 9 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTabsStyled method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_tabs);
    FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
    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) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) ViewPager(android.support.v4.view.ViewPager)

Example 10 with TabPageIndicator

use of com.viewpagerindicator.TabPageIndicator in project ViewPagerIndicator by JakeWharton.

the class SampleTabsWithIcons method onCreate.

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.simple_tabs);
    FragmentPagerAdapter adapter = new GoogleMusicAdapter(getSupportFragmentManager());
    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) FragmentPagerAdapter(android.support.v4.app.FragmentPagerAdapter) 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