• Home
  • History
  • Annotate
  • only in /frameworks/support/v17/tests/src/android/support/
History log of /frameworks/support/v17/tests/src/android/support/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
06388129e48b308b25bfd85e6f136db8528d4c62 27-Jul-2015 Dake Gu <dake@google.com> Fix regression of unable to focus out of empty gridview

b/22706497

Change-Id: I53b7a9d7840fe614f0bb0d0c3307386a1e4e65db
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
91feb947412e0521a5f1835553214dcbe03fd362 09-Jul-2015 Dake Gu <dake@google.com> GridLayoutManager: fix jumping problem caused by requestLayout

When requestLayout during scrolling, onLayoutChildren() does not
check return value of getScrollPosition so it may get dirty values
from the temp array.

Bug 22209986

Change-Id: I2506d2774d2069cae86b360f8c985d2ea05cc629
17/leanback/widget/GridWidgetTest.java
4927a3bbd1921aed5da5d276a5d15240b2960fae 09-Jul-2015 Dake Gu <dake@google.com> Add test cases for b/22306025

ag/723346 kills two birds with one stone.
added test case for Bug 22306025

Change-Id: Id5a0d341f119fced5cd1f6e9948543e509dc92c7
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
d1cab1b54104d55407335c5d649398635822fffd 24-Jun-2015 Dake Gu <dake@google.com> Leanback: support Scroll Accessibility action

Behaves differently than phone/tablet, it scrolls to
last/first item on the same row for SCROLL action.

simplify the dispatchChildSelection() in SmoothScroller
a little bit: only dispatchChildSelection() for the
final target.

b/19072385

Change-Id: I543e5298c681e3809d87de767ec3ab93ef6fe15c
17/leanback/widget/GridWidgetTest.java
8c5713428379689839330c344c4a800039db0400 23-Jun-2015 Dake Gu <dake@google.com> Merge "Supports extra layout space" into lmp-mr1-ub-dev
88dea72af6042049560140a70e059820dbb8f746 19-Jun-2015 Dake Gu <dake@google.com> Supports extra layout space

When layout reordering aligned focused item, extra space is
needed during prelayout for filling. However there is no
general solution now based on REMOVE/CHANGE flag of ViewHolder.

This CL is a case-by-case solution allows extra item to be added in
invisble area so that item animator can animate slide-in instead of
fade-in.

b/21949401

Change-Id: Ic78a0d639f387a0bf319fcc504b8401262148a0b
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/SingleRowTest.java
db0b1afb71440b79923692d58adee982b5954838 29-Apr-2015 Dake Gu <dake@google.com> fix bug of wrong selection when itemAdded is triggered

When items are added at the same time that setSelection()
is called, we incorrectly apply the offset to the position that
user wants to select. Disable the offset when target view
hasn't created yet.

Bug 20672263

Change-Id: Iaf990b58109d005ef04d9a47029e5c0a493bb8c3
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
bc0edc3ab9bac3c8d7d3cc9de1cb499ea3b4155e 27-Apr-2015 Dake Gu <dake@google.com> Revert "Support multiple alignment within one ViewHolder"

This reverts commit 86a6309c3e89ec6abc40ec045bfaef7827cbe427.

Change-Id: I3385d74766e948566b7321cbe2afcf31a66282c1
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
61e5a56ed066815e69be7526e3d1bee2d5268d20 01-Apr-2015 Dake Gu <dake@google.com> GridLayoutManager: fix child states incorrectly saved

We already handles child state in LM.onSaveInstanceState(). But
ViewGroup dispatchSaveInstanceState() and dispatchRestoreInstanceState()
directly invoke child view's dispatch methods without going
through onSaveInstanceState(), so it saves states that we don't need
and later being used unexpectedly in dispatchRestoreInstanceState().

Disable the dispatchXXX() of child by toggling the flag
when a child view is created.

Bug 20016293

Change-Id: I599515ac8a0bfe29b7abef190509ef464fd2ccb6
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
492506cede17ecee39ce7fa35ee7a347ff31c5ba 25-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: fix size change not detected

When rowHeight=wrap_content, onMeasure() will measure
the child's size. So when fastRelayout is run, the
measured size is already new value, it should not be
compared to decide wether there is a size change.
Switch to use the correct view size method.

Bug 18537143

Change-Id: I084e54ba45cbb1a79fe67b65d064843035d3abf4
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
17/leanback/widget/HorizontalGridViewEx.java
17/leanback/widget/VerticalGridViewEx.java
7538845719cd1e588185ce9ae60320377862ef8d 19-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: Fix ANR

Regression of fixing b/19625410
We are trying to add non-existing focused position view in fast
layout pass and ended in a deadloop.
Switched to a different fix for b/19625410.

Bug: 19823374
Change-Id: I9fd1e985c09f8deffb46285366b5cf97d881c1b9
17/leanback/widget/GridWidgetTest.java
f518dc6b5898d16d0b8818ff4d06425b2bb0b3d0 09-Mar-2015 Dake Gu <dake@google.com> GridWidgetTest: Cleanup sleep handling

