ShawnLin013 / NumberPicker

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

Add ability to update the spacing between items #185

Closed dbarr33 closed 3 years ago

dbarr33 commented 3 years ago

Adds a the np_itemSpacing attr to control the amount space between items. This value can be negative or positive. A positive value moves the items farther apart and a negative value moves the items closer together. The item spacing can be controlled either by using the np_itemSpacing attr or calling the setItemSpacing function.

This is achieved by adding an x or y offset based on the orientation of the picker to the values passed to the drawText functions. For items before the middle item the offset is negative and for items after the middle item the offset is positive.

Screenshot_1606915873