Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed Oreo requirement for components #15

Closed
wants to merge 3 commits into from

Conversation

AleSpero
Copy link

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)

  • Added CompatDate/CompatTime/CompatDateTime models which act as a layer that can handle both the new java.time API and the legacy API
  • Edited Pickers in the core folder accordingly, in order to use CompatDate
  • Created new *PickerCompat components, which the user will use in case they don't support Oreo

Cheers

Alessandro Sperotti added 3 commits December 15, 2022 14:45
…ause of LocalDate/LocalDateTime etc)

- Added CompatDate/CompatTime/CompatDateTime models which act as a layer that can handle both the new java.time API and the legacy API
- Edited Pickers in the core folder accordingly, in order to use CompatDate
- Created new *PickerCompat components, which the user will use in case they don't support Oreo
@commandiron
Copy link
Owner

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

@commandiron
Copy link
Owner

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants