Xamarin.Android bindings for wdullaer/MaterialDateTimePicker
C#
Latest commit f1d8cb2 Jan 18, 2017 @alexsorokoletov committed on GitHub Merge pull request #1 from tossingc/features/refine-binding-metadata
added parameter names for TimePickerDialog.NewInstance(..)
Permalink
Failed to load latest commit information.
Additions Xamarin bindings for MaterialDateTimePicker Feb 29, 2016
Jars
Properties Xamarin bindings for MaterialDateTimePicker Feb 29, 2016
Screenshots
Transforms added parameter names for TimePickerDialog.NewInstance(..) Jan 17, 2017
.gitignore Initial commit Feb 29, 2016
LICENSE License added Feb 29, 2016
MaterialDateTimePickerBinding.csproj Xamarin bindings for MaterialDateTimePicker Feb 29, 2016
Readme.md
packages.config

Readme.md

What is it

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/

How to use this library (examples)

Three simple steps:

  1. Reference the bindings project in your app project (clone/copy/submodule/whatever)
  2. In your activity implement interface OnTimeSetListener/OnDateSetListener
  3. 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.

Demo

Material Date Time Picker in Xamarin.Android app