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

[MaterialDatePicker] Make the class open*.

Open
#680 3 comments 9 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

**Is your feature request related to a problem? Please describe.**
I would suggest the class to be ~made public~ open, so we could attach the selection listener in a subclass and use "sharedViewModel" to deliver the selected date. At the moment in case of screen rotation, we need to detach the listeners and reattach when the new fragment is ready to avoid a memory leak.

**Describe the solution you'd like**
Make the class public.

**Describe alternatives you've considered**
Maybe another way to avoid subclassing it would be the old fashion OnInteractionListener on the parentFragment / activity.

We also happily accept [pull requests](https://github.com/material-components/material-components-android/pulls).

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 at the MaterialDatePicker entry point and review how selection listeners are currently attached across fragment recreation. Compare the requested subclassing approach with the proposed parentFragment or activity listener alternative. Done means the supported API clearly enables the intended listener and sharedViewModel use without requiring manual listener detachment during rotation.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
api, mobile
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.