Hi,
I'm adding calender items dynamically, however when adding a new item (on a different view pager tab) and returning to the calender, despite calling invalidateDecorators() it will not update and show a dot decorator on the newly entered date?
Thanks!
Hi @xbroak, could you explain further how you are adding items to the calendar?
This could also be because of how you are updating the non-visible tab so I would check that too.
Hi, Sorry about the late response, i am adding items to a Realm database which works fine.
http://share.joescott.me/13db5.png
When reloading the fragment the calender is on, the dots appear as intended, my problem is refreshing the calender dynamically once i've added an item on another screen to the database (and serve an event to the calender to refresh) which calls cal.invalidateDecorators(); however it does not update.
Saying that, it appears i may have a solution, it's a shame to have to do it this way though?
cal.removeDecorators();
cal.addDecorator(new DaySelectorDecorator(getActivity()));
cal.addDecorator(new EventDecorator(getResources().getColor(R.color.ColorPrimaryDark), realmToCalender(realmHelper.getUserEntries())));
Basically, just remove all the decorators and add them again!
I am also facing the same issue. I have a lot of different types of decorators so @xbroak solution seems too much overhead to implement.
It is working now. The issue was in that emulator instance. running perfectly in another emulator and real device.
Most helpful comment
Saying that, it appears i may have a solution, it's a shame to have to do it this way though?
Basically, just remove all the decorators and add them again!