HorizonCalendar icon indicating copy to clipboard operation
HorizonCalendar copied to clipboard

DayRangeIndicatorView not smooth scrolling

Open novpeter opened this issue 4 years ago • 3 comments

Hi Airbnb Team, I faced with DayRangeIndicatorView problem. When user selects huge date range, for example multiple years, the scroll starts working not smooth. Along with this, there is a jump in RAM consumption. In some moment of scrolling area with selected date range a ton of messages appear in console and selection view disappears. I have the same problem with your demo project.

CoreAnimation: failed to allocate 38375488 bytes
CoreAnimation: failed to allocate 38375488 bytes
CoreAnimation: failed to allocate 38375488 bytes
CoreAnimation: failed to allocate 38375488 bytes

Below the screen recording

https://user-images.githubusercontent.com/26308259/106892167-bc303600-66fc-11eb-94a7-5425d7f57e20.mp4

novpeter avatar Feb 04 '21 12:02 novpeter

This is indeed a limitation of the current day range architecture. I'm sorry you're running into this!

The root problem is that day range indicator views are set up to cover the entire bounds of the day range, which as you've discovered, can be so large that UIKit will actually fail to render the UIView.

The solution will be a new API (that's similar to the current one) but it segments the drawing for the day range into multiple smaller pieces, rather than one giant piece. Let me do some thinking on this and get back to you in a week... I'd love to have this fixed in the 2.0 release, which I'm working toward currently.

bryankeller avatar Feb 05 '21 07:02 bryankeller

Thank you for response! Really waiting for it

novpeter avatar Feb 05 '21 08:02 novpeter

Hey @bryankeller , any word on this fix? I'm running into the same issue....

GeorgeCremer avatar Aug 06 '22 11:08 GeorgeCremer