f923d595ace34894c49d1609d3c629336b175b89 |
|
17-Jun-2015 |
Dake Gu <dake@google.com> |
Leanback: use SingleRow for most widgets Use a simple SingleRow module for single row case. Improves both memory and cpu. b/21898578 Change-Id: I7aa235d343c87a87e66bac4d3209a194262e6e87
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
|
85df3117f0fcd0aa10d7bd45194dab97e22112f2 |
|
14-Jan-2015 |
Dake Gu <dake@google.com> |
Fixed three bugs causing redundant remove and append 1. When checking overlimit, should take margin into consideration. 2. Fixed a bug in findRowMax, should only use edge of last item in that row. 3. appendItems should check overlimit before add item when oneColumnMode is false, both withcache and withoutcache. Also added test case for move items Bug: 19017080 Change-Id: I6594c9158b186449739eb284c4607df7803e2049
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
|
6e96b9d46e7af6bedf6213ecc2ba0ad7b8050778 |
|
18-Dec-2014 |
Dake Gu <dake@google.com> |
Refactoring grid algorithm The current interface between GridLayoutManager and StaggeredGrid is too complicated: GridLayoutManager updates rows min/max edge and Grid is responsible for fill items according to row min/max edge. This CL moved most of the grid code into Grid class family and make interface between GridLayoutManager and Grid much simpler. GridLayoutManager no longer updates row min/max. Refactoring made it possible to write efficient Grid class for single row or non staggered grid. A base Grid class is abstracted out. StaggeredGrid implemented it using a complicated data strurcture (a CircularArray) to cache stagger layout result. A single row Grid will cost less memory allocations: a TODO in the near future. fastRelayout() was rewriten slightly differently, it will relayout (using detachFromParent and attachToParent) next children once detects child size change, previously we push children away on the same row which might cause a bad alignment at end. Regular layout now starts with detachAndScrapAttachedViews(), this is lighter than removeAndRecycleAllViews() which may lose some views due to cache limit. Prepend/append during scroll now also detects if child size changed, then invalidate cached staggered result before/after the child. Improvement during adapter notifyChange or structure change, now we no longer discard grid information in a non-fast relayout case. We still keeps the same cached staggered result, until we really find size of a child has changed then we invalidate part of the cache. Tested with BrowseFragment/HorizontalGridTestActivity/ VerticalGridActivity/BrowseAnimationActivity and with rtl=true/false. Issue: 18946733 Change-Id: Ia0cfa34ad8d09c124dbffe51680a89f177bfef31
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
|