commandiron / WheelPickerCompose

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

Removed Oreo requirement for components #15

Closed AleSpero closed 1 year ago

AleSpero commented 1 year ago

Hi there - first and foremost, thank you for your work on this library, it's quite well done and great and it's exactly what I need for my project :)

I noticed that since the library is using the java.time library, it's basically not possible to use for apps that don't support versions less than Oreo (even though the minSdk in the build gradle is 23 and not 26). In production and published apps, there'll be still plenty of users who will still use the old versions. So i decided to make some changes to remove this constraint and add a layer of compatibility. So the library will now use java.time APIs if Version >= 26, and Calendar if < 26.

The library for now seems to work with the new changes, although i'm not sure if i'll have time to address further comments or requests for this PR. so i hope this code can be a starting point to extend the library :)

Changes

Removed constraint of needing to have Oreo to use this component (because of LocalDate/LocalDateTime etc)

Cheers

commandiron commented 1 year ago

hey @AleSpero Thank you very much for the work you do. I will check as soon as possible.

commandiron commented 1 year ago

hey @AleSpero I'm really appreciated for the work you do, it was really necessary to support before API 26. I find an another way to support before Oreo versions and remove the requirement. I use the desugaring for this, and needs few steps to support before API level 26. I explain this in Readme page with fourth optional step. This is the supported version. Again thanks for your help and your feedback.

Also If there is a situation where your version has an advantage, we can also add it. I will wait your feedback.