package com.viewpagerindicator.sample; import android.os.Bundle; import android.support.v4.view.ViewPager; import com.viewpagerindicator.TitlePageIndicator; import com.viewpagerindicator.TitlePageIndicator.IndicatorStyle; public class SampleTitlesStyledMethods extends BaseSampleActivity { @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); indicator.setFooterLineHeight(1 * density); //1dp indicator.setFooterIndicatorHeight(3 * density); //3dp indicator.setFooterIndicatorStyle(IndicatorStyle.Underline); indicator.setTextColor(0xAA000000); indicator.setSelectedColor(0xFF000000); indicator.setSelectedBold(true); } }