History log of /frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3e61562902afe237012a2d01ac0468d6b70268f4 04-Jun-2016 Yigit Boyar <yboyar@google.com> Fail focus search if focused view disappears during focus search

This CL fixes an edge case where the last focused view disappears
during a focusSearch and we need to call focus search failure.

Calling super potentially crashes the app and calling the LayoutManager
invalidates the API. For now, best seems to just fail the focus
search. Later, we can get more clever and try to pick a view
in a position around the previously focused view.

Bug: 27837873
Change-Id: Id8d5e8ea2e3ce40982e0055b0f45777ef8b2b055
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
4be551523e8e36b5a1d480af456bfb392416882c 24-May-2016 Yigit Boyar <yboyar@google.com> Consume pending updates before focus failure

Bug: 28252144
Change-Id: I9a01149d6589f48e3e448cb10527cc1344673b91
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
d8d42d52f8ae53107ffa849b86496650182e24b8 13-Apr-2016 Yigit Boyar <yboyar@google.com> RecyclerView focus search improvements

This CL fixes a couple of bugs in RecyclerView's focus search
handling.
* Built in layout managers were handling focus FWD/BCK wrong if
the layout is RTL.

* RecyclerView was not letting the focus leave RecyclerView if
focus FWD/BCK is called and RV does not have more children in
that direction. It was going back to the top of the list instead
of letting the view system give focus to the next view outside RV.

* RecyclerView was losing focus when focus FWD/BCK is called and
RecyclerView has more children to layout but they are not laid
out. In this case, focus was escaping the RecyclerView because
it was not laying out new children in the focus direction because
it already has some valid candidates. In this case, RecyclerView's
candidates would be overridden by other views outside the
RecyclerView.

Bug: 27222294
Change-Id: Ia5583c21df0a354d53c013aa76c4f9b475240c1f
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
a90fb62f06861beb3af9f9b3356ef0bb0685547c 12-Apr-2016 Yigit Boyar <yboyar@google.com> Don't invalidate layout on detach

This CL fixes a bug in RV where it was always expecting an onLayout
call after it is detached which may not be the case if the RV's
parent is detached-attached.

With this change, RecyclerView will only clear firstLayout flag if
a layout is already requested.

I've also changed SGLM to request layout on onDetach since it
releases View references.

Bug: 27229764
Change-Id: I8d7b2c9bc2b3e24eaa66253153ffa0c960f81bc6
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
66826566020afc8d11f183cf3fe443ac0a022384 05-Apr-2016 Yigit Boyar <yboyar@google.com> Test stability improvements

* Fix wait for layout's idle wait to ensure RV's layout is complete
* Made main thread exception private to have more strict control
around its usage

Change-Id: I40d414538c16459400fe6460a638848de9ee5597
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
8e462f3453f80d3536a0ab298d189883735f78d9 08-Apr-2016 Yigit Boyar <yboyar@google.com> Merge "Do not recycle visible views" into nyc-dev
4510b5c24adad2b94df9b84c6b73f5534ffe9b57 06-Apr-2016 Yigit Boyar <yboyar@google.com> Do not recycle visible views

This CL adds a new API to the LayoutManager where the LayoutManager
can get the bounds of a View while taking into account its
transformation matrix.
This API is mainly useful for recycle decision. I've also changed
built in layout managers to respect this value in addition to layout
position of the view.

Bug: 26402811
Change-Id: If75072c73d3374bfac0439d7714714c82684096a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
2ee3e8c2bf8a9f02f0f9d487beb6463f172f1137 01-Apr-2016 susnata <susnata@google.com> Adding a test case to reproduce crash in recyclerview.

When we detach a recycler view, it sets
mFirstLayoutComplete = false in onDetachedFromWindow method.
Then if the user adds back the view and runs a smoothScrollBy
animation, we skip consumePendingUpdateOperations(). This results
in an exception if user removes data in the middle of an animation
(because we skipped processing changes to the adapter).

One way to fix it might be to not reset mFirstLayoutComplete = false
in onAttachedToWindow/onDetachedFromWindow call.

Bug: 27926253
Change-Id: I5436072b6a7039878222a74c0f9213184b29a4a1
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
251c29b47e062b1093aa2f8fbb61ab080511c38f 06-Apr-2016 Yigit Boyar <yboyar@google.com> Merge "Consume pending should bring layout to clean state" into nyc-dev
e3b89d11cf08a0e9aaa8162757246f286c6df2f8 29-Mar-2016 Yigit Boyar <yboyar@google.com> Preserve focus after layout

