I need to change the background white color of calendarDatePicker in android. I have tried so many links in SO. but nothing worked for me. So please share with me if you have any ideas. I know this is a duplicate question. but my requirement is completely different. that's why I post question here. need to change the light grey color to what color i want
this is my calendar activity
public void calenderPicker() {
Calendar date = Calendar.getInstance();
CalendarDatePickerDialog calendarDatePickerDialog = CalendarDatePickerDialog.newInstance(Personal.this, date.get(Calendar.YEAR), date.get(Calendar.MONTH),
date.get(Calendar.DAY_OF_MONTH));
calendarDatePickerDialog.show(getFragmentManager(), FRAG_TAG_DATE_PICKER);
}
this is my onDateset()
@Override
public void onDateSet(CalendarDatePickerDialog calendarDatePickerDialog, int year, int monthOfYear, int dayOfMonth) {
}
User Raghunandhan pointed out exactly in comments where you have to change the background color exactly.
As he told you to look out this github post.Moreover you can implement this in your project.
In datetimepicker-library/res/layout/date_picker_selected_date.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@id/day_picker_selected_date_layout"
android:layout_width="@dimen/date_picker_component_width"
android:layout_height="0.0dip"
android:layout_weight="1.0"
android:background="#C689F5" //change the background color for your requirement
android:gravity="center"
android:orientation="vertical">
.........
.........
</LinearLayout>
Output:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With