ongakuer / CircleIndicator

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

Rectangles showing when selected? #136

Open ColtonIdle opened 4 years ago

ColtonIdle commented 4 years ago

Here is my xml

   <me.relex.circleindicator.CircleIndicator
        android:id="@id/circleIndicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="@+id/pager"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        android:layout_marginBottom="48dp"
        app:ci_drawable="@drawable/white_radius"
        app:ci_drawable_unselected="@drawable/white_radius"
        />

kotlin

      pager.adapter = adapter
      circleIndicator.setViewPager(pager)

version

me.relex:circleindicator:2.1.4

I believe I'm using ViewPager1? androidx.viewpager.widget.ViewPager

Output:

Screen Shot 2020-04-08 at 2 19 50 PM

What am I doing wrong?

I want just plain dots.

ColtonIdle commented 4 years ago

I might have found the issue. Using Chris Banes' insetter lib https://github.com/chrisbanes/insetter in order to inset at the top of my screen because I draw edge to edge, it breaks CircleIndicator library.

Please let me know if you think you can fix this.

ColtonIdle commented 4 years ago

The solution was to add android:clipToPadding="false" on the circleIndicator in xml. That seemed to fix it.

DaniilPavlenko commented 4 years ago

In my case the rectangle is displayed until I set the android:layout_height from wrap_content to an absolute value (20dp)

<me.relex.circleindicator.CircleIndicator
    android:id="@+id/dot_indicator"
    android:layout_width="match_parent"
    android:layout_height="20dp"/>