LayoutManagers try to keep focused view visible during a layout
calculation. This does not work well if the View is being replaced
with another view due to type change and/or animation. It is
beyond LayoutManager's intended control to care for this case so
RecyclerView will track it and recover focus to the new View
if necessary.

Bug: 25510761
Change-Id: I65680577587839ecfe84a931998da8b9926b5566
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
7f5e94985f795f81884334ca2752a0469a998762 01-Apr-2016 Yigit Boyar <yboyar@google.com> Consume pending should bring layout to clean state

Previously, consumePendingUpdateOperations would not run a layout calculation
if the first layout has not happened yet. This was inherited from old logic
where RV runs its own layout pass and if the view hierarchy will run a layout
pass, we rather skip it.

This was not the correct behavior for some use cases where we may receive a
scroll / fling etc callback while mFirstLayoutComplete is false (e.g. RV
has just been attached).

Since RV's custom layout request already checks for first layout flag and
this method is heavily used to sync state of the layout, I'm changing it
to RUN a layout if first layout has not happened and we need to sync
state to be able to call incremental methods.

Bug: 27926253
Change-Id: I3ba5b705713782de6140d4a1da6ef4fc05e94f5c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
9464e655c15a471878080918f3d0db0e607a7f96 31-Mar-2016 Yigit Boyar <yboyar@google.com> Merge "Prefer non-hidden children in find methods" into nyc-dev
bd1424dffe99916b724feef9fec6d40639c6b779 30-Mar-2016 Yigit Boyar <yboyar@google.com> Prefer non-hidden children in find methods

Bug: 27921084
Change-Id: I1e9864107bddda1dfde22dfcc88c037afbbf11c2
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
8fd6812c1cc120bb2637526ca4c641fbb01f7b0c 29-Mar-2016 Yigit Boyar <yboyar@google.com> Ignore no-op notify events

Bug: 27456234
Change-Id: I43714a36dc68cd74976a1db133050625c5ff4d67
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
959f4c0fac89425a8a9842e82fc180ec736fffac 11-Mar-2016 Yigit Boyar <yboyar@google.com> Make RecyclerView tests faster and less flaky

This CL makes a bunch improvements in RecyclerView tests.
* Change requestFocus helper to wait for smooth scroller (flakiness)
* Disable activity launch animation (perf)
* Make sure SavedState tests uses same items on restore (flakiness)
* Better step calculation in TouchUtils (perf)
* Replace scroller to add a listener instead of busy waits (perf & flakiness)
* Re-use the same TestActivity between tests. (perf)
* This seems very dangerious but given that we have many short running
tests, it greatly improves the performance.

Change-Id: Id17e5b581c690816e82726bcabfd4899d13b6403
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
e4f37e5de85662368bdc74f71b60bf402e6937df 15-Mar-2016 Yigit Boyar <yboyar@google.com> Fix RecyclerView range detection for scroll callback

This CL fixes a bug in RecyclerView where it would not
invoke scroll callbacks if the range of visible items
shrink. It was working fine if the range expands.

Bug: 27570735
Change-Id: I3a20d7b9c133e72db596f279c25e004349b4e045
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
2e77ca33cc242ec5750cfc11824c215f8d7ffc22 29-Feb-2016 Yigit Boyar <yboyar@google.com> Make RecyclerView's adapter lock less strict

RecyclerView does not allow adapter changes while it is calculating a
layout or scroll. This CL reduces the lockdown period, allowing adapter
changes when scroll callback is called.

Bug: 27406179
Change-Id: Ib4c9660b74a935ee86a1e74cc9a90a917567cce2
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
3d37afbbf7bf547c1e1c541df9be9696da668884 26-Jan-2016 Yigit Boyar <yboyar@google.com> Check child's scrollX/Y on bringChildRect method

Bug: 25787435
Change-Id: I21c73470a97db0db15f415442425eae71c5c6a34
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
4143554adb9b31b700b6876a251a64419e6111e2 10-Dec-2015 Yigit Boyar <yboyar@google.com> RecyclerView Automatic WRAP_CONTENT support

This CL adds support for wrapping content for RecyclerView while
supporting predictive animations.

It is an opt-in API which is off by default because these changes
will change the callback flow, especially will start calling
LayoutManager#onLayout when RecyclerView#onMeasure is called.

See LayoutManager#setAutoMeasureEnabled for API details.

All built in LayoutManagers support WRAP_CONTENT using this new
mechanishm.

