Remeasure entire carousel view when players change

The page indicator view was not being consistently remeasured when new dots
were added for new players, resulting in invisible (0x0) dot views

Instead of only requiring remeasure of the mediaCarousel view, require
it for the entire frame which contains both that and the pageIndicator
view. This ensures that the dots will be measured and sized correctly.

Fixes: 194351796
Test: manual - follow repro steps, observe correct number of dots
Change-Id: I2b2b8b5bc906549f76d2705e117d0a2670da819d
This commit is contained in:
Beth Thibodeau
2021-11-17 18:53:04 -05:00
parent 2ab2685cca
commit 8ea639575b

View File

@@ -400,7 +400,7 @@ class MediaCarouselController @Inject constructor(
}
updatePageIndicator()
mediaCarouselScrollHandler.onPlayersChanged()
mediaCarousel.requiresRemeasuring = true
mediaFrame.requiresRemeasuring = true
// Check postcondition: mediaContent should have the same number of children as there are
// elements in mediaPlayers.
if (MediaPlayerData.players().size != mediaContent.childCount) {
@@ -439,7 +439,7 @@ class MediaCarouselController @Inject constructor(
updatePlayerToState(newRecs, noAnimation = true)
reorderAllPlayers(curVisibleMediaKey)
updatePageIndicator()
mediaCarousel.requiresRemeasuring = true
mediaFrame.requiresRemeasuring = true
// Check postcondition: mediaContent should have the same number of children as there are
// elements in mediaPlayers.
if (MediaPlayerData.players().size != mediaContent.childCount) {