ShawnLin013 / NumberPicker

:slot_machine: The android library that provides a simple and customizable NumberPicker.
MIT License
1.09k stars 240 forks source link

:bug: Fix Scrolling is 'tripping' when at top or bottom when no-wrap … #176

Closed rockscy closed 3 years ago

rockscy commented 4 years ago

…and itemCount is >= 5

balazsbanyai commented 4 years ago

This would be a critical fix for us. @ShawnLin013 Is there a chance that it can be merged anytime soon?

ShawnLin013 commented 3 years ago

@SmallStoneDD @balazsbanyai Could you provide any videos or code snippets?

ShawnLin013 commented 3 years ago

And this issue only can be reproduced by using this PR. 😅

balazsbanyai commented 3 years ago

The issue can be reproduced with the latest released version of this library, with disabled wrapping and more than 5 items

The issue is not reproducible using the code built from this PR.

This is how it looks: https://youtu.be/wo2hfMbrY5I

ShawnLin013 commented 3 years ago

Could you reproduce the issue on sample app? It would be better if you can paste the configs of number picker, such as java code or layout xml.

balazsbanyai commented 3 years ago

Sure thing, this configuration reproduces the issue, here you go:

<com.shawnlin.numberpicker.NumberPicker
        android:id="@+id/horizontal_number_picker"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="60dp"
        app:np_orientation="horizontal"
        app:np_wrapSelectorWheel="false"
        app:np_min="16"
        app:np_max="32"
        app:np_maxFlingVelocityCoefficient="3"
        />

Video: https://youtu.be/14q0ZtirocY

ShawnLin013 commented 3 years ago

This PR only fixed the tripping in horizontal mode, but unfortunately it made the tripping in vertical mode. And this issue has been fixed at v2.4.11. @SmallStoneDD @balazsbanyai