[ChromeHome] Only attach suggestions adapter to the RecyclerView while the sheet is opened.
When the bottom sheet is closed, set its adapter to null, which clears the view (and recycles all the view holders inside it), to reduce the memory overhead of the views (which potentially hold large bitmaps) while the sheet is closed. The adapter itself is still around and holds on to the model, so it can be reattached when the sheet is opened again. The model caches bitmaps only via discardable references, which it will drop under memory pressure. Bug: 718925 Change-Id: I58510bc831a35f15d831915ba9fc47f929253978 Reviewed-on: https://chromium-review.googlesource.com/562136 Commit-Queue: Bernhard Bauer <bauerb@chromium.org> Reviewed-by:Nicolas Dossou-Gbété <dgn@chromium.org> Cr-Commit-Position: refs/heads/master@{#485293}
Showing
Please register or sign in to comment