
Here is the new generation of Date as well Time pickers for Android. Previously only iOS used to have date and time pickers like this. But by using this library developed by Varahi Technologies Android also can have date time pickers same like iOS which is more user friendly.
For getting complete code of this Project open following link, download code and import it in your Android Studio.
GitHub Repository: https://github.com/pratikkulkarni3171/DateTimePicker
Following are the screens with its description for date time picker.




Date Picker Activity: This is the activity in which three loops are present for day, month and year view. Days are managed in a way such that if month have 28, 29, 30 or 31 days then for every change it’ll check for maximum days in month and it will change day loop accordingly.
For code of this Activity refer DatePickerActivity.java
Time Picker Activity: This is the activity in which four loops are present for hour, minute, second as well as meridiem. User can select any date as per requirements by just scrolling the wheels.
For code of this Activity refer TimePickerActivity.java


This Dialog can be launched by following code
public void openDatePickerDialog(View view) { DatePickerPopWin pickerPopWin = new DatePickerPopWin.Builder(MainActivity.this, new DatePickerPopWin.OnDatePickedListener() { @Override public void onDatePickCompleted(int year, int month, int day, String dateDesc) { Toast.makeText(MainActivity.this, dateDesc, Toast.LENGTH_SHORT).show(); } }).textConfirm("CONFIRM") //text of confirm button .textCancel("CANCEL") //text of cancel button .btnTextSize(16) // button text size .viewTextSize(25) // pick view text size .colorCancel(Color.parseColor("#999999")) //color of cancel button .colorConfirm(Color.parseColor("#009900"))//color of confirm button .minYear(1990) //min year in loop .maxYear(2550) // max year in loop .dateChose("2013-11-11") // date chose when init popwindow .build(); pickerPopWin.showPopWin(this); }
Time Picker Dialog: Time picker dialog has the same view as Time Picker Activity. After selecting time user will tap on confirm button. Once user confirms the time the dialog will disappear and it will return the time which user have selected.
This Dialog can be launched by following code
public void openTimePickerDialog(View view) { TimePickerPopWin pickerPopWin = new TimePickerPopWin.Builder(MainActivity.this, new TimePickerPopWin.OnTimePickedListener() { @Override public void onTimePickCompleted(int hour, int min, int sec, String meridium, String timeDesc) { Toast.makeText(MainActivity.this, timeDesc, Toast.LENGTH_SHORT).show(); } }).textConfirm("CONFIRM") //text of confirm button .textCancel("CANCEL") //text of cancel button .btnTextSize(16) // button text size .viewTextSize(25) // pick view text size .colorCancel(Color.parseColor("#999999")) //color of cancel button .colorConfirm(Color.parseColor("#009900"))//color of confirm button .build(); pickerPopWin.showPopWin(this); }