Bug: 22508392

Change-Id: I6e010f8807e9d2fa379dd52493b2d8340b8c65de
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
0a017072206f93474ccd2706e7983c2ff778b904 07-Jan-2016 Yigit Boyar <yboyar@google.com> Move all RecyclerView tests to Junit4

This CL moves all RecyclerView tests to Junit4 and uses
the new ActivityTestRule instead of ActivityInstrumentationTest.

Bug: 24494874
Change-Id: I049d8b1ac7869a6af13a3ee7905d6dd1f6eb418b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
f1b288ec2104488f4a92e911b0ab80c8f0f3e9d1 28-Dec-2015 Yigit Boyar <yboyar@google.com> Add test size annotations to RecyclerView Tests

Bug: 24494874
Change-Id: I0e7606d1c55017dc17467155372b708a0b1ea36d
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
4bcf88a56f3048a7ead6f423faa8fa08b95c5dae 01-Dec-2015 Yigit Boyar <yboyar@google.com> Always consume pending updates before post layout.

This CL fixes a bug where RecyclerView would decide not to
run predictive animations due to some other criteria besides
adapter updates.

Now we always process adapter updates before running post layout.

Bug: 25948838
Change-Id: I83d65c9afc0551fc02ede087dcf338f71f0cbb6e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
14d75838c4578e079d75ea149e9833250c5d741b 03-Dec-2015 Yigit Boyar <yboyar@google.com> Check layout before calling.

Compute scroll offsets might be called even if the RV does not
have a LayoutManager.

This CL guards for it, adds tests.

Bug: 25971558
Change-Id: I660e7b1f28bdf53ac7d5f6d9b5396ba2c1e44f88
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
e09e0b4ea04b6b6b0ef6c62979e8abdead0bf378 30-Sep-2015 Yigit Boyar <yboyar@google.com> Cleanup for item tracking

This CL abstracts the Item tracking for RecyclerView. This makes
it much easier to test (better encapsulation) + cleaner code.
And as an added bonus, I merged some maps to speedup lookups.

There is also a small (unreleased) API change for the new
ItemAnimation callbacks. It was wrong in the first one but didn't
realize because SimpleItemAnimator was taking care of it.

I've also added some support annotations & fixed some warnings.

Bug: 24665726
Change-Id: Idba09e749f1c0f269d81dbdee4056f6b52ba8484
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
121ba9616e5bed44d2490f1744f7b6a9d3e79866 30-Aug-2015 Yigit Boyar <yboyar@google.com> RecyclerView Animation API V2

This CL introduces a new Animation for RecyclerView that
gives more responsibility and power to the ItemAnimator.

It is backward incompatible but there is a new SimpleItemAnimator
that mimics the old API for easy transition.

The main goal for this API change is to enable better change
animations. This change will enable ItemAnimator to easily animate
contents of ViewHolders.

Bug: 22507896
Change-Id: I4d9a6b92ff5c27691b277a777da77116476b1cd3
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
7bb9b2507dc5ed5fa2609d6b8ecf7d274f7bb619 14-Sep-2015 Yigit Boyar <yboyar@google.com> Fix flaky test

This CL fixes a focus test where we could be
checking callbacks w/o waiting for it to arrive.

Change-Id: I7b67ab69dc01d798e63488e2897e1e110233fa17
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
ef3e37fe088c7d8e614bbc4ed58d6c0d3fa807a1 29-Jun-2015 Dake Gu <dake@google.com> RecyclerView: add setLayoutFrozen(boolean)

Add a method to stop recyclerview from udating children.
Including:
- delay the adapter change.
- stop scroll and inner scroll
- stop scroll animation
- cancel ItemTouch helper (dragging)

b/22067316

Change-Id: I24e7baf3477022025a2bba8e56343c5af7196403
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
d4c72f08279df548fbc4d556fe1a8b3500fafdbc 15-Jun-2015 Chris Banes <chrisbanes@google.com> Allow vertical dragging of AppBarLayout

Also fixed onStopNestedScroll() not being called
from NestedScrollView and RecyclerView

BUG: 21843568
BUG: 20679299

Change-Id: I1b19d7cae2db403ede30fc9116ea05aace586b3b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
e1cd8d86d84646768867eeaeb038e1c135ca3e4c 09-Jun-2015 Yigit Boyar <yboyar@google.com> Fix LinearSmoothScroller NPE bug

This CL fixes a bug where LinearSmoothScroller would try to access
RecyclerView after it is stopped.

