Loading packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +11 −8 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ class MediaCarouselController @Inject constructor( val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) existingPlayer.view?.player?.setLayoutParams(lp) existingPlayer.bind(data) existingPlayer.setListening(currentlyExpanded) updatePlayerToState(existingPlayer, noAnimation = true) if (existingPlayer.isPlaying) { Loading @@ -256,7 +257,9 @@ class MediaCarouselController @Inject constructor( } else { mediaContent.addView(existingPlayer.view?.player) } } else if (existingPlayer.isPlaying && } else { existingPlayer.bind(data) if (existingPlayer.isPlaying && mediaContent.indexOfChild(existingPlayer.view?.player) != 0) { if (visualStabilityManager.isReorderingAllowed) { mediaContent.removeView(existingPlayer.view?.player) Loading @@ -265,7 +268,7 @@ class MediaCarouselController @Inject constructor( needsReordering = true } } existingPlayer?.bind(data) } updatePageIndicator() mediaCarouselScrollHandler.onPlayersChanged() mediaCarousel.requiresRemeasuring = true Loading packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt +9 −7 Original line number Diff line number Diff line Loading @@ -268,7 +268,6 @@ class MediaViewController @Inject constructor( fun attach(transitionLayout: TransitionLayout) { this.transitionLayout = transitionLayout layoutController.attach(transitionLayout) ensureAllMeasurements() if (currentEndLocation == -1) { return } Loading Loading @@ -414,14 +413,17 @@ class MediaViewController @Inject constructor( * Clear all existing measurements and refresh the state to match the view. */ fun refreshState() { if (!firstRefresh) { // Let's clear all of our measurements and recreate them! viewStates.clear() if (firstRefresh) { // This is the first bind, let's ensure we pre-cache all measurements. Otherwise // We'll just load these on demand. ensureAllMeasurements() firstRefresh = false } setCurrentState(currentStartLocation, currentEndLocation, currentTransitionProgress, applyImmediately = true) } firstRefresh = false } } /** Loading Loading
packages/SystemUI/src/com/android/systemui/media/MediaCarouselController.kt +11 −8 Original line number Diff line number Diff line Loading @@ -249,6 +249,7 @@ class MediaCarouselController @Inject constructor( val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT) existingPlayer.view?.player?.setLayoutParams(lp) existingPlayer.bind(data) existingPlayer.setListening(currentlyExpanded) updatePlayerToState(existingPlayer, noAnimation = true) if (existingPlayer.isPlaying) { Loading @@ -256,7 +257,9 @@ class MediaCarouselController @Inject constructor( } else { mediaContent.addView(existingPlayer.view?.player) } } else if (existingPlayer.isPlaying && } else { existingPlayer.bind(data) if (existingPlayer.isPlaying && mediaContent.indexOfChild(existingPlayer.view?.player) != 0) { if (visualStabilityManager.isReorderingAllowed) { mediaContent.removeView(existingPlayer.view?.player) Loading @@ -265,7 +268,7 @@ class MediaCarouselController @Inject constructor( needsReordering = true } } existingPlayer?.bind(data) } updatePageIndicator() mediaCarouselScrollHandler.onPlayersChanged() mediaCarousel.requiresRemeasuring = true Loading
packages/SystemUI/src/com/android/systemui/media/MediaViewController.kt +9 −7 Original line number Diff line number Diff line Loading @@ -268,7 +268,6 @@ class MediaViewController @Inject constructor( fun attach(transitionLayout: TransitionLayout) { this.transitionLayout = transitionLayout layoutController.attach(transitionLayout) ensureAllMeasurements() if (currentEndLocation == -1) { return } Loading Loading @@ -414,14 +413,17 @@ class MediaViewController @Inject constructor( * Clear all existing measurements and refresh the state to match the view. */ fun refreshState() { if (!firstRefresh) { // Let's clear all of our measurements and recreate them! viewStates.clear() if (firstRefresh) { // This is the first bind, let's ensure we pre-cache all measurements. Otherwise // We'll just load these on demand. ensureAllMeasurements() firstRefresh = false } setCurrentState(currentStartLocation, currentEndLocation, currentTransitionProgress, applyImmediately = true) } firstRefresh = false } } /** Loading