History log of /frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e2443a93fcb82151f5290b89617b34b69442fdd3 29-Mar-2016 Dake Gu <dake@google.com> leanback: switch to use helper methods for margins

Switch to use RecyclerView helper methods with margin support.
Added test cases for optical bounds used together with margins and
item decoration.

Change-Id: I021a4f1c6c6c777845a7379fd8c23a128a13356c
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
5509e275a04396bfb16b3a217c5392a864398174 25-Mar-2016 Dake Gu <dake@google.com> leanback: Fix ItemDecoration

1. We should skip the optimizaton of checking isLayoutRequested()
Because when child view's decoration changes, it will not
be layout requested.
2. calculate opticalInsets is wrong, it doesn't count the decoration
offset, so incorrectly put decoration insets as optical insets.

Bug 27794028

Change-Id: Ide4f907764a4f35507c32ba3db764f8ad4ccd090
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
936fd406f49a6fae8768084e84fa7d1beccf40a9 19-Mar-2016 Dake Gu <dake@google.com> leanback: Fix selection offset when restoring gridview

We add offset to selected position in onItemAdded, this
should be avoided before LM layout children.

Bug 27819090

Change-Id: I299832c491bff19846f1f7bacda01ecb8ea685ea
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
362fda0323b85ec2379967901a0bd33a2ad4b8b5 25-Feb-2016 Dake Gu <dake@google.com> leanback: customize focusables in secondary direction

When the focus search direction is PREV_ROW or NEXT_ROW,
we fall back to default addFocusables() which basically
add all children and descendants within RecyclerView.

This isn't the default behavior desired when navigating LEFT
out of a vertical list, we do not want the siblings of
current focused item to be part of focusables list.
Because the siblings might got a higher score in FocusFinder.

In the broken case (a modified browse row moves first card to
the middle when it gets focused), sibling browse row's first
card gets a higher score than left side navigation menu because
they are closer to current focused card.

This fix explicitly handles PREV_ROW and NEXT_ROW case
and overrides default addFocusables(), it wont add siblings when
they are on same grid ROW.

Bug 27258366

Change-Id: I2e11cea7bc8e370fbda0be1dc5ccccb587a3fb43
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
e2f2ff730ed20153aa006d655888190763c16d5c 17-Feb-2016 Dake Gu <dake@google.com> Fix crash: Dont fetch items in onMeasure when HasFixedSize is true

With new RV change, HasFixedSize=true hehavior has been defined as:
RV size is not determined by child size. So when HasFixedSize is
true, the items passed to onMeasure() are no longer valid and should
not be used. Though HasFixedSize=true is generally not allowed when
WRAP_CONTENT is used, add extra protection.

Bug 27202689

Change-Id: Ic1e30674588227988621f7802692a1f12eeac3d7
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
f7726a8422c64f43180291a0f660d3ed065e0f9e 04-Dec-2015 Dake Gu <dake@google.com> Leanback: Fix test

Bug 26027406

Change-Id: Ic897a6c53a62b2cfae29ce28ca15e63ba0c3daaa
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
00e05297683e1cc2a5fb25a00632a778b7b5d0e4 10-Nov-2015 Dake Gu <dake@google.com> GridLayoutManager: fire selected event when selected item type changed

Not only compare focused position but also compare the focused View that might
changed in fastLayout pass.

Bug 25619502

Change-Id: Ib59c8d753224daf23667d2f6ebd9a1babad61eb4
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
89b4aed6fcd80f940531e265936ab908a8037f87 22-Jul-2015 Dake Gu <dake@google.com> GridView: fix two focus problems

1. if gridView has a list of children and gridView.requestFocus()
is called from top-down which is a typical case when activity
created: gridview should auto focus to first focusable child.

2. When none of visible children is focusable and gridview itself
is focused, focusSearch(int) should navigate to first focusable
child.

b/22634251

Change-Id: I345119c47f0d70029e18eb8405ed67a53bc26fe8
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
ff3b38c570fa25327bb6a9bca1753827d9f9d7fd 08-Jul-2015 Dake Gu <dake@google.com> GridLayoutManager: Fix scroll bug when target view is removed.

When item is removed, we should stop scroll animation and scroll to
a new focus position or same focus position of different item.

b/21970393

Change-Id: I3917adbbed7dd1599f93a5459c7f4bfc3bbac7c6
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
08c56822b71ab0aa0b9bb03e5fd45e28f6e358b8 28-Apr-2015 Dake Gu <dake@google.com> Revert "Revert "Support multiple alignment within one ViewHolder""

This reverts commit bc0edc3ab9bac3c8d7d3cc9de1cb499ea3b4155e.

Change-Id: I1f9540e54fdee874adf7239a0ead1fb5447f2610
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
bc0edc3ab9bac3c8d7d3cc9de1cb499ea3b4155e 27-Apr-2015 Dake Gu <dake@google.com> Revert "Support multiple alignment within one ViewHolder"

This reverts commit 86a6309c3e89ec6abc40ec045bfaef7827cbe427.

Change-Id: I3385d74766e948566b7321cbe2afcf31a66282c1
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
86a6309c3e89ec6abc40ec045bfaef7827cbe427 07-Apr-2015 Dake Gu <dake@google.com> Support multiple alignment within one ViewHolder

