Skip to content

Commit

Permalink
Ensure sticky-header is added when calling obtainLithoViewChildren
Browse files Browse the repository at this point in the history
Summary: When unmounting content with child LithoViews, we collect those LithoViews via the obtainLithoViewChildren API. SectionsRecyclerView was already doing this, but was not adding the sticky-header view which is a LithoView as well. This fix ensures the sticky header is added as well.

Reviewed By: astreet

Differential Revision: D31728554

fbshipit-source-id: ec0321d0a72687f35d8be2ad198d8a7cb4f4d3b7
  • Loading branch information
Gil Moshayof authored and facebook-github-bot committed Oct 19, 2021
1 parent 904f621 commit 8dcddce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ public void incrementalMount_componentOffScreen_mountIfAnimating() {

sectionsRecyclerView.obtainLithoViewChildren(lithoViews);

final LithoView animatingLithoView = lithoViews.get(1);
// grab the 2nd litho-view in the list (0 = sticky header, 1 = 1st litho view)
final LithoView animatingLithoView = lithoViews.get(2);
animatingLithoView.onAttachedToWindowForTest();

mStateCaller.update();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ public void setOnTouchListener(OnTouchListener listener) {

@Override
public void obtainLithoViewChildren(List<LithoView> lithoViews) {
lithoViews.add(mStickyHeader);
for (int i = 0, size = mRecyclerView.getChildCount(); i < size; i++) {
final View child = mRecyclerView.getChildAt(i);
if (child instanceof LithoView) {
Expand Down

0 comments on commit 8dcddce

Please sign in to comment.