android-times-square icon indicating copy to clipboard operation
android-times-square copied to clipboard

Entire week rows are built during init

Open royale1223 opened this issue 11 years ago • 2 comments

I could see that if we're initializing a CalendarPickerView to select a date in the span of 100 years, 5000+ week rows are built at the same time. This creates a noticeable lag of 10+ seconds in an LG Nexus 4. This could be optimized to build only the visible rows at init and build the other rows as user scrolls.

royale1223 avatar Oct 10 '14 03:10 royale1223

This widget is definitely not intended for use with a 100 year window. We do all of the date math up front so that scrolling is as fast as it can be. That said, PRs welcome...if you're able to come up with a way to defer the date math and keep scrolling performance good, I'm all ears.

edenman avatar Oct 10 '14 20:10 edenman

As an alternative you might want to have a ViewPager with one page per-year. Scrolling through 100 years vertically isn't the best UX depending on how far you wanted to go.

JakeWharton avatar Oct 10 '14 20:10 JakeWharton