Open jerrylkc opened 2 years ago
I facing the same problem, I found that cause of the problem is onDraw()
method called before onLayout()
. The rect is unset in onDraw()
method, So the cicle will filling rect and you see it like oval shape.After a while it back to normal circle because it relayout and set correct width and height.
In my code, I delete invalidateDecorators()
called in onDateSelected()
.
widget.setOnDateChangedListener(new OnDateSelectedListener() {
@Override
public void onDateSelected(@NonNull MaterialCalendarView widget, @NonNull CalendarDay date, boolean selected) {
// widget.invalidateDecorators();
}
});
It's work for me.
when setTileWidth or setTileHeight, and setSelectedDate the first time we initialize the calendar, the selected circle expands to view width and height, like oval shape, but after a while, it returns to a normal circle.
I have tried using DayViewDecorator, and set setSelectionDrawable for custom drawable with fixed size, but no luck.