Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

View pager indicator Jake Wharton

I m using Jake Wharton's example for showing viewpager indicator. www.viewpagerindicator.com

I am using snap circle indicator.

can anyone please tell me how to increase the width between the circles?

What parameter should be changed?

like image 565
Ajitha Avatar asked Nov 26 '12 09:11

Ajitha


3 Answers

We need to increase the "threeRadius" parameter to higher value. Thanks.

like image 129
Ajitha Avatar answered Oct 12 '22 00:10

Ajitha


You can find all parameter in file res/values/vpi_attrs.xml. The style associated of CirclePageIndicator specified :

<!-- Radius of the circles. This is also the spacing between circles. -->
<attr name="radius" format="dimension" />

It's not possible to change gap between two circle. You must subclass CirclePageIndicator:

  • create YourCirclePageIndicator in your Project
  • add a new attribut gapCircle
  • override onDraw method and change the compute of shortOffset/longOffset
like image 38
zicos22 Avatar answered Oct 12 '22 01:10

zicos22


Call CirclePageIndicator.setRadius()

like image 38
Ray Avatar answered Oct 12 '22 02:10

Ray