Skip to content

Commit 674ec44

Browse files
imhappipaulfthomas
authored andcommitted
[Carousel] Fix issue with not refreshing keylines
PiperOrigin-RevId: 547956870
1 parent 3b0fd58 commit 674ec44

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/java/com/google/android/material/carousel/CarouselLayoutManager.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ public void setCarouselStrategy(@NonNull CarouselStrategy carouselStrategy) {
176176
refreshKeylineState();
177177
}
178178

179+
@Override
180+
public void onAttachedToWindow(RecyclerView view) {
181+
super.onAttachedToWindow(view);
182+
// TODO: b/291123558 - Keylines should be also be refreshed when
183+
// there's any change affecting dimens of the RecyclerView.
184+
refreshKeylineState();
185+
}
186+
179187
@Override
180188
public void onLayoutChildren(Recycler recycler, State state) {
181189
if (state.getItemCount() <= 0) {

0 commit comments

Comments
 (0)