Read tab thumbnails on demand in TabGridLayoutAndroid
When using two-stage thumbnail fetching with THUMBNAIL_PROVIDER and THUMBNAIL_KEY, we populate the Java side cache with thumbnails from all the tabs, and then consume them when scrolling the recycler view. This causes a few issues. 1) Instead of reading what's visible first, it reads all the tabs, causing more delay and wasting power. 2) If the number of tabs exceeds the cache capacity, some of them would be evicted, and missing from the UI. This CL replaces THUMBNAIL_PROVIDER and THUMBNAIL_KEY with THUMBNAIL_FETCHER, and removes the Java side cache. THUMBNAIL_FETCHER fetches the thumbnail on demand when it is about to be visible. Bug: 930929 Change-Id: I5ef2e3c87db99240bed76419fb8149ec4212cf6a Reviewed-on: https://chromium-review.googlesource.com/c/1490440 Commit-Queue: Yusuf Ozuysal <yusufo@chromium.org> Reviewed-by:Yusuf Ozuysal <yusufo@chromium.org> Cr-Commit-Position: refs/heads/master@{#636156}
Showing
Please register or sign in to comment