explaingit

wdullaer/materialdatetimepicker

4,638JavaAudience · developerComplexity · 2/5LicenseSetup · easy

TLDR

An Android library that adds a Material Design date picker and time picker to your app with extensive theming, dark mode, date constraints, and a one-line Gradle setup.

Mindmap

mindmap
  root((repo))
    What it does
      Date picker dialog
      Time picker dialog
      Material Design style
    Configuration
      Min and max date
      Blocked dates
      12h and 24h clock
      Seconds picker
    Theming
      Auto accent color
      Dark mode
      Custom colors
    Tech Stack
      Java
      Android
      Gradle Maven Central
    License
      Apache 2.0
      Commercial OK
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Add a styled date picker to an Android app that automatically matches your app accent color with one Gradle dependency.

USE CASE 2

Let users pick appointment times with a Material Design time picker supporting 12-hour and 24-hour formats.

USE CASE 3

Block specific unavailable dates in a booking app date picker using a simple exclusion list.

USE CASE 4

Enable a seconds picker in addition to hours and minutes for a precise time entry in a scheduling app.

Tech stack

JavaAndroidGradleMaven Central

Getting it running

Difficulty · easy Time to first run · 30min
Use freely for any purpose including commercial Android apps, just keep the copyright notice.

In plain English

Material DateTime Picker is an Android library that gives your app a date picker and a time picker that match Google's Material Design guidelines. Android already provides built-in date and time pickers, but this library builds on that foundation and makes it easier to style them to fit your app's colors and theme. Adding the library to a project is done with a single line in your Gradle build file. Using it requires three steps: set up a listener so your code receives the chosen date or time, create a picker dialog using a factory method, and show that dialog. The library's API closely follows the standard Android pattern, so developers familiar with Android pickers will find it familiar. Theming is flexible. The pickers automatically pick up the accent color from your app's theme. You can also set a specific color in code, or override color resources in your project's XML files. There is a dark mode for both pickers that you can enable either in code or through an XML attribute. Two layout versions are included: one based on older Material Design era guidelines, and a second (the default) that matches the design Google introduced with Android Marshmallow. The library includes a broad set of configuration options: setting a minimum and maximum selectable date, blocking out specific dates or times, enabling a seconds picker in addition to hours and minutes, switching between 12-hour and 24-hour clock formats, and customizing the OK and Cancel button labels and colors. There is also a vibration toggle and a dismiss-on-pause option for handling app lifecycle events cleanly. The library supports Android 4.1 and above. It is published on Maven Central under the Apache 2.0 license and is available as a standard Gradle dependency. The README is detailed and covers each option with code examples.

Copy-paste prompts

Prompt 1
Show me how to add the wdullaer Material Date Time Picker to my Android project and open it when a button is clicked.
Prompt 2
How do I set minimum and maximum selectable dates in the wdullaer MaterialDateTimePicker?
Prompt 3
Apply dark mode and a custom accent color to the Material Date Picker in my Android activity.
Prompt 4
How do I block specific dates from being selectable in the wdullaer Material Date Picker?
Prompt 5
Show me how to get the selected date back into my activity from the wdullaer date picker callback.
Open on GitHub → Explain another repo

← wdullaer on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.