Hi.
I'm trying to set custom selection behaviour for my calendar in app, and I struggle with making the labels to stay the same and make a small ring around it appear. I've managed to set selection color to transparent, but the label also turns white and it's invisible like this.
Is there any way to set selected day label color?
Having the same issue.
I've used:
setSelectionColor() on the MaterialCalendarView, and setSelectionDrawable() on my Decorator, both seem to be ignored.
Ah. So the solution that worked for me was to add view.addSpan(new ForegroundColorSpan(Color.BLACK)) to my decorator.
You can just provide your own text appearance for the cells:
app:mcv_dateTextAppearance="@style/CustomTextAppearance"
with
<style name="CustomTextAppearance" parent="TextAppearance.AppCompat.Medium">
<item name="android:textColor">@color/mcv_text_date_light</item>
<item name="fontFamily">@font/shirkhand</item>
</style>
and mcv_text_date_light.xml:
<selector xmlns:android="http://schemas.android.com/apk/res/android"
android:enterFadeDuration="@android:integer/config_shortAnimTime"
android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item android:state_checked="true"
android:color="@android:color/white" />
<item android:state_pressed="true"
android:color="@android:color/white" />
<item android:state_enabled="false"
android:color="#808080" />
<item android:color="@android:color/black" />
</selector>
And we need to put mcv_text_date_light.xml in color directory of res res/color/mcv_text_date_light.xml of project.
I want to set a ForegroundSpan to a day (only today) and make it white when selected. Setting text appearance doesn't seem to work in this case. Is it possible?
Most helpful comment
You can just provide your own text appearance for the cells:
with
and
mcv_text_date_light.xml: