Skip to content

Commit 4bc4381

Browse files
imhappihunterstich
authored andcommitted
[Carousel] Added a notifyItemSizeChanged() method
PiperOrigin-RevId: 704836257
1 parent 4019e18 commit 4bc4381

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
@@ -212,6 +212,14 @@ private void setCarouselAttributes(Context context, AttributeSet attrs) {
212212
}
213213
}
214214

215+
/**
216+
* Recalculates the internal state of the Carousel based on the size of the items. This should be
217+
* called whenever the size of the items is changed.
218+
*/
219+
public void notifyItemSizeChanged() {
220+
refreshKeylineState();
221+
}
222+
215223
/**
216224
* Sets the alignment of the focal items in the carousel.
217225
*/

0 commit comments

Comments
 (0)