ShawnLin013 / NumberPicker

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

Lags when dragging slowly on first item #182

Open bartwell opened 3 years ago

bartwell commented 3 years ago

Hello! Thank you for this useful library. It works well but have an issue. When I am trying to scroll it slowly from begging it gets some lags:

lag

Here is a code:

<com.shawnlin.numberpicker.NumberPicker
        android:id="@+id/picker"
        android:layout_width="@dimen/dimen_232dp"
        android:layout_height="wrap_content"
        android:layout_gravity="center_horizontal"
        app:np_dividerColor="@color/gray"
        app:np_selectedTextSize="34sp"
        app:np_textColor="@color/black"
        app:np_textSize="@dimen/34sp" />
picker.minValue = 1
picker.maxValue = 64
picker.wrapSelectorWheel = false
picker.value = 1
picker.setOnValueChangedListener { _, _, newValue ->
      handlePickerValue(newValue)
}