NumberPicker
NumberPicker copied to clipboard
Add align and sidePadding attributes
Hi! I did a few changes in the project to accomplish some layout characteristics that I couldn't do using only the options currently available in the component. Since it may be something useful to somebody else, I'm creating this PR to contribute.
The layout had the elements of the picker aligned to the left but the text of the elements still centered accordingly to their width. As in the following image:

As you can see, the element of value 1 is aligned with the center of the one of value 100.
To accomplish this, I created two new optional attributes: np_align and np_sidePadding. Both work only when the orientation is vertical. The np_align attribute accepts three different values: left, center, and right. As suggested by itself, the align attribute makes the component align its elements to the center (current and default behavior,) to the left, or to the right of the container. The np_sidePadding (default: 0) is applied only when the align is not set to center because it would not be useful in this case. When defined, np_sidePadding adds a space between the side of the alignment in the container and the element.
Please, let me know if it's not interesting for this library or if there is any change that must be done before merging.
Since there is a bug in v2.4.10, I moved the changes to v2.4.9.
Hey @ShawnLin013 could you merge this change? It'd be useful!
I was also trying to figure out this problem! Merging would be appreciated!