ongakuer / CircleIndicator

A lightweight indicator like in nexus 5 launcher
Apache License 2.0
4.27k stars 712 forks source link

Can not set distance between dots #121

Open Syjgin opened 5 years ago

Syjgin commented 5 years ago

Can you add possibility to do this? Currently, even with ci_margin is equals to 0dp, there are some distance between dots.

saurabhnmahajan commented 5 years ago

@Syjgin ci_margin seems to be working for setting the distance. Can you share the code?

Syjgin commented 5 years ago

<me.relex.circleindicator.CircleIndicator android:id="@+id/indicator" android:layout_width="wrap_content" app:layout_constraintLeft_toLeftOf="parent" app:layout_constraintRight_toRightOf="parent" app:layout_constraintTop_toTopOf="@id/indicatorGuideline" app:ci_height="42dp" app:ci_width="42dp" app:ci_margin="0dp" app:ci_drawable="@drawable/ic_tutorial_selected_indicator" app:ci_animator="@animator/empty_animator" app:ci_drawable_unselected="@drawable/ic_tutorial_indicator" android:layout_height="wrap_content"/>

results in such view: http://tinypic.com/r/1zvrf5x/9 When I tried to reduce ci_width & ci_height, it reduces dots size and distance between it both, but some distance still exists even with ci_width and height equals to 5dp. Expected behavior is that ci_width & ci_height is related to dot size only, and distance is controlled by ci_margin. For our project I have to fork CircleIndicator to allow negative margins - can not find, why there are some distance between dots still exists

saurabhnmahajan commented 5 years ago

I would try setting the margin using the Config class as in https://github.com/ongakuer/CircleIndicator/blob/master/sample/src/main/java/me/relex/circleindicator/sample/fragment/CustomAnimationFragment.java#L31