commandiron / WheelPickerCompose

Add Wheel Date - Time Picker in Android Jetpack Compose.
Apache License 2.0
444 stars 54 forks source link

Can it support 5 rows of data? #16

Closed haohao9102 closed 1 year ago

commandiron commented 1 year ago

Thanks for your request. Actually, row count option could be nice. I will look at as soon as possible.

haohao9102 commented 1 year ago

I try to change the number of rows, but there will be a jump when the scroll ends, and I can't find the reason

commandiron commented 1 year ago

you are right, I can change to number of rows too but this broke the snap and output logic because i believe this change the first visible index. we must find a way to achieve this.

commandiron commented 1 year ago

hey, i added rowCount parameter so now number of rows can be change. This release include this feature.

haohao9102 commented 1 year ago

i see the changes size.height / rowCount * ((rowCount - 1 )/ 2) why this calculation?

commandiron commented 1 year ago

hi this calculation for calculate to top of selection box height. Lazy Column needs vertical padding for select first item or select last item. Calculations; Size.height / rowCount -> 1 item height, * (rowCount - 1 / 2) -> item count of top, example; 3 item - 1 item on top, 5 item - 2 item of top, 7 item - 3 item of top. = Height of top of selection items.

Screenshot_20230105_133850