diff --git a/library/src/main/java/com/wdullaer/materialdatetimepicker/supportdate/SupportDatePickerDialog.java b/library/src/main/java/com/wdullaer/materialdatetimepicker/supportdate/SupportDatePickerDialog.java index 140fb0ef..1eb8ae73 100644 --- a/library/src/main/java/com/wdullaer/materialdatetimepicker/supportdate/SupportDatePickerDialog.java +++ b/library/src/main/java/com/wdullaer/materialdatetimepicker/supportdate/SupportDatePickerDialog.java @@ -315,9 +315,6 @@ public View onCreateView(LayoutInflater inflater, ViewGroup container, setToNearestDate(mCalendar); mDatePickerHeaderView = (TextView) view.findViewById(R.id.mdtp_date_picker_header); - if(headerTypeface != null){ - mDatePickerHeaderView.setTypeface(headerTypeface); - } mMonthAndDayView = (LinearLayout) view.findViewById(R.id.mdtp_date_picker_month_and_day); mMonthAndDayView.setOnClickListener(this); mSelectedMonthTextView = (TextView) view.findViewById(R.id.mdtp_date_picker_month); @@ -387,7 +384,12 @@ public void onClick(View v) { if (mAccentColor == -1) { mAccentColor = Utils.getAccentColorFromThemeIfAvailable(getActivity()); } - if(mDatePickerHeaderView != null) mDatePickerHeaderView.setBackgroundColor(Utils.darkenColor(mAccentColor)); + if(mDatePickerHeaderView != null) { + mDatePickerHeaderView.setBackgroundColor(Utils.darkenColor(mAccentColor)); + if(headerTypeface != null){ + mDatePickerHeaderView.setTypeface(headerTypeface); + } + } view.findViewById(R.id.mdtp_day_picker_selected_date_layout).setBackgroundColor(mAccentColor); // Buttons can have a different color @@ -535,6 +537,9 @@ private void updateDisplay(boolean announce) { if (mVersion == Version.VERSION_1) { if (mDatePickerHeaderView != null) { + if(headerTypeface != null){ + mDatePickerHeaderView.setTypeface(headerTypeface); + } if (mTitle != null) mDatePickerHeaderView.setText(mTitle.toUpperCase(Locale.getDefault())); else {