I'm trying to modify the colors of a CalendarView on my Android native app.
I found some answers and I was able to modify the color of the numbers and week's days. However, I can't find the way to change the color of the month and the year in the header of the Calendar (I need to change these to White):
To change the colors of days and week, I used the following code in the activity:
<CalendarView
android:id="@+id/calendarViewRealizarReserva"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:background="@color/colorPrimaryDark"
android:theme="@style/Widget.CalendarView.Custom"
android:dateTextAppearance="@style/CalenderViewDateCustomText"
android:weekDayTextAppearance="@style/CalenderViewWeekCustomText"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/textViewRealizarReserva" />
And I edited the Style file adding the following code:
<style name="CalenderViewCustom" parent="Theme.AppCompat">
<item name="colorAccent">@color/colorAccent</item>
<item name="colorPrimary">@color/colorWhite</item>
</style>
<style name="CalenderViewDateCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/colorWhite</item>
<item name="android:weekNumberColor">@color/colorAccent</item>
<item name="android:headerYearTextAppearance">@color/colorWhite</item>
</style>
<style name="CalenderViewWeekCustomText" parent="android:TextAppearance.DeviceDefault.Small">
<item name="android:textColor">@color/colorWhite</item>
</style>
Do you have an idea to modify the color of the Month and Year?
The item android:textColorPrimary is the right one.
<style name="CalenderViewCustom" parent="Theme.AppCompat">
<item name="colorAccent">@color/colorAccent</item>
<item name="colorPrimary">@color/colorPrimary</item>
<item name="android:textColorPrimary">@color/red</item>
</style>