History log of /frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
8cf399b2e813234a1a603df3575c2dcdfa38dc9e 07-Apr-2016 Yigit Boyar <yboyar@google.com> OnLayoutCompleted API for LayoutManager

This CL introduces a new LayoutManager API: onLayoutCompleted.

This new method is called after a layout calculation is
completed. It is a good checkpoint for layout managers
to clear any layout related data (e.g. pending scroll
position).

We also use this new API to fix a bug where scrollToPosition
may not work if the LayoutManager is measured multiple
times which is likely to be triggered if it is inside a
Dialog.

Bug: 27765270
Change-Id: Ib576ff609dcedc1e9978551c009d00d5c457665a
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.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/src/android/support/v7/widget/GridLayoutManager.java
5f538711872b050b93f49a5dcaff1753e0299449 25-Mar-2016 Dake Gu <dake@google.com> RecyclerView: Add convenient methods for margins

Promoted layoutDecoratedWithMargins() from SLM to LayoutManager.
Added getDecoratedBoundsWithMargins().

Change-Id: I353437679250707402c16d766fdcf4ca25350f5a
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
29f43aa1bb825a46fd7cf161a0cd1d5353aaf821 08-Mar-2016 Yigit Boyar <yboyar@google.com> Special handle match parent children in GridLayoutManager

GridLayoutManager measures children first with their measure spec
then re-measures them to have same height. This was creating
larger than expected if the child is MATCH_PARENT and also has
decor offsets / margins.
This CL fixes it by adding insets to the very first measure step
of the child if it has MATCH_PARENT spec in the scroll direction.

This is not an issue in LinearLayoutManager or
StaggeredGridLayoutManager because they don't have any inter-child
alignment and always take insets into account.

Bug: 27479792
Change-Id: Ib5f897f67fe9dd569cc6fbf477bb2c1141bb4a54
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
56d2535547810327746f8306dbd1cf10a3f10870 05-Feb-2016 Steven Dao <sdao@google.com> Fix GLM AccessibilityNodeInfo row/column count

Change-Id: I1b0d9a2207be1848c4f156ab0bfa469e33805a32
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
b3da032dfc6b79acacd86078ae99d79d51a28794 29-Jan-2016 Yigit Boyar <yboyar@google.com> Merge "Handle padding in wrap content" into mnc-ub-dev
6b6a29eea7f6a212447b3cc7b45a081b609ca4b1 29-Jan-2016 Yigit Boyar <yboyar@google.com> Handle padding in wrap content

This CL fixes a bug in GridLayoutManager and StaggeredGridLM where
they were ignoring padding in non-scroll direction when calculating
the content wrapping. This would eventually cause clipped children.

I've also fixed some code-style errors.

Change-Id: I7dca4a30007596ae52bf367e5f7af9a10e387954
Bug: 26769843
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
f7f1c1ef2a0e0696fbfa8065ac88cd1f8dd39623 27-Jan-2016 Yigit Boyar <yboyar@google.com> Choose last span if layout is towards first item

This CL fixes a bug in GridLayoutManager where it was selecting
the wrong span index if the very first layout will happen towards
the first item in the adapter.

Bug: 26572382
Change-Id: I3e623fc127b10fb8101af32b010541c2e0ece276
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.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/src/android/support/v7/widget/GridLayoutManager.java
f89e1b82c74b7b85df3a349340a643f62fc5bfa1 29-Dec-2015 Yigit Boyar <yboyar@google.com> Focus search improvements

This CL fixes a bug in GridLayoutManager where it would choose
the wrong view when it scrolls for focus search. Not it does
it properly by prioritizing currently focused View's span.

This CL also adds focus search failure support to StaggeredGridLM.

Bug: 26338413
Bug: 26333507
Change-Id: I263508be1b987f8630a65267cb17efba600292e3
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
bb2163aca1052da169c15625c9afca7b85491ebf 29-Oct-2015 Yigit Boyar <yboyar@google.com> Setup GridLayoutManager state before scroll

Bug: 25190021
Change-Id: I8ce5216b897c1a83368ac6577b0a658afc96243a
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
3bc9692bd8ee36a1eced339564ea6eaa4c8261db 06-Jul-2015 Yigit Boyar <yboyar@google.com> Don't cap measure spec in scroll orientation

This CL fixes a bug where GridLayoutManager would use wrong measure
specs for a View if it has fixed size in the scroll orientation.

Bug: 22296763
Change-Id: Iab3bc64da619958d7b5a63d89aca77e91b5fa454
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
21b345f101abc385496f42d250e580d21f1287b6 04-Jun-2015 Dake Gu <dake@google.com> RecyclerView: Add payload for efficient bind

Add an optional payload in onBindViewHolder and notifyItemChanged.
The payload can be used to indicate the partial change
of an item so that onBindViewHolder can do an efficient rebinding.