This was actually caused by a bad API so I deprecated it in favor
of a more open API. This new API, jumpTo also allows instantly
scrolling to a position in case target position is far away.

Bug: 21661478
Change-Id: I3c4bfa8589803a564a61116e73d8b1312c6c9f46
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
364ca611da0789aefae36126a8e302abaefa0d48 17-Jun-2015 Yigit Boyar <yboyar@google.com> Remove package private method access from LinearLayoutManager

This CL removes some package private access to RecyclerView from
LinearLayoutManager. This is useful when people try to customize
it.
We should deprecate getScrapList : ViewHolder API to avoid further
similar problems. LayoutManager should not be accessing the view
holder and this API is creating problems.

I also fixed a layout test which was going into recursion.

Bug: 21847010
Change-Id: Ibfbd5b817affd7c93aafc0ca6cd99f62313be556
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
cc1bf428e5bdbcc94e58107da4a100b279810a64 05-Jun-2015 Yigit Boyar <yboyar@google.com> End animations on scrap views, clear updated views from cache

This CL fixes a bug where we would not remove updated views
from cache which was bad utilization of cache since they'll
need to be rebound anyways and they could be rebound back in
preLayout with their bad state.

I also changed how we handle remaining scrap views at the end
of a layout. We used to recycle them wihtout ending their
animations which would prevent them from being recycled.
Instead, we first end their animations inside a recycle
barrier and then recycle them.

I also did some cleanup in layout tests to make them easier
to read :).

Bug: 21615412
Change-Id: Ic4fecfe9b78ee66e46b13bff83cf903be2cc2e1a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
f129f1b050d2542a91fe8175eac30183beb07b41 20-Apr-2015 Chris Banes <chrisbanes@google.com> Nested Scrolling support for RecyclerView

Also fixed annotation for ViewCompat's overscroll

BUG: 20334660

Change-Id: Iafa2f52f63d9aa9d5c8ce10b5e8bf108c1407a12
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
be7a54a6e02c9230a08e63f1c964907d129b6a10 07-Apr-2015 Yigit Boyar <yboyar@google.com> Integrate espresso w/ RecyclerView. Hi Junit4 !

This change also adds support for running testes on host machine.

Bug: 20258423
Change-Id: Ic8bd569d852a7d6d1c74c5fc4a4bf16703f71e52
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
2cba904324003b514001f2464891fc8818e6be0f 18-Mar-2015 Yigit Boyar <yboyar@google.com> Merge "Fix RecyclerView focus issues when target view is too big" into lmp-mr1-ub-dev
da50fde358bd3ef2edb273b3bf0265cf5e84ec6b 12-Mar-2015 Yigit Boyar <yboyar@google.com> Ignore accessibility events if layout is invalid

This CL adds a check to AccessibilityDelegate to ignore accessibility info
requests if RecyclerView has a pending layout calculation. These callbacks
are problematic to handle in these limbo states because any custom callback
does not necessarily know whether RecyclerView could update or not.
Also, since there will be a layout calculation in near future, all these
events will arrive again.

This CL also adds a public API to query this state so that developers can
take advantage of it for custom logic (e.g. ignore click event if data is
invalid).

Bug: 19085424
Bug: 19717689
Change-Id: Ice13ed8d77657632007686bc57183f09954b8e8a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
6d109dd6676f6bca949643d2d04365494eaeb867 07-Mar-2015 Yigit Boyar <yboyar@google.com> Fix RecyclerView focus issues when target view is too big

This CL fixes a bug where if the View which asked for focus is partially
visible, we would scroll such that the invisible part of the view also
becomes visible. Unfortunately, this scroll was not capped so if view is
too big, we would scroll too much and hide the currently visible side.

Bug: 19642142
Change-Id: I408b7c8aa544cde8d4de5050e080f5431aa3cd87
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
f225a3b785fe24c31aa5f75501754b974e106859 05-Feb-2015 Yigit Boyar <yboyar@google.com> Consider decor offsets on child focus

When a child requests focus, RV tries to scroll to make it fully
visibile. Previously, it was not taking decor offsets into account
which may look buggy. This CL adds decor offsets to visibile rect.

Bug: 19247249
Change-Id: I2bb613db7437038669ecdd2aaa1ee31eeceaabb2
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
4ef064e4d8dd8e835d878bf0c0358dff60e46733 30-Jan-2015 Yigit Boyar <yboyar@google.com> Merge "Widen the scope of ViewHolder#getAdapterPosition" into lmp-mr1-ub-dev
619ac016831a5ad75c2e0921c9036b6f030a9e63 29-Jan-2015 Yigit Boyar <yboyar@google.com> Widen the scope of ViewHolder#getAdapterPosition

