Is possible to hide arrows and put some imageView between title of calendar and weekdays?
See original GitHub issueFirst thanks for the component, is excellent and very complete.
I have some questions about usage of your MaterialCalendarView:
-
How to hide arrows?
-
How to put some ImageView between title of calendar and weekdays?
-
How to set default drawable for selected item?
com.prolificinteractive.materialcalendarview.MaterialCalendarView android:id=“@+id/calendarView” android:layout_width=“match_parent” android:layout_height=“wrap_content” android:layout_marginTop=“10dp” xmlns:app=“http://schemas.android.com/apk/res-auto” app:mcv_showOtherDates=“out_of_range” app:mcv_dateTextAppearance=“@style/TextAppearance.DayText” app:mcv_headerTextAppearance=“@style/TextAppearance.TitleText” app:mcv_weekDayTextAppearance=“@style/TextAppearance.WeekdayText”/>
I’ve set @drawable/calendar_day_selector by default, but my day cell still have circle cyan background:
<style name="TextAppearance.DayText" parent="android:TextAppearance.DeviceDefault.Small"> <item name="android:textSize">16sp</item> <item name="android:textColor">@color/calendar_day_text_color</item> <item name="android:background">@drawable/calendar_day_selector</item> </style>My calendar_day_selector.xml: <selector xmlns:android="http://schemas.android.com/apk/res/android" android:exitFadeDuration="@android:integer/config_shortAnimTime">
<item
android:state_checked="true"
android:drawable="@drawable/calendar_day_selected"
/>
<item
android:state_pressed="true"
android:drawable="@drawable/calendar_day_selected"
/>
<item android:drawable="@android:color/transparent" />
</selector>
My calendar_day_selected.xml:
<?xml version="1.0" encoding="UTF-8"?><shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle">
<stroke android:color="@color/blue_color_1" android:width="2dp"/>
<solid android:color="@android:color/transparent"/>
</shape>
I’ve use Decorator for specific days. And it works perfectly:
public class CalendarDayDecorator implements DayViewDecorator{
private Context context;
private final Set<CalendarDay> dates;
public CalendarDayDecorator(Context context, Set<CalendarDay> dates) {
this.context = context;
this.dates = new HashSet<CalendarDay>(dates);
}
@Override
public boolean shouldDecorate(CalendarDay day) {
return dates.contains(day);
}
@Override
public void decorate(DayViewFacade view) {
view.setSelectionDrawable(ContextCompat.getDrawable(context, R.drawable.calendar_day_selector));
view.addSpan(new ForegroundColorSpan(ContextCompat.getColor(context, R.color.gray_color)));
}
}
But I want the same selector (R.drawable.calendar_day_selector) for all days.
Thanks in advance.
Issue Analytics
- State:
- Created 8 years ago
- Comments:8 (5 by maintainers)
setTopbarVisible(false)
shouldDecorate()
always return true. Decorator ordering matters, so decorators you can override the selector with another decorator.@anivaler you can use
setShowOtherDates()
to show disabled dates. This will draw them in a disabled state, which can be customized with a custom TextAppearance with a custom textColor. You can read more about it in the documentation