We are going to add in-place Change animation in next CL. The in-place
Change animation happens on the existing holder, Adapter will receive
a payload in onBindViewHolder.

The existing crossfading CHANGE involves two viewHolders, the oldViewHolder
is faded out without rebinding, the newViewHolder is binding to a
scrap view and faded in.

Change-Id: I117e5fe24d757dc89e68bb5860b5f4fb71bd9cf5
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
cf87e0b2827dba309646d6a73945b2e1d1fac248 03-Jun-2015 Yigit Boyar <yboyar@google.com> Prevent preLayout span size lookup calls

GridLayoutManager had a bug where the code path which
selects a View to be the anchor view was not going through
the cached span size lookup method. This could be a
problem because it misses the pre-layout cache and the
position is not converted into an adapter position,
possibly triggering an index out of bounds exception on
the SpanSizeLookup class.

This CL changes that method to use the cache. CL is
bigger than the actual change because I had to update method
signatures to be able to pass recycler and state objects
down to the lookup methods

Change-Id: I524504ae3ea3356b8a1b16b78924258003f6169e
Bug:21590767
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
0194ed84ad6f1d3d489db52b9431fa93a7697b50 16-Apr-2015 Deepanshu Gupta <deepanshu@google.com> Revert "Revert "Inflate RV attr to create the layout manager.""

This reverts commit 4d7dbfd2b24b8ebc49d3be5e0b5cbac76b2751ed.
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
4d7dbfd2b24b8ebc49d3be5e0b5cbac76b2751ed 14-Apr-2015 Yigit Boyar <yboyar@google.com> Revert "Inflate RV attr to create the layout manager."

This reverts commit 044b5b61e962367ccfc80250676eb98c86910877.
All dependent projects has to be changed to include RV resources before this can be merged.

Change-Id: I3d0af4345f9d838cc53d7ce34d81280cc7499760
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
044b5b61e962367ccfc80250676eb98c86910877 26-Mar-2015 Deepanshu Gupta <deepanshu@google.com> Inflate RV attr to create the layout manager.

Make RecyclerView more toolable. Add a custom attribute (layoutManager)
which accepts the class name of the LayoutManager to be used. The
LayoutManager specified should have a default constructor or a
constructor with the signature: (android.content.Context,
android.util.AttributeSet, int, int).

Example usage:
<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
res_auto:layoutManager="LinearLayoutManager"/>

<android.support.v7.widget.RecyclerView
android:layout_width="match_parent"
android:layout_height="match_parent"
res_auto:layoutManager=".CustomLayoutManager"/>

