This is a Xamarin.Android bindings for "Material DateTime Picker" from @wdullaer
More information: http://sorokoletov.com/2016/02/29/material-date-time-picker-available-for-xamarin-android-apps-bindings/
Three simple steps:
- Reference the bindings project in your app project (clone/copy/submodule/whatever)
- In your activity implement interface OnTimeSetListener/OnDateSetListener
- Create a datepicker and show it
Basically these steps are described in the Readme.md file of the original library
//implement OnDateSetListener
public class HomeView : BaseActionBarView<HomeViewModel>,
Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog.IOnDateSetListener
private void OnChooseDateButtonClick(object sender, EventArgs e)
{
Java.Util.Calendar now = Java.Util.Calendar.Instance;
Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog dpd =
Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog.NewInstance(
this,
now.Get(Java.Util.CalendarField.Year),
now.Get(Java.Util.CalendarField.Month),
now.Get(Java.Util.CalendarField.DayOfMonth)
);
dpd.Show(FragmentManager, "Datepickerdialog");
}
public void OnDateSet(Com.Wdullaer.Materialdatetimepicker.Date.DatePickerDialog p0, int p1, int p2, int p3)
{
p0.Dismiss();
}
Make sure you are using the same version (23.1.1) of Xamarin.Android.Support.v4 package in your application project.