material-components / material-components-android

Modular and customizable Material Design UI components for Android
Apache License 2.0
16.26k stars 3.06k forks source link

[MaterialDatePicker] DatePicker as Regular View Element #3429

Open savejeff opened 1 year ago

savejeff commented 1 year ago

Is your feature request related to a problem? Please describe.

I would like to use the MaterialDatePicker similar to the DatePicker in XML as a regular element in a View.

Especially for Layouts for Tablets would profit from this.

Describe the solution you'd like

    <MaterialDatePicker 
        android:id="@+id/datePicker"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"/>

Describe alternatives you've considered

Alternatively, a style update to the basic DatePicker would also work.

aisanu commented 11 months ago

It has been long requested back in 2019, but we haven't hear anything back from the MDC Android team. Related issues:

  1. https://github.com/material-components/material-components-android/issues/1799
  2. https://github.com/material-components/material-components-android/issues/660

I'm recently have this business requirement for my project, but looks like rolling your own implementation is the way to go.

savejeff commented 11 months ago

can't believe such a basic ui element is not well supported. Same story with iOS. No unified calender view.

I have completely dropped the my UI layout approach using a calender view and resorted to a list of selected dates.

blazek commented 1 month ago

That would be really useful. What I'm especially missing in DatePicker are CalendarConstraints.