History log of /frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8c5d3b45f6afa838e64e4cf011a385c191d557c6 04-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: fix crash and support scroll delta.

Fix crash of setSelectedPosition.
Add scroll delta that applied to setSelectedPosition.
Moved updateFirstVisibleOffset into StaggeredGrid class,
the offset is now calculated when inserting first visible item,
because the offset is needed when we append next visible item.
Fixed a loop variable bug in updateFirstVisibleOffset.

Added test cases

Bug 19272838
Bug 19593908

Change-Id: Ibb6f2e115e9e4af6a2b18a48a921e6766cd0c0a6
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java
77b17ebed6d1f8488b150b25e2b6754971480cae 10-Feb-2015 Dake Gu <dake@google.com> Do not scroll to non-focusable item

Refactoring to use same PendingMoveSmoothScroller for both
staggered case and non-staggered case (RowsFragment vertical).
The problem of position based linearsmoothscroller is that
it calculates target position before the view is created;
so we may scroll to a target position that is not focusable.
Now using PendingMovementSmoothScroller, added a callback
consumePendingMovementBeforeLayout() where we skip the view
that's not focusable.

Allow dispatchChildSelected() during scroll pass, so we can append
an item with selected state without running another layout pass if
we apply select status after laid out it. This requires a change
in StagggeredGrid to make data structure consistent before
dispatchChildSelected() call. To avoid excessive dispatchChildSelected,
we postpone dispatchChildSelected() if a PendingMoveSmoothScroller is
still running. We only dispatchChildSelected() event on the final target.

Fixed a problem of unbind RowView does not apply animator end value.

Added TestCases

Bug: 19283027

Change-Id: I5cab61420514b5d0141387aa13a18d623b38536f
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.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/StaggeredGrid.java
3e534fdedcd360d1dd5bcc51661d93f71e57b31e 10-Jan-2015 Dake Gu <dake@google.com> Fix wrong grid layout caused by not initialized offset.

When we append non-cached items to grid, the first visible item
created has a offset of 0. Then we prepend items with cache, which
will put the first prepended item at the same location of current
first visible item.

Bug 18963829

Change-Id: I174c995ff05acc8492c938bb67a7d4b993629272
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.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/StaggeredGrid.java
e0e66a21916f94ebbced0d1ffe3dc652c9c7a15e 10-Dec-2014 Kris Giesing <kgiesing@google.com> Fix various RTL issues related to multi-row grid views

Also fix some RTL issues related to grid views that do not wrap content

b/18631342

Change-Id: Ibc52057375c24409dacd7af3fb1e487d022b9ff8
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java
79b86b227e6794937ec311522b50e727f8eec263 04-Jun-2014 Dake Gu <dake@google.com> GridLayoutManager: scroll limit check

ScrollMin/Max are only updated when we added first/last
view or where fastRelayout may change first/last view position.

It's not necessary to invalidate the first/last view position
in every layout pass since most time they are the same.

however, we should invalidate scrollmin/max when the first/last
is not visible yet but current visible items already grow out
of the scrollmin/max range.

Tested on TV and tablet.

TODO: scrollMin/Max on secondary axis.

b/15414917

Change-Id: I125025a5865df69316dadc612b52b67d8f27a250
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java
adc2a01f5701cbcc044754119b572abcf31c7c5f 26-Mar-2014 Dake Gu <dake@google.com> GridLayoutManager: support paged focus scrolling

- FOCUS_SCROLL_ALIGNED this is what we currently have:
keep focused aligned.
- FOCUS_SCROLL_PAGE scroll page by page
- FOCUS_SCROLL_ITEM scroll item by item

Changed default BrowseRowView horizontal scrolling to use
FOCUS_SCROLL_PAGE.

Change-Id: Idc4cc2e7d4833cf9b24c8c9505b03e945667af59
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java
8b068ddbbf22a246eab49ec25a2f7c3abfbdca51 16-Mar-2014 Tim Kilbourn <tkilbourn@google.com> Add a .readme file to be copied into the sdk src.

This allows the project resources to be built by ant/eclipse.
Also moved default source code dir to src instead of java/src.

Change-Id: I9e5002fbbfb96b98be772c1ec6653322d5563b56
/frameworks/support/v17/leanback/src/android/support/v17/leanback/widget/StaggeredGrid.java