From 29d317ac6817a5745a1ecfc75a835cc4c09c54fe Mon Sep 17 00:00:00 2001 From: Wouter Dullaert Date: Wed, 12 Jul 2017 11:54:40 +0200 Subject: [PATCH] Added section of using different support library version to the FAQ Fixes #338 --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 86bc95b5..54faeac7 100644 --- a/README.md +++ b/README.md @@ -221,6 +221,19 @@ dependencies { ### Why does the `DatePickerDialog` return the selected month -1? In the java `Calendar` class months use 0 based indexing: January is month 0, December is month 11. This convention is widely used in the java world, for example the native Android DatePicker. +### How do I use a different version of the support library in my app? +This library depends on the android support library. Because the jvm allows only one version of a fully namespaced class to be loaded, you will run into issues if your app depends on a different version of the support library than the one used in this app. Gradle will not be able to satisfy both requirements. + +Using the following snippet in your apps `build.gradle` file you can exclude this library's transitive support library dependency from being installed. + +```groovy +compile ('com.wdullaer:materialdatetimepicker:3.2.2') { + exclude group: 'com.android.support' +} +``` + +This will work fine as long as the support library version your app depends on is recent enough (supports `RecyclerView`) and google doesn't release a version in the future that contains breaking changes. (If/When this happens I will try hard to document this). See issue [#338](https://github.com/wdullaer/MaterialDateTimePicker/issues/338) for more information. + ### How do I use my custom logic to enable/disable dates? `DatePickerDialog` exposes some utility methods to enable / disable dates for common scenario's. If your needs are not covered by these, you can supply a custom implementation of the `DateRangeLimiter` interface. Because the `DateRangeLimiter` is preserved when the `Dialog` pauzes, your implementation must also implement `Parcelable`.