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);
}
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();
}
}
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;
}
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);
}
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);
}
Aggregations