Skip to content

Latest commit

 

History

History
52 lines (36 loc) · 1.32 KB

README.md

File metadata and controls

52 lines (36 loc) · 1.32 KB

VerticalPageIndicator

A page indicator for castorflex's VerticalViewPager: https://github.com/castorflex/VerticalViewPager

#Usage Just include the widget adjacent to the VerticalViewPager it represents.

<ablancoca.verticalpageindicator.VerticalPageIndicator
  android:id="@+id/indicator"
  android:layout_width="20dp"
  android:layout_height="match_parent"
  app:vpiselectedcolor="#000000"
  app:vpiunselectedcolor="#FFFFFF"
  app:vpisize="10"/>

You can set the attributes in code too:

  setSelectedColor(int color);
  
  setUnselectedColor(int color);
  
  setSize(int size);

In order to use VerticalPageIndicator, you should call

  setVerticalViewPager(VerticalViewPager pager);

after settign the VerticalViewPager's adapter;

#Examples

  VerticalViewPager pager = (VerticalViewPager) findViewById(R.id.verticalviewpager);
  VerticalPageIndicator indicator = (VerticalPageIndicator) findViewById(R.id.indicator);

  DummyAdapter adapter = new DummyAdapter();
  pager.setAdapter(adapter);

  indicator.setVerticalViewPager(pager);

You can see the example at VerticalPageIndicatorSample. Use the menu action Add Page to see how the indicator changes dynamically when new items added to the VerticalViewPager.

#License

This project has a MIT License, so feel free to use it as you want