Change-Id: Ie7f253dd77dc421c66080c738b8dc91409564bc3
17/leanback/widget/GridWidgetTest.java
f80ef0d6b0b6403f3cd94e7197bc4a39d285280a 07-Mar-2015 Dake Gu <dake@google.com> Fix missing dispatchChildSelected() for staggered grid

This bug does not happen to single row grid where we
change mFocusPosition before createItem.

For staggered grid, when scroll up to item 1: we first
create item1, then consumePendingMovesAfterLayout() changes
mFocusPosition to 1; the event is not fired in createItem
and it's not fired in smoothscroller onStop() if mPendingMoves
is 0.

Bug 19620864

Change-Id: If90fa1b11f7ba689015ecd5462482b83254f345b
17/leanback/widget/GridWidgetTest.java
9c56475370d1df940252ff1360b92de50022fff6 06-Mar-2015 Dake Gu <dake@google.com> GridLayoutManager: fix fastRelayout() not focus to added child

When items are added to empty GridLayoutManager, it triggers the
fastRelayout pass which does not set focus position to 0.

Bug 19625410

Change-Id: I2ce11abde2162bb7fd28fd1fa6343b9d9b6b32f1
17/leanback/widget/GridWidgetTest.java
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
17/leanback/widget/GridWidgetTest.java
fa5f60106a84a2b475c38cc6b8baa347bbd6ae1d 03-Mar-2015 Dake Gu <dake@google.com> test case for focus lost in fast layout

Bug 19573463

Change-Id: Ia8aba5a2de3e5677b42c42e0da32ed147b12d3b5
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
6b22c4c875d7a540e705b2b6b65bf52c7a89299a 28-Feb-2015 Dake Gu <dake@google.com> Dont scroll to non-focusable items in onLayoutChildren

Added test cases

Bug 19283027

Change-Id: I1de48881dfc4117a42a7e74722f3cc4607f25a51
17/leanback/widget/GridWidgetTest.java
5d3875ca7ca9294a00f9da0a92ad9055adeb9703 24-Feb-2015 Craig Stout <cstout@google.com> Fixes and test for playback controls wrap_content.

b/18803384

Change-Id: I2513530a072c3fb491b3643dd4bf97139cedc830
17/leanback/widget/AssertHelper.java
17/leanback/widget/PresenterTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java
7ee22537e201c3d6b5de2908aecc4b0cc59a05c2 06-Feb-2015 Dake Gu <dake@google.com> Fix Test

Change-Id: I1bb4b316182a58f563b7a4237f9188a63211e559
17/leanback/widget/GridWidgetTest.java
a3c24a53034f1effc24b2d01328d63d96ad2ac7c 04-Feb-2015 Dake Gu <dake@google.com> Fix GridWidgetTest tests

Now smooth scroller has a max of pending DPAD keys.
Sending 100 keys a time may not scroll to begin or end.
Rewrite methods scrollToBegin() and scrollToEnd().

Change-Id: Ide7f6cb34fc6bb9945b96763608d2667447cfe21
17/leanback/widget/GridWidgetTest.java
ad9af35ec6a808136478daf7bd57d564ac517e0e 03-Feb-2015 Craig Stout <cstout@google.com> Support for null headers.

By default the header is GONE on the row and has a min size in the fastlane.

b/19144511

Change-Id: Ic40009e69e86d964a9556e8175530c2ab5396881
17/leanback/widget/PresenterTest.java
89fac6fa5d32123cc79d1d4127a4a7bcf86c498a 29-Jan-2015 Dake Gu <dake@google.com> StaggeredGridDefault: Fix inconsistent algorithm results

appendVisibleItemsWithoutCache() uses inconsistent judgements to
determin whether to fill item on next row. When filling first item
on a row, it does not use margin; when filling next item on a row,
it uses margin.

This may cause different layout results in two situations: itemN and
itemN+1 are filled in one pass or two passes (if itemN hits uplimit
in first pass).

The CL make it consistent that it does not take margin into consideration
in deciding whether to fill second item on next row.

This bug is easier to reproduce after adding LinearSmoothScroller support
for DPAD navigating a multiple row Grid. Previously appendOneColumn
is used to handle focusSearchFailed, where it always fills one column
so that itemN and itemN+1 are guaranteed to be filled in single pass.

Added test case.

Bug: 19196818
Change-Id: I9e829bff62feb9ab651bb81bf41638f799bf3a5d
17/leanback/widget/GridTest.java
17/leanback/widget/StaggeredGridDefaultTest.java
575dc8a5a5c023aee0c0ec297a7d357685cf49e9 21-Jan-2015 Craig Stout <cstout@google.com> Add xsmall focus scale.

b/19051315

Change-Id: I39066b672b1454ff6c6ea7ee4748d7f731728ed4
17/leanback/widget/PresenterTest.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
17/leanback/widget/GridActivity.java
17/leanback/widget/GridWidgetTest.java