CircleIndicator does not fit the screen

858 Views Asked by At

I am using this library https://github.com/ongakuer/CircleIndicator, in some cases too much data is coming. The indicator goes out of the screen, can I add animation to it, there is an animation that exists as default in ios.

Ios Example: https://streamable.com/6nu6j3

Android Problem:

I found this as a problem like this before, i was wondering if there could be a nicer solution like in ios

How to set a limit of items on CirclePageIndicator?

Layout

<androidx.viewpager2.widget.ViewPager2
    android:id="@+id/viewPager2"
    android:layout_width="match_parent"
    android:layout_height="wrap_content" />

<me.relex.circleindicator.CircleIndicator3
    android:id="@+id/circleIndicator"
    android:layout_width="match_parent"
    android:layout_height="5dp"
    android:layout_below="@id/viewPager2"
    android:layout_centerInParent="true"
    android:layout_gravity="center_horizontal"
    android:layout_marginLeft="25dp"
    android:layout_marginTop="20dp"
    android:layout_marginRight="25dp"
    android:gravity="center"
    app:ci_drawable="@drawable/circle"
    app:ci_height="5dp"
    app:ci_width="5dp" />

Edit:

This library my work has been read -> https://github.com/wching/Android-Indefinite-Pager-Indicator

1

There are 1 best solutions below

1
axar On

you have to set margin into your root level layout according to that they set margin .....

and don't check into the emulator some time emulator may be goes wrong so check it into real device only