title: How to prevent select passed date in DatePickerDialog (setMinDate not work as expected)
body: <p>I found DatePicker(Dialog) very confusing... 
  When setMinDate() is set... the shown calendar really "visually disable" passed dates (make them gray) but these dates are still posible to select! I want to user prevent to do so. Ideal way would be make passed dates non-clickable / unselectable. If it is not possible, than at least catch this event (which one?  onDateChanged?, onSelected? ...) and toast a message and disable OK button until user selects a valid date. </p>
  
  <p>Unfortunatelly, datepicker(dialog) has no onChangedListener (actually it has but has no setter for it). So the only event I get is on OK button pressed. It is too late.</p>
  
  <p>Here is my code</p>
  
  <pre><code>    dateTextView = (TextView) view.findViewById(R.id.createOrder_date);
      dateTextView.setText(R.string.createOrder_time_now);
      dateTextView.setOnClickListener(new View.OnClickListener() {
  
          @Override
          public void onClick(View v) {
              final Calendar calendarNow = Calendar.getInstance();
              final int yearNow = calendarNow.get(Calendar.YEAR);
              final int monthNow = calendarNow.get(Calendar.MONTH);
              final int dayNow = calendarNow.get(Calendar.DAY_OF_MONTH);
  
              DatePickerDialog datePickerDialog = new DatePickerDialog(CreateOrderFragment.this.getActivity(), new DatePickerDialog.OnDateSetListener() {
                  @Override
                  public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
                      Calendar calendar = Calendar.getInstance();
                      calendar.set(year, monthOfYear, dayOfMonth);
  
                      if (calendar.before(calendarNow)) {
                          Toast.makeText(CreateOrderFragment.this.getActivity(), getResources().getString(R.string.createOrder_datePicker_selectFutureDate), Toast.LENGTH_SHORT).show();
                          view.updateDate(yearNow, monthNow, dayNow);
                          calendar = calendarNow;
                      }
  
                      SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
                      dateTextView.setText(sdf.format(calendar.getTime()));
                  }
              }, yearNow, monthNow, dayNow);
  
              datePickerDialog.getDatePicker().setMinDate(System.currentTimeMillis() - 1000);
              datePickerDialog.setTitle(getResources().getString(R.string.createOrder_datePicker_title));
              datePickerDialog.show();
  
          }
      });
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/FXAoS.png" alt="enter image description here"></p>