florent37 / SingleDateAndTimePicker

You can now select a date and a time with only one widget !
Apache License 2.0
1.02k stars 333 forks source link

Hour And Minutes PIcker #306

Open HannahShulman opened 3 years ago

HannahShulman commented 3 years ago

Is there any way to have an hour and minute picker only? without the date?

Akhunzaada commented 3 years ago

@HannahShulman Yes, every UI element is configurable both using the Builder class and the XML. The Usage Doc has complete examples with screenshots of what you are looking for.

Using Builder Class:

new SingleDateAndTimePickerDialog.Builder(this)
            .bottomSheet()
            .curved()
            .displayMinutes(false)
            .displayHours(false)
            .displayDays(false)
            .displayMonth(true)
            .displayYears(true)
            .displayDaysOfMonth(true)
            .display();

Using XML:

<attr name="picker_displayMonth" format="boolean"/>
<attr name="picker_displayYears" format="boolean"/>
<attr name="picker_displayDays" format="boolean"/>
<attr name="picker_displayDaysOfMonth" format="boolean" />
<attr name="picker_displayMinutes" format="boolean"/>
<attr name="picker_displayHours" format="boolean"/>
<attr name="picker_displayMonthNumbers" format="boolean" />