material-components / material-components/material-components-android

[MaterialDatePicker] Relax Visibility of Date Selection Components

Open
#1,268 4 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature request Widget: DatePicker
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.

![monthPickerGif](https://user-images.githubusercontent.com/1795695/80915322-3e776e00-8d17-11ea-9df7-fc9f479b43ce.gif)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.