Add support of align to multiple positions within one ViewHolder of
Grid View.

Introduce "FacetProvider" inteface for optional features to be implemented
without requiring an object must implement a java interface. Benefit
is less impact on the major feature of a class, make the extra optional
features loosely coupled with existing class. (And it is the only way
for ItemBridgeAdapter to provide a list of optional features that
are implemented by some Presenters but not others)

Add a new ItemAlignmentFacet class to describe multiple alignment positions.

Grid view gets optional ItemAlignmentFacet from RecyclerView.ViewHolder(rare)
or RecyclerView.Adapter for a given view type. If the facet exists, it's used
to calculate multiple alignment positions within this ViewHolder.

At high level, for apps that using Presenter, they don't directly use
RecyclerView.ViewHolder or RecyclerView.Adapter. apps put Facet in Presenter
(most cases) or a ViewHolder(rare cases). For example in the new detail page
design, DetailsOverviewRowPresenter will need this facet(TODO),
ItemBridgeAdapter is responsible to "bridge" facet from Presenter.

In the future, Facet may be used to customize child view state saving.

Bug: 20094419

Change-Id: Iabef94e46f9a304ffd68e49bed10e74a57dfe4ce
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
3bd331ac6fe8ef25a2deb3559b0b5958573c231b 26-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager Fix child state restoring bug

A regression of ag/630154: detached and reattached child is
assigned with obsolete state saved at opening activity.

The (correct) logic is now:
1. Child state is saved when child is unbound (onViewRecycled)
2. When being asked for onSaveInstanceState(), copy the states
saved in (1) and save current onscreen views state into bundle.

Bug in ag/630154 is that in (2) we saved onscreen views state in
the GridView offscreen states and that information can be invalidated
after a while (e.g. selection of a row can change) and it's later
incorrectly used when a view is detached/re-attached.

added test case.

Bug 19937291

Change-Id: Iac6bd849fdd9755471bce6c7763316d0264cc7a2
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
1a5a2c58890e69b0554a82f22e3c0d1ffb238366 25-Mar-2015 Dake Gu <dake@google.com> Fix crash when calculated secondary size is 0

If for some reasons, parent of GridView asks to measure with 0 secondary size,
calculated mFixedRowSizeSecondary is zero and the array for maintaining the
secondary size of each row is also null. Then processRowSizeSecondary()
will crash.

Bug 19930906

Change-Id: Ifa45ee94cda133830a0e78b563df5edeeaff9c3f
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
c0b265dd2df42b399ba1f959b3dfd14dd14012b5 25-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: Fix focus bug

During layout, when a view already had focus.
Should not call requestFocus() again which might
change the focused child within it.

Bug 19828044

Change-Id: I97074469d9e4fbcc8f45cd8c738200b7faba00a5
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
57f5baa07260dad2a9641e9ceb80567ce2784e9a 21-Mar-2015 Dake Gu <dake@google.com> Fix setNumRows gets ignored

setNumRows goes through onMeasure() then onLayout().
Before the onMeasure() gets called, another onLayout()
clears the mForceFullLayout flag without knowing
there is a pending numRows change not handled by onMeasure()
yet. When 2nd onLayout() gets called, it doesn't go to the
non fastlayout pass.

There is no need to set the flag when change num rows,
comparing with grid row number can decide if goes through
fast layout pass.

Bug 19872498

Change-Id: Ia5254a49e24be04665a1e5175355827a5dfa7258
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
3a7aa9cd68bd39f3a843291817dc209d1d9a45aa 20-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: fix bug smoothscroller gets interrupted

Vertical scroll in Videos app is janky.

During VerticalGridView scroll pass it appends a row and layout
the row, the row layout might request focus on a child, that causes
a onRequestChildFocus() call back into the top level VerticalGridView.
In that case high level verticalGridView should not start another
scrollToView() animation. onRequestChildFocus() is supposed to handle
user's interaction only.

The bug is difficult to test, both RV.smoothScrollBy() and LinearSmoothScroller
uses the same scroll state, calling RV.smoothScrollBy() does not
stop linearSmoothScroller. Added a override class to intercept calls
on RV.smoothScrollBy().

Bug: 19846906

Change-Id: Ica857f443e41f14710b2bf177eafba30403817c7
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java
fa5f60106a84a2b475c38cc6b8baa347bbd6ae1d 03-Mar-2015 Dake Gu <dake@google.com> test case for focus lost in fast layout

Bug 19573463

Change-Id: Ia8aba5a2de3e5677b42c42e0da32ed147b12d3b5
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.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/tests/src/android/support/v17/leanback/widget/GridActivity.java
802f0901c737f044409c4359831da1613e544b58 20-Jan-2015 Dake Gu <dake@google.com> Excludes leanback tests from framework javadoc build

Frameworks/base make file includes all java files under v17/leanback
for javadoc build.

Change-Id: I8f8a2e9f0f194848a29cb032f5686b53d3b47631
/frameworks/support/v17/tests/src/android/support/v17/leanback/widget/GridActivity.java