Coder Social home page Coder Social logo

chahine / pageindicator Goto Github PK

View Code? Open in Web Editor NEW
279.0 2.0 42.0 14.45 MB

An Instagram like page indicator compatible with RecyclerView and ViewPager.

License: MIT License

Kotlin 100.00%
instagram pageindicator pageindicatorview android android-library android-ui viewpager recyclerview viewpager-indicator ui-components

pageindicator's People

Contributors

chahine avatar mrezanasirloo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

pageindicator's Issues

Animation update

at com.chahinem.pageindicator.PageIndicator$animateDots$$inlined$let$lambda$1.onAnimationUpdate(PageIndicator.kt:193)
at android.animation.ValueAnimator.animateValue(ValueAnimator.java:1350)
at android.animation.ValueAnimator.animateBasedOnTime(ValueAnimator.java:1262)
at android.animation.ValueAnimator.doAnimationFrame(ValueAnimator.java:1310)
at android.animation.AnimationHandler.doAnimationFrame(AnimationHandler.java:146)
at android.animation.AnimationHandler.-wrap2(AnimationHandler.java)
at android.animation.AnimationHandler$1.doFrame(AnimationHandler.java:54)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:872)
at android.view.Choreographer.doCallbacks(Choreographer.java:686)
at android.view.Choreographer.doFrame(Choreographer.java:618)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:860)
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

Restore state with zero count

 Caused by: java.lang.IllegalArgumentException: count expected to be > 0, actual: 0
        at com.chahinem.pageindicator.DotManager.<init>(DotManager.kt:19)
        at com.chahinem.pageindicator.PageIndicator.setCount(PageIndicator.kt:50)
        at com.chahinem.pageindicator.PageIndicator.onRestoreInstanceState(PageIndicator.kt:138)

View throw exception when restore satate with empty ViewPager

Bug inside RecyclerView

Hello

i am using your awesome library in one of my projects and i have discover the following bug

Having a viewpager inside a recyclerview.
I'm overiding the onViewRecycled and i save in a HashMap what item was visible in the viewpager at that recyclerview position.

Next time i bind this item again if there is in hashmap i set the correct item to be selected in viewpager.
It works perfect.

The problem is that the indicator is in wrong position.
For example in a viewpager with 3 items i swipe to the last.
After the recycling the viewpager show correctly the last item but the indicator is in position 2.

Possible crash when saving state

Consider adding @JvmField and JvmStatic the CREATOR field. Or consider using a data class.

+    @JvmField
+    @JvmStatic
     val CREATOR: Parcelable.Creator<SavedState> = object : Parcelable.Creator<SavedState> {

Bug - Large Number of dots

The animations are stuttering with a large number of dots.
Need to optimize PageIndicator::animateDots and PageIndicator::onDraw

API improvements

Hello, thanks for the nice library I have one comment.

I needed to specify the size of the dots, I needed all the dots to be the same size.

I wasn't sure which number (1-6) to use, so I used all of them:

    <com.chahinem.pageindicator.PageIndicator
        app:piSize1="10dp"
        app:piSize2="10dp"
        app:piSize3="10dp"
        app:piSize4="10dp"
        app:piSize5="10dp"
        app:piSize6="10dp"/>

This works, but I think that the you could improve your API to make it doable with 1 property/method, since this seems (to me, i might be wrong) like the most common use case.

PageIndicator class is final

Currently, the PageIndicator class is final. This makes using a default theme for all PageIndicator instances very hard, using a style attrib.

Would it be possible to make that class non final?

Bug when the list size is quite large

Hi,
I experienced a bug when I put 30s items to the list. At first, it seemed nothing went wrong, but then I realized sometimes there is an extra dot on the first or last item.

Steps :

  • Attach the indicator to a viewpager
  • Add items to the list (in my case it was 30 items)
  • Navigate all the way to the last item and go back
  • Do steps 3 repeatedly
  • An extra dot will appear even if you have already navigated to the first or last item.

RTL support

I think supporting RTL languages should be simple

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.