getAdapterPosition in ViewHolder needs to access RecyclerView to get
the up to date position. This does not work if developer wants to
access adapter position in onViewDetached/Recycled callbacks.

This CL adds a reference from ViewHolder to the RecyclerView for the
duration it is controlled by the RecyclerView (right before binding
from the adapter till it is passed to the RecycledViewPool).

Bug: 18960075
Change-Id: I4e310aff14f827f6289caaf2b94e61288ed3fb1a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
1a2a95faea3d32075b8506f13f6d6f8292db51b6 29-Jan-2015 Yigit Boyar <yboyar@google.com> Ignore hidden views for adapter helper

When adapter helper processes updates, it is important for it
whether a View is already in the UI or not. When we run
that check, we would usually check hidden views as well.

This becomes an issue if hidden view is not up to date because
it will be recycled while trying to re-use it in pre-layout.
(end animation callback will recycle it because it is not
up to date)

This CL changes AdapterHelper to ignore hidden views so that
they can continue their animation and LM will animate the rest.

Bug: 19170543
Change-Id: Ic26efd4e2a215481415131715625d785edc4f6ef
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
78f659a66b021d5d0e36800a7144e956d8054cea 09-Dec-2014 Yigit Boyar <yboyar@google.com> Don't stop scrolling if scroller reports 0 diff

Bug: 18667843
Change-Id: Ie05dbc2b198ee7b5eb83bf36e9c7f01e59b5e14c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
0c9222b8ff65798fa394eb4df49755a34150c1d5 02-Dec-2014 Yigit Boyar <yboyar@google.com> Merge "Enable getAdapterPosition when View is rebound" into lmp-mr1-dev
e37d2e63f16bc5c2938e372238ba54679a9e578e 27-Nov-2014 Yigit Boyar <yboyar@google.com> Enable getAdapterPosition when View is rebound

getAdapterPosition used to return NO_POSITION if data set has changed
after the last layout and the next layout is not complete yet.
This would be a problem if RecyclerView already processed adapter
updates, rebound the view but has not finished the layout calculation.

This CL starts tracking position invalidation per ViewHolder and
removes the flag as soon as it is rebound. This way, when
ItemDecoration callbacks are called, developers can access adapter
position.

This CL also adds a test to ensure that ItemDecoration callback
promise is kept so that we don't break it in the future by mistake.

Bug: 18524432
Change-Id: I3fc7ac9b0d78bd87b1b85ed15c99af89e252c58b
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
3f937299abacc5ff1be7a5ffa91793396aca0a57 26-Nov-2014 Yigit Boyar <yboyar@google.com> Remove transient views if necessary

This CL fixes a bug where if a disappearing ViewHolder's animation count
reaches to 0 but it is not removed due to its transient state.
We don't care about it anymore and let Adapter decide if it is recycleable
but we should still remove it.

I would actually prefer to update ViewHolder#isRecycleable but it is public
API and changes may break external code so created a different internal
method.

Bug: 18248568
Change-Id: I6a89bc0a2249ea4f0effc90ef2636e1ce69e283f
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
4965046abec63014d2a5e7f72f6c9e11b73a4907 25-Nov-2014 Yigit Boyar <yboyar@google.com> Trigger on scroll callback if position changes during a layout

Bug: 18433923
Bug: 18248568
Change-Id: Iae93ebe2f9c850aee70c2efcd71f2da7301940ae
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
9c0a9654497b759feef634e3d574c511d4d4ef4e 25-Nov-2014 Yigit Boyar <yboyar@google.com> Merge "Fixed minor bugs in RV's scroll handling." into lmp-mr1-dev
670a72b9301fa53a763344036e4d3ff1995f36df 24-Nov-2014 Yigit Boyar <yboyar@google.com> Fixed minor bugs in RV's scroll handling.

This CL fixes two issues related to how RV handles scrolling.
Previously, if layout manager supports scrolling in both directions, RecyclerView
would stop flinging if LayoutManager cannot scroll as much as requested
in both directions. Now, it continues even if only one of them is fully consumed.

This CL also fixes a bug where if fling or smooth scroll is manually called, we would not
check if LayoutManager supports scrolling in that axis. This would result in unexpected
calls to LayoutManager which may create problems if it is a generic one that supports
both orientations (like the default ones). Now, we'll check if LM supports scrolling
in that axis in public scroll/fling methods.

