Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first time initialize the calendar, selected circle will expand to parent width and height #1128

Open
jerrylkc opened this issue Feb 22, 2022 · 1 comment

Comments

@jerrylkc
Copy link

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.

@Mor1995
Copy link

Mor1995 commented Apr 27, 2022

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants