Closed alashow closed 5 years ago
You can try it before this gets merged:
https://jitpack.io/#alashow/DateRangePicker/1.3.1:
dependencies {
implementation 'com.github.alashow:DateRangePicker:1.3.1'
}
<color name="calendar_selected_day_bg">@color/primary</color>
<color name="calendar_selected_range_bg">@color/primary</color>
<color name="dateTimeRangePickerStateToday">@color/primary</color>
Resolves: #47, #39, #35, #15
@alashow In https://github.com/alashow/DateRangePicker you write that we can import your fork library with:
dependencies {
compile 'com.savvi.datepicker:rangepicker:1.2.0'
}
But that is a path to the original library.
After adding maven { url 'https://jitpack.io' }
and implementation 'com.github.alashow:DateRangePicker:1.3.1'
I got several errors during build. As I understood, this library raised minSdk to 15, also uses AndroidX.
After removing an imported library rangedatepicker
as a module, removing from build.gradle, changing AndroidManifest
:
<uses-sdk tools:overrideLibrary="com.savvi.rangedatepicker" />
<application
...
tools:replace="android:appComponentFactory" android:appComponentFactory="androidx">
I got many errors in build
window:
LoginFragment.kt: (120, 17): Unresolved reference. None of the following candidates is applicable because of receiver type mismatch:
So I have to reference all views from XML in Kotlin with view?.control?....
.
But that is a path to the original library.
Yes, I didn't update readme files in this fork.
this library raised minSdk to 15
I didn't change minSdk
. It was 15 and it's still 15 in my fork.
also uses AndroidX. I got many errors in build window:
Yes, as I upgraded to latest support libs. Did you upgrade your project to AndroidX? As far as I know, you can't use a library with AndroidX if you aren't using AndroidX (Jetifier only works the other way).
Sorry, you are right, you didn't change to 15. When I imported DateRangePicker last year, I manually changed to 14.
Currently I don't know whether I should upgrade the project to AndroidX. It works without it.
Well, you will have to upgrade in the near future as most libraries started upgrading to it. Besides, it's not a hard process.
I read that 28.0.0 would be the last version of support-libraries, so, you are right, I have to upgrade to AndroidX. Probably it will waste several hours for me. Not only migration, but also testing.
Thanks will review the code this coming weekend
@savvisingh this can be improved though: overriding colors via attributes per view and not globally via resources.
Yeah that is the ideal approach but for now, I have published the new version with overriding the color values from resource file
how to change the text of date selected? when a date is clicked, its background color changes to yellow and its text color changes to white.... I don't want to change the text color, it should remain black (as it was earlier) please help as so as possible.
targetAPI
colors.xml
will work.android:tint
in vector resources for color overriding.