tinkoff-mobile-tech / ScrollingPagerIndicator

Pager indicator inspired by Instagram. Lightweight and easy to set up.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

the last dot in indicator not getting selected when last item of recyclerview is reached by scrolling

poojasngh432 opened this issue · comments

` <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toTopOf="parent" />

    <ru.tinkoff.scrollingpagerindicator.ScrollingPagerIndicator
        android:id="@+id/indicator"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/recycler_view"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        android:layout_marginBottom="@dimen/_5sdp"
        app:spi_dotSize="@dimen/_5sdp"
        app:spi_dotSelectedSize="@dimen/_5sdp"
        app:spi_visibleDotCount="5"
        app:spi_visibleDotThreshold="5"/>`

vHolder.indicator.attachToRecyclerView(vHolder.recyclerView,0); vHolder.indicator.setCurrentPosition(0); vHolder.indicator.setDotColor(vHolder.recyclerView.getContext().getResources().getColor(R.color.unselected_green)); vHolder.indicator.setSelectedDotColor(vHolder.recyclerView.getContext().getResources().getColor(R.color.selected_dark_green)); vHolder.indicator.setDotCount(RemoteConfigManager.init().getFeedFeatureNavList().size());