(res_auto is is the namespace prefix for
http://schemas.android.com/apk/res-auto)

Bug: 19780401
Change-Id: I46b26fce28c5b79b3a1e4321cf5c1e54ad089a5e
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
61d10279f76a9f6b3fcce882bc41012d3c941db4 30-Mar-2015 Yigit Boyar <yboyar@google.com> Merge "Fix predictive animations when first item is removed" into lmp-mr1-ub-dev
1f5c7b76bfc3da85513e6d2c6aa1058339f0c625 26-Mar-2015 Yigit Boyar <yboyar@google.com> Fix predictive animations when first item is removed

LinearLayoutManager was not running correct animations when first
item is removed. This CL fixes that issue.

This issue was also effecting GridLayoutManager which is also
fixed in this CL.

Bug: 19945822
Change-Id: I5580106cb908d4a289a343c42d6876ce4af711ff
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
0e05841eda1ee3e3568c9ed6088709c0f9cd4f5e 28-Mar-2015 Yigit Boyar <yboyar@google.com> resolved conflicts for merge of bcb644f8 to lmp-mr1-dev-plus-aosp

Change-Id: I3646e59ebdc9f255188d71cbf2528c1945db4e8a
7e6965e8f2c055634ce869bf78a4e4b32e4b0c1f 12-Feb-2015 Alexey Vitenko <alexei.vitenko@gmail.com> ISSUE-144101: change children size calculation

There is loss of accuracy, when users passed large span count to
GridLayoutManager's constructor.
And RecyclerView size became smaller, then users expect.

Change-Id: Id2fd03285e9bec7b2ed439f1c0ef8a3ddfcecdc4
ISSUE-144101: calculate all items borders
ISSUE-144101: optimize code
ISSUE-144101: add tests
ISSUE-144101: adjust lines size
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
e1f849813f093c6ebd09428f8f022de530bc5376 18-Mar-2015 Yigit Boyar <yboyar@google.com> Merge "Disable predictive animations when span count changes" into lmp-mr1-ub-dev
871092be9f8b8b212a7bf16a9d1b735c3964ee9b 24-Feb-2015 Yigit Boyar <yboyar@google.com> Snap items to right when layout is RTL

In RTL mode, GridLayoutManager was aligning children to the left although
it was ordering them properly (e.g. first child on right etc).

This CL fixes the bug and aligns children to right when RTL is true and
layout is vertical.

Bug: 19445130
Change-Id: If7a7bb39a3cae419ac348003e1e1dac6b213f11e
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
204f79ca6e0d6253c10a80da11056b03cb9d3fb0 12-Feb-2015 Yigit Boyar <yboyar@google.com> Disable predictive animations when span count changes

When span count is updated, we cannot query SpanSizeLookup
in pre-layout because it will assume it has the latest
span size. With this CL, we disable predictive animations
until span size change is applied in a layout pass.

This can be further improved by passing span size to
SpanSizeLookup#getSpanSize to support predictive
animations

Change-Id: I51373343a6fbd24442641b142d376afed28c28d9
Bug: 19356551
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.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/src/android/support/v7/widget/GridLayoutManager.java
42e9353bb9eb2747247e30e3612b227945acfd16 06-Nov-2014 Yigit Boyar <yboyar@google.com> Respect layout params in scroll direction

This CL improves how StaggeredGrid handles layout params. Previously, it was
ignoring the layout params completely. Now, it considers it while measuring the
child in scroll direction.

Bug: 18242667
Change-Id: I8c98e866fb582e93fcab2223d4d345ebbf8fda02
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
afa0494a97687b705feb3659385578f33f697ea9 15-Sep-2014 Yigit Boyar <yboyar@google.com> Fix GridLayoutManager's measurement bug

GridLayoutManager was not re-measuring shorter children when they are
resized to the size of tallest child.

Bug: 17487208
Change-Id: Iccd28cf29e27ceda3105259cb6e33e695a44926d
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
5f1c90f3afcf680f6467d80eb369f81f35222ed3 10-Sep-2014 Yigit Boyar <yboyar@google.com> QuickFix for GridLayoutManager's inheritence problem

Bug: 17422424
Change-Id: Ifa88d8e6f49a173a104c9a4ec38474b827978784
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
a910619e83d0052e1d81aa5fe532821a2f99d76c 09-Sep-2014 Yigit Boyar <yboyar@google.com> Add a11y support for RecyclerView

Bug: 17411052
Change-Id: I9ef93f0bb072e190d6017ee991e6d2c0ab119a62
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
b122e5ae5794e374229c241a2bc601b0809b7b04 05-Sep-2014 Yigit Boyar <yboyar@google.com> Fix javadoc build failure

Change-Id: I4d13e091ccc1b3ea788fdf16b6c639f799af19a4
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
061c3284cf284424ae084799dd7ba5c8d6d59faa 01-Sep-2014 Yigit Boyar <yboyar@google.com> Fix GridLayoutManager's reverse scroll

This change also fixes a bug where GridLayoutManager was not
respecting the size in LayoutParams (in scroll direction).

Bug: 17338285
Change-Id: I80f5fdd7c46f4ed2c7357f89c3556b0a7ed59d85
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
9ace89f49ed497e649b127beb12b8a237e5d30e7 16-Aug-2014 Yigit Boyar <yboyar@google.com> Add predictive animation support to GridLM

Bug: 16847853
Change-Id: Ibeda5c5efda7b87d387cbc1b56c766fca5e3bf3a
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
73304eff156157f62075215e795e774803a6f96a 15-Aug-2014 Yigit Boyar <yboyar@google.com> Span calculation bugfix for GridLM

This build also adds a sanity check to layout method to verify item's span count
and throw an exception if item does not fit to Grid.

Bug: 17064017
Change-Id: I6794ed04c7ccedb839e03a75c98c3949a959eb8c
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
c6f82b1e233c11ce3130325430be93ea018ba7f1 08-Aug-2014 Yigit Boyar <yboyar@google.com> Merge "Dont save config parameters in saved state" into lmp-dev
5e79cc4e2c96b0dd1d4de6f3208f9da3bcb69d26 06-Aug-2014 Yigit Boyar <yboyar@google.com> Provide a public method to calculate decor insets

Bug: 16842411
Change-Id: I3fa347d8f99da26b3afbf675334f670db710ca45
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
b8403301bbec29129730f6cce3fe2fa3ee8e1e0b 06-Aug-2014 Yigit Boyar <yboyar@google.com> Dont save config parameters in saved state

Bug: 16822490
Change-Id: I2c652bf96f583443ab6402969d3fedf652b9ec04
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java
b97e8219784e623526bc3c6077a698d608f04fd9 05-Aug-2014 Yigit Boyar <yboyar@google.com> Added simple GridLayoutManager

Bug: 16678349
Bug: 16734653
Bug: 16661383

Change-Id: I29a74bdffa9386831faab191f1c3d268743dbf6d
/frameworks/support/v7/recyclerview/src/android/support/v7/widget/GridLayoutManager.java