use of com.viewpagerindicator.TitlePageIndicator in project glimmr by brk3.
the class BottomOverlayActivity method initViewPager.
protected void initViewPager() {
if (mViewPager == null || mAdapter == null) {
Log.e(TAG, "mViewPager and mAdapter must be initialised before " + "calling BottomOverlayActivity.initViewPager");
return;
}
mViewPager.setAdapter(mAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
if (indicator != null) {
indicator.setViewPager(mViewPager);
} else {
mActionBar.setNavigationMode(ActionBar.NAVIGATION_MODE_TABS);
mViewPager.setOnPageChangeListener(mAdapter);
for (String title : CONTENT) {
ActionBar.Tab newTab = mActionBar.newTab().setText(title);
newTab.setTabListener(mAdapter);
mActionBar.addTab(newTab);
}
}
}
use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.
the class SampleTitlesCenterClickListener method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_titles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(mPager);
indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
indicator.setOnCenterItemClickListener(this);
mIndicator = indicator;
}
use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.
the class SampleTitlesStyledMethods method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_titles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
mIndicator = indicator;
indicator.setViewPager(mPager);
final float density = getResources().getDisplayMetrics().density;
indicator.setBackgroundColor(0x18FF0000);
indicator.setFooterColor(0xFFAA2222);
//1dp
indicator.setFooterLineHeight(1 * density);
//3dp
indicator.setFooterIndicatorHeight(3 * density);
indicator.setFooterIndicatorStyle(IndicatorStyle.Underline);
indicator.setTextColor(0xAA000000);
indicator.setSelectedColor(0xFF000000);
indicator.setSelectedBold(true);
}
use of com.viewpagerindicator.TitlePageIndicator in project ViewPagerIndicator by JakeWharton.
the class SampleTitlesTriangle method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.simple_titles);
mAdapter = new TestFragmentAdapter(getSupportFragmentManager());
mPager = (ViewPager) findViewById(R.id.pager);
mPager.setAdapter(mAdapter);
TitlePageIndicator indicator = (TitlePageIndicator) findViewById(R.id.indicator);
indicator.setViewPager(mPager);
indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle);
mIndicator = indicator;
}
use of com.viewpagerindicator.TitlePageIndicator 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();
}
}
Aggregations