History log of /frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
5723e456309c09c31054d29187fd26b6e2b760ef 17-Jun-2017 Dake Gu <dake@google.com> DO NOT MERGE leanback: fix fastRelayout for extra views added in preLayout

Then in post layout pass, fastRelayout() should invalidate after
the item that position is inconsistent with Grid position.
Previously this was relying on didStructureChange(), it is now
no longer safe to do so when prelayout may add items before first
child.

Bug: 62727612
also no longer reproduce Bug 36738635 after this change
Test: testMoveIntoPrelayoutItems

Change-Id: If67f6697b21c132ed5934bdc0fc2790ac4aae32c
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
c50aca4940c8ae508393278aa7a9c77a3f93f87d 26-May-2017 Dake Gu <dake@google.com> leanback: fix predictive animation move

1. When move items out, we need use addDisappearingView to
tell recyclerview to slide them out and those views will
not be pruned by scroll pass. This is done by adding
scrapList views in post layout fillDisappearingItems()

2. When move items out, we need check if item is moving
out side old adapter's range, prelayout needs layout extra
space for these cases.

Bug: 38339297
Test: testDontPruneMovingItem testMoveItemToTheRight
testMoveItemToTheLeft

Change-Id: I6e2c4ffeb8befb62f060247bb6c5345dc8f6bab7
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
134b0891c25facf14c53ef939846010284025ca9 20-May-2017 Dake Gu <dake@google.com> leanback: support predictive animation

1. supports predictive animation
2. no longer abort scrolling upon state.didStructureChange() is true.
So scroll animation will continue while item animation is running.

Bug: 38339297
Test: GridWidgetTest

Change-Id: If5b4a05e3dca9946395dd19204c2fcd59fa7a824
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
e36e2ce16cbd6144ccd49e0b90ae4c587a08c8f3 10-Apr-2017 Dake Gu <dake@google.com> leanback: switch to use getAdapterPosition() for accessbility node

Disappearing ITEMs that were pushed out of the RV due to inserting
other items will crash when onLeftHiddenState changes
importantForAccessibility to yes. The item's viewLayoutPosition is
invalid, so we should use AapterPosition which will return -1 and
onInitializeAccessibilityNodeInfoForItem will bail out.

This bug will happen on any LM which does not support preLayout uses
viewLayoutPosition in onInitializeAccessibilityInfo.

Bug: 37096264
Test: testAccessibilityNodeInfoOnRemovedLastItem
testAccessibilityNodeInfoOnRemovedFirstItem
simulatesAccessibilityOfItemsBeingPushedOut
testAccessibilityOfItemsBeingPushedOut

Change-Id: I2804b5b55f2cbc917155cf8b902b9487f65b8e28
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
cf2ed161d09de8af108dfa9775b2d4449d46306a 25-Jan-2017 Chris Craik <ccraik@google.com> Initial prefetch support for leanback's GridLayoutManager

Bug: 32981813
Test: new tests passing

Prefetch 1 row/column, without nested support yet.

Change-Id: I7bd467e5176791d68002c98d663ee637b5e0d3d9
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
ef4e1b371215f9fffa9245159250740b611dfb4d 01-Aug-2016 Dake Gu <dake@google.com> leanback: use android attr vertical/horizontalSpacing

Follow the name convension of android, call the space between grid
item "verticalSpacing" and "horizontalSpacing". Deprecate the old
customized attribute verticalMargin and horizontalMargin.

Change-Id: Id5a1efdb9ce2f1062abd62d501869d2b0310a5c9
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
5642066d798fb95368c66e78bcd70644552a98b2 26-Jul-2016 Dake Gu <dake@google.com> leanback LM: Fix unnecessary prepended when there is margin

Also converted Grid test cases to use AndroidJUnit4.

Bug 30404474

Change-Id: Ia4a5b2d625a445ebb4db847a2ba5fcca9d47a9c1
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
c9a859537b0871f84afeeb706a5b425fe3f2b4dd 25-May-2016 Aurimas Liutikas <aurimas@google.com> Fix a random assortment of spelling errors.

Fix spelling errors found by Android Studio.

Change-Id: I121c79029f4e323da4ff2f44891e25480c44ebbc
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/Grid.java
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