//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_circles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; mIndicator = (CirclePageIndicator)FindViewById(R.Id.indicator); mIndicator.setViewPager(mPager); //We set this on the indicator, NOT the pager //mIndicator.setOnPageChangeListener(new ViewPager.IOnPageChangeListener() { // @Override // public void onPageSelected(int position) { // Toast.makeText(SampleCirclesWithListener.this, "Changed to page " + position, Toast.LENGTH_SHORT).show(); // } // @Override // public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) { // } // @Override // public void onPageScrollStateChanged(int state) { // } //}); mIndicator.setOnPageChangeListener(new PageListener(this)); }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_circles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; mIndicator = (CirclePageIndicator)FindViewById(R.Id.indicator); mIndicator.setViewPager(mPager); }
//@Override protected void onCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); //The look of this sample is set via a style in the manifest SetContentView(R.Layout.simple_lines); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; mIndicator = (LinePageIndicator)FindViewById(R.Id.indicator); mIndicator.setViewPager(mPager); }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_titles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; TitlePageIndicator indicator = (TitlePageIndicator)FindViewById(R.Id.indicator); indicator.setViewPager(mPager); indicator.setFooterIndicatorStyle(IndicatorStyle.Triangle); mIndicator = indicator; }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_underlines); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; UnderlinePageIndicator indicator = (UnderlinePageIndicator)FindViewById(R.Id.indicator); mIndicator = indicator; indicator.setViewPager(mPager); indicator.setSelectedColor(new Color(0xCC0000)); indicator.SetBackgroundColor(new Color(0xCCCCCC)); indicator.setFadeDelay(1000); indicator.setFadeLength(1000); }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_lines); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = (ViewPager)FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; LinePageIndicator indicator = (LinePageIndicator)FindViewById(R.Id.indicator); mIndicator = indicator; indicator.setViewPager(mPager); float density = Resources.DisplayMetrics.Density; indicator.setSelectedColor(new Color(0xFF0000)); indicator.setUnselectedColor(new Color(0x888888)); indicator.setStrokeWidth(4 * density); indicator.setLineWidth(30 * density); }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_circles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; CirclePageIndicator indicator = (CirclePageIndicator)FindViewById(R.Id.indicator); mIndicator = indicator; indicator.setViewPager(mPager); float density = this.Resources.DisplayMetrics.Density; indicator.SetBackgroundColor(new Color(0xCCCCCC)); indicator.setRadius(10 * density); indicator.setPageColor(new Color(0x0000FF)); indicator.setFillColor(new Color(0x888888)); indicator.setStrokeColor(new Color(0x000000)); indicator.setStrokeWidth(2 * density); }
//@Override protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); SetContentView(R.Layout.simple_titles); mAdapter = new TestFragmentAdapter(SupportFragmentManager); mPager = FindViewById<ViewPager>(R.Id.pager); mPager.Adapter = mAdapter; TitlePageIndicator indicator = (TitlePageIndicator)FindViewById(R.Id.indicator); mIndicator = indicator; indicator.setViewPager(mPager); float density = Resources.DisplayMetrics.Density; indicator.SetBackgroundColor(new Color(0x18FF0000)); indicator.setFooterColor(new Color(0xAA2222)); indicator.setFooterLineHeight(1 * density); //1dp indicator.setFooterIndicatorHeight(3 * density); //3dp indicator.setFooterIndicatorStyle(IndicatorStyle.Underline); indicator.setTextColor(new Color(0x000000)); indicator.setSelectedColor(new Color(0x000000)); indicator.setSelectedBold(true); }