material-components / material-components/material-components-android
[MaterialDatePicker] Relax Visibility of Date Selection Components
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 17.4k
- Forks
- 3.2k
- PR merge metrics
- No merged PRs in 30d
Description
### Problem
Some of the `MaterialDatePicker` pre-built components have a restricted library scope; `@RestrictTo(Scope.LIBRARY_GROUP)`
This means that consumer apps cannot extends those classes, in order to implement more custom behavior, that is built on top of their base behavior.
Examples:
- [RangeDateSelector](https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/datepicker/RangeDateSelector.java)
- [SingleDateSelector](https://github.com/material-components/material-components-android/blob/master/lib/java/com/google/android/material/datepicker/SingleDateSelector.java)
### Solution
Removing these Library Scope Restrictions would be much appreciated, so that we can extend custom behavior on top the existing components, without having to duplicate functionaility.
For example, if one wanted to create a month selector that would select a month in a date range of [1st of month - last day of month].
One could extend the `RangeDateSelector` implementation and slightly modify some of the behavior to accomplish such a case, without having to rewrite how `RangeDateSelector` works.

Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lib/java/com/google/android/material/datepicker/RangeDateSelector.java and SingleDateSelector.java, linked in the issue, and inspect their @RestrictTo(Scope.LIBRARY_GROUP) annotations and related date-picker API usage. Done means consumer applications can extend these components without duplicating their existing behavior, while the project still builds successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, java
- Domain
- mobile
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 35/100