tommybuonomo / dotsindicator

Three material Dots Indicators for view pagers in Android !
Apache License 2.0
3.44k stars 353 forks source link

dotsColor and selectedDotColor for WormDotsIndicator #100

Closed rubek-joshi closed 3 years ago

rubek-joshi commented 4 years ago

It would be really cool if we can set the inactive dot color for the WormDotsIndicator.

hpinhal commented 3 years ago

You can use the stroke properties to achieve what you're looking for.

<com.tbuonomo.viewpagerdotsindicator.WormDotsIndicator
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    app:dotsColor="@color/colorPrimary"
    app:dotsSize="8dp"
    app:dotsSpacing="4dp"
    app:dotsStrokeColor="@color/dirty_white"
    app:dotsStrokeWidth="4dp" />

Set the stroke colour to your inactive colour and the stroke width to half of your dots size.