title: Change DatePicker background color
body: <p>I am trying to display a <code>DatePicker</code> dialog on top of another activity and what is happening is it is somehow inheriting its color. </p>
  
  <p>I'd like it to have a green header and white background, 
  <img src="https://i.stack.imgur.com/1WP4d.png" alt="like on this example"></p>
  
  <p>Here is excerpt from styles</p>
  
  <pre><code>&lt;style name="DatePickerDialog" parent="@android:style/Theme.Holo.Light"&gt;
      &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt;
      &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
      &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
      &lt;item name="colorAccent"&gt;@color/primary&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And this code is used to pop up the <code>DatePicker</code></p>
  
  <pre><code>    DatePickerDialog datepicker = new DatePickerDialog(this, R.style.DatePickerDialog, new DatePickerDialog.OnDateSetListener() {
  
          public void onDateSet(DatePicker view, int year, int monthOfYear, int dayOfMonth) {
              TextView newdate = (TextView) findViewById(R.id.newdate);
              Date date = getDate(year, monthOfYear, dayOfMonth);
              DateFormat dateformat = new SimpleDateFormat(getResources().getString(R.string.date_format_full));
              newdate.setText(dateformat.format(date));
          }
      }, newCalendar.get(Calendar.YEAR), newCalendar.get(Calendar.MONTH), newCalendar.get(Calendar.DAY_OF_MONTH));
  
      datepicker.show();
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/Ld6gp.png" alt="However it instead is displayed in all green"></p>
  
  <p>If I specify the white background in the styles, <img src="https://i.stack.imgur.com/XQZXd.png" alt="it overrides the header and the buttons as well"></p>
  
  <pre><code>    &lt;item name="android:background"&gt;@color/app_background&lt;/item&gt;
  </code></pre>
  
  <p>One last thing I've tried is to use <code>AlertDialog.THEME_DEVICE_DEFAULT_DARK</code> as the <code>DatePicker</code> theme </p>
  
  <pre><code>DatePickerDialog datepicker = new DatePickerDialog(this, 
  AlertDialog.THEME_DEVICE_DEFAULT_DARK, new 
  DatePickerDialog.OnDateSetListener() 
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/2Xbs7.png" alt="But it&#39;d still display the whole dialog in green"></p>
  
  <p>Here is the style of the activity I am opening the dialog from</p>
  
  <pre><code>&lt;style name="UserDialog" parent="android:style/Theme.Dialog"&gt;
      &lt;item name="android:windowFrame"&gt;@null&lt;/item&gt;
      &lt;item name="android:windowIsFloating"&gt;true&lt;/item&gt;
      &lt;item name="android:windowIsTranslucent"&gt;true&lt;/item&gt;
      &lt;item name="android:background"&gt;@color/primary&lt;/item&gt;
      &lt;item name="android:textColor"&gt;@color/dialog_text&lt;/item&gt;
      &lt;item name="colorPrimary"&gt;@color/app_background&lt;/item&gt;
      &lt;item name="android:windowTitleStyle"&gt;@style/NewDialogTitle&lt;/item&gt;
  &lt;/style&gt;
  
  &lt;style name="NewDialogTitle" parent="@android:style/TextAppearance.DialogWindowTitle"&gt;
      &lt;item name="android:gravity"&gt;center_horizontal&lt;/item&gt;
  &lt;/style&gt;
  </code></pre>
  
  <p>And the colors I am using</p>
  
  <pre><code>&lt;color name="primary"&gt;#4CAF50&lt;/color&gt;
  &lt;color name="app_background"&gt;#FFFFFF&lt;/color&gt;
  </code></pre>
  
  <p>Does anyone know how to get it done? I'd appreciate any guidance. I've tried to follow <a href="https://stackoverflow.com/questions/28738089/change-datepicker-dialog-color-for-android-5-0">this answer, but had no luck</a></p>