Date Pickers

From the Google Material Design documentation

A dialog picker is used to select a single date on mobile.

The selected day is indicated by a filled circle. The current day is indicated by a different color and type weight.

How to add?

I. In your build.gradle add latest appcompat library.

dependencies {  
    compile '' // where X.X.X version

II. Make your activity extend and implement the DatePickerDialog.OnDateSetListener interface.

public class MainActivity extends AppCompatActivity  
    implements DatePickerDialog.OnDateSetListener {

III. Create your DatePickerDialog setting a context, the implementation of the listener and the start year, month and day of the date picker.

DatePickerDialog datePickerDialog = new DatePickerDialog(  
    context, listener, startYear, starthMonth, startDay);

IV. Show your dialog with the method show of DatePickerDialog;  

How to style?

I. Declare custom drawable.xml for the dialog background.

<?xml version="1.0" encoding="utf-8"?>  
<!-- From: support/v7/appcompat/res/drawable/abc_dialog_material_background_light.xml -->  
<inset xmlns:android=""  

    <shape android:shape="rectangle">
        <corners android:radius="2dp" />
        <solid android:color="@color/indigo" />


II. Declare custom styles in your styles.xml file.

<style name="MyDialogTheme" parent="Theme.AppCompat.Light.Dialog.Alert">  
    <item name="colorControlNormal">@android:color/white</item>
    <item name="colorControlActivated">@color/pink</item>
    <item name="textColorAlertDialogListItem">@android:color/white</item>
    <item name="colorAccent">@color/pink</item>
    <item name="android:textColorPrimary">@android:color/white</item>
    <item name="android:windowBackground">@drawable/background_dialog</item>

III. Set your custom style as a parameter of the DatePickerDialog.

DatePickerDialog datePickerDialog = new DatePickerDialog(  
    this,, listener, 2016, 21, 3);

IV. Show your DatePickerDialog with the show method.;