Fix search header rendering after rotation.

The sticky header cache was keeping views across rotations, causing them
to render incorrectly afterwards. I added a method to invalidate the
header layouts after rotation.

Fixes #7890.
This commit is contained in:
Greyson Parrelli
2018-06-14 10:50:21 -07:00
parent 44f5cc9070
commit 626e6930a5
2 changed files with 22 additions and 5 deletions

View File

@@ -181,6 +181,10 @@ public class StickyHeaderDecoration extends RecyclerView.ItemDecoration {
((LinearLayoutManager)parent.getLayoutManager()).getReverseLayout();
}
public void invalidateLayouts() {
headerCache.clear();
}
/**
* The adapter to assist the {@link StickyHeaderDecoration} in creating and binding the header views.
*