Bug: 18208220
Change-Id: Ia8e30a3b822b06cf275ae6c2de7e64b8e70e4d59
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
115ba0c7b2a14aa4cd0273952195e1d8f6468f87 10-Nov-2014 Yigit Boyar <yboyar@google.com> Deprecate ViewHolder#getPosition

getPosition methods in RecyclerView were ambiguous because of the deferred
handling of adapter updates. To avoid future confusion, this CL deprecates
methods that receive or return "position" and introduces two methods that
receive / return "layoutPosition" or "adapterPosition".

This will help developers get the exact number they need (e.g. the position
in adapter vs the position user is currently seeing)

The following methods have been deprecated:

RecyclerView#getChildPosition
RecyclerView#findViewHolderForPosition
ViewHolder#getPosition
LayoutParams#getViewPosition

Bug: 18213371
Change-Id: I52667bd43e32fc55de8861f5fdc01a0aa7fbe60f
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
d17ce72488bb0b13b34a3684c86e48c230b6a5a4 21-Nov-2014 Yigit Boyar <yboyar@google.com> Merge "Add an API to let Adapter recycle transient views" into lmp-mr1-dev
e2437126f0225135891544315ff72e54c7de0f59 05-Nov-2014 Yigit Boyar <yboyar@google.com> Add an API to let Adapter recycle transient views

Bug: 17783452
Change-Id: I70f2386b6f7d88e78a389a7fc1f583d0f1c45c0e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
abd0fbfcdd5b438909f126392eca5978b5939b6d 19-Nov-2014 Yigit Boyar <yboyar@google.com> Guard layout managers calls not to crash

Previously, RecyclerView would crash if a call should be handled by Layout Manager
and it is not set yet. Although this makes sense, there are some cases where
developer would like to set LayoutManager after checking some other logic or
RecyclerView is attached/detached w/o being setup. This CL guards a bunch of
public calls to print an error if LayoutManager is not present, instead of crashing.

Bug: 18444564
Change-Id: I666ea346a615ca5338af32b25774bf90bbcb551c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
90ca3086dbf66ad6bb8840e46ec8524a705e1c18 03-Oct-2014 Yigit Boyar <yboyar@google.com> Fix RV's onViewAttached/detached callbacks

This change also fixes a bug in DefaultItemAnimator.

Bug: 17599182
Bug: 17881182
Change-Id: I4adadeb5d2d7d5aaef0f253eac52d2624de73d5e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
824a7db96feacf3b68f56993ed72712bc935153e 14-Oct-2014 Yigit Boyar <yboyar@google.com> RecyclerView should call correct adapter on swap

Bug: 17687329
Change-Id: I35bc785e6c64d1fd0844286766e8ddb59d061737
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
bb6ebab3b3b85ec20b3bc262289a2460705322f5 25-Sep-2014 Yigit Boyar <yboyar@google.com> Set scroll state when stop scroll is called

Bug: 17644072

Change-Id: Iac0b0cff4ee06b461cebb6e933a5a712a06a7a4e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
c50c4cad31d73e574b27bb3d7581542975e37263 15-Aug-2014 Yigit Boyar <yboyar@google.com> Fixed LinearLayoutManger's scrollToPositionWithOffset

Previously, LLM was not handling scroll to position with offset when layout
is reverse or stack from end, this change fixes it, adds tests.

I also improved how predictive animations are handled. If a visible item is
scrolled, now LLM lays out more children in the opposite direction in pre-layout
so that when they become visible, they don't just fade in but animate from the
correct direction.

Bug:17015719
Change-Id: I2748c0636927159201202a7eb4caf338d67d6ca9
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
f485be9def4c0f72cfdfa6b0c616c23f04652817 13-Aug-2014 Yigit Boyar <yboyar@google.com> Ignored views should be ignored by getViewForPosition

Bug: 16950247
Change-Id: I3940ce3b049a3ae718706c503b0404f3fda43ffd
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
6b4d950d0d1e26165a1e643a2fd1fe4e283786f1 31-Jul-2014 Yigit Boyar <yboyar@google.com> Fix StaggeredGrid crash: Saving state of an emty Span

Bug:16644724
Change-Id: Id0567d6f3dc7ab8621774fe147ab0dc8c5b98e61
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
66a5670ac0e58e1d08f6af57b13648c1ab9df441 26-Jul-2014 Yigit Boyar <yboyar@google.com> Change public recyclerview to unscrap views

Bug: 16201361
Bug: 15910842
Change-Id: I5453f9ed33c88c5a0d92f617a4f57cf938be4ec0
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
ee30f03253207f694cc46063b0c8c7cb91d24a6e 28-Jul-2014 Yigit Boyar <yboyar@google.com> Update scroll target if it is removed while scrolling

Bug: 15933296
Change-Id: If576382c3ca64060bc62cd9437c7b6993b8ccb11
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
bc2c6d6432a227d46a43fd18eb204d89ca472064 25-Jul-2014 Yigit Boyar <yboyar@google.com> Add an API to mass invalidate decor offsets

Bug: 16549198

Change-Id: I24c40aef0a988622d256214fb58e1c2a2daf43c0
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
5cfed5428d421f179f83382ad72ec6edd11a066d 23-Jul-2014 Yigit Boyar <yboyar@google.com> Update state on onMeasure call in RecyclerView

Bug: 16187385

Change-Id: Ifee446c47d49536327f34233a853929c6cf2a196
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
0b1059b711009601ff08354e2df6bfc45266e80a 21-Jul-2014 Yigit Boyar <yboyar@google.com> Add swapAdapter method to RecyclerView

Bug: 16315373
Change-Id: Ia790aff458d2ca61ec403dd9887d9758eb74f47a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
6e560171b774afafd572b1896becac7b308a92e6 16-Jul-2014 Yigit Boyar <yboyar@google.com> RecyclerView should skip ignored children in mass recycle

Bug: 16322508
Change-Id: Ieddc317771538c7cdab29a2e4898df05706fd6ba
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
cadd54707a7aaa4cfa9c8b8051c6185e8717f22e 11-Jul-2014 Chet Haase <chet@google.com> Invalidate ItemDecorators more aggressively

This CL also changes the ViewDecorator API to receive View and State instead of position

Bug: 15699227
Change-Id: Ie4deb49eed803540a3bd274454d2e67d2f34a50d
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
38efc791651510a8bc815a707e105554e3bf99f2 11-Jul-2014 Yigit Boyar <yboyar@google.com> Fix RecyclerView to recyle invalid scrap properly

Bug: 16210009
Change-Id: Id4cdf1ef87aaa52581009b651690abbf90ad4522
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
c8b0ff5869e17a656a3a1d7fb306efa5b99fa07f 07-Jul-2014 Yigit Boyar <yboyar@google.com> Improved how RecyclerView handles stable ids

RecyclerView can re-use views via stable ids but it was going into an
inconsistent state if an item is removed and re-added in the same layout pass.
This CL takes care of that case and handles it as if item has moved.

Bug: 16081401
Change-Id: Ic0bec5061a4958111c8e43a1cd6634cd90d975b5
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
0bdfd8728199045676f3ad6c6571e7080099716f 30-Jun-2014 Yigit Boyar <yboyar@google.com> Validate layout and scroll only methods in RecyclerView

If an adapter update method or LayoutManager configuration method is called
during a layout or scroll; it creates very hard to detect bugs.

With this change, RecyclerView, LinearLayoutManager and
StaggeredGridView starts checking some of these potential mistakes.
Coverage can be extended.

Bug: 15615904

Change-Id: I07a4fcf59d02af09e634b4a4eff090538d051d3e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
e0c347f627f8a78d3e5e3e5eaac9c3ae26208689 24-Jun-2014 Yigit Boyar <yboyar@google.com> Run simple animations if adapter has stable ids

Previously, if adapter calls notifyDataSetChanged, RecyclerView would
disable all animations since the world may have changed unexpectedly.

With this change, RecyclerView takes advantage of stable ids when views are
returned from scrap/cache so that we can animate these views to their new
locations / positions.

This change also fixes a bug where cached views would not be recycled if
notifyDataSetChanged is called. Now, if adapter does not have stable ids,
cached views are recycled. If adapter has stable ids, they are retrieved
via stable ids.

Bug: 15692095
Bug: 15857302
Bug: 15632007

Change-Id: Ic321dfeb3438e47a0f7606a857511eb821161a0e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
bbf19899050278ae64da0a8bfce209a9f359c853 27-Jun-2014 Yigit Boyar <yboyar@google.com> Do not trigger layout when RecyclerView is detached

Bug: 15911289
Change-Id: I654bdcdadf94956b917614e0a3fbee214877e4d8
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
49c83b12201dde5b93d4eca3d44478e0c967a2e6 26-Jun-2014 Yigit Boyar <yboyar@google.com> Pass recycler to LayoutManager#onDetach callback

Bug:15736907
Change-Id: I6cd50800ebae0ff10b99665fcda77b0da411065c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
668e774379c036a5d53d07ec69ed9ebee13a1fd9 20-Jun-2014 Yigit Boyar <yboyar@google.com> Track hidden views to allow interleaved disappearing children in RecyclerView

RecyclerView used to put animating views at the end of the view group list
which may cause problems if views overlap. Instead, this implementation keeps
track of hidden item positions.

This CL also removes the requirement to not to call addView for disappearing
children. Instead, LayoutManager can add children via addView (if it is removed)
or addDisappearingView (if LayoutManager want to remove it) and RecyclerView
will hide those views from the LayoutManager after the layout pass is complete.

This CL also enabled animations even if no item changed notifications are
received from Adapter. This is useful when LayoutManager changed how it lays
out views w/o any change in the adapter. LayoutManger can still disable this
feature via existing animations callbacks.

Change-Id: I1aee1832ba1d4e5aff4213bc73fa77a52b70a83d
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
fe3996cf5af65fe11cc3ed47b67123ec267bd336 18-Jun-2014 Yigit Boyar <yboyar@google.com> Do not scrap invalidated views in RecyclerView

Bug: 15703871
Change-Id: Ib765ddd2ea5b5d897879f2387e8ae6a9f98e555e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
7a59e4b36500bcfddd842376d6c3abe0d9f23d84 18-Jun-2014 Yigit Boyar <yboyar@google.com> Merge "findViewByPosition in RecyclerView should ignore removed children."
5ced882cabdcefbb469e332f6f73983999aad0e5 17-Jun-2014 Yigit Boyar <yboyar@google.com> findViewByPosition in RecyclerView should ignore removed children.

Bug: 15676570
Change-Id: I83aed0f0a8e0fee96fac194dd061ec0ca45ff27a
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
7e9da1a2629b657d56e2f54abd18c6249f3be037 14-Jun-2014 Yigit Boyar <yboyar@google.com> Check view type before re-binding ViewHolders in RecyclerView

Bug: 15596672
Change-Id: Ia42700e400b98b1020dbbba282d383da14d5816c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
22b6b8163d2e15eb6d0a89906854dec801945f1d 13-Jun-2014 Yigit Boyar <yboyar@google.com> RecyclerView: Fix type-check bug for cached views

Change-Id: I1b6d33d7e1aeeb36e697cb95cd7109a9ac53a909
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
8ae76f91527ce850f155ce960fb9068bcd5d49f9 05-Jun-2014 Yigit Boyar <yboyar@google.com> Fixed RecyclerView position bookkeeping bugs

Bug: 15397591
Bug: 15350129
Bug: 15547859
Change-Id: I54d754eb2b788311048d7557f51967b748b2de3e
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
b5f8b4fecb531aee6b359b4968409410aba90817 17-May-2014 Yigit Boyar <yboyar@google.com> Full animation support for LinearLayoutManager

Change-Id: Ie3b265a9f880d68746d1bd193d787f34ea8d0045
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
d7d27e9ebe5c7325e67e1a8af265378bd2056cad 28-Feb-2014 Chet Haase <chet@google.com> Add animations to RecyclerView

This CL adds the basic plumbing for animating item changes in
RecyclerView. It also implements the bare essentials add/delete
animations. When the app specifies that items have been
added/removed (by calling the appropriate Adapter methods), the
RecyclerView will determine the appropriate fading and moving
animations to animate the items being added, removed, and moved
into new locations.

Change-Id: I4fa8686f54c8bfa2ba29c399eea112d33f71689c
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
bde2d5e79f929ce8c54de29c8389695b4d4e9c25 15-May-2014 Chet Haase <chet@google.com> Revert "Remove adapter access from layout manager"

This reverts commit 15a9db9177a871c7b1cd65b8923beac1b9b75174.

Change-Id: Ia80ac4f093c49145a6a2c09d1ea4f9102b195f40
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java
15a9db9177a871c7b1cd65b8923beac1b9b75174 06-May-2014 Yigit Boyar <yboyar@google.com> Remove adapter access from layout manager

Change-Id: I33a48528e3290fa78aaa67237f3b098e010e09d9
/frameworks/support/v7/recyclerview/tests/src/android/support/v7/widget/RecyclerViewLayoutTest.java