Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit acc27ef7 authored by Selim Cinek's avatar Selim Cinek Committed by Automerger Merge Worker
Browse files

Merge "Fixed that texts of players would often remain empty" into rvc-dev am:...

Merge "Fixed that texts of players would often remain empty" into rvc-dev am: 7387faf8 am: e9f3fa53

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12038727

Change-Id: I7199f6167469e52677ef7e31e5c535f76ecf0412
parents c3b05a8a e9f3fa53
Loading
Loading
Loading
Loading
+11 −8
Original line number Original line Diff line number Diff line
@@ -249,6 +249,7 @@ class MediaCarouselController @Inject constructor(
            val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
            val lp = LinearLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT,
                    ViewGroup.LayoutParams.WRAP_CONTENT)
                    ViewGroup.LayoutParams.WRAP_CONTENT)
            existingPlayer.view?.player?.setLayoutParams(lp)
            existingPlayer.view?.player?.setLayoutParams(lp)
            existingPlayer.bind(data)
            existingPlayer.setListening(currentlyExpanded)
            existingPlayer.setListening(currentlyExpanded)
            updatePlayerToState(existingPlayer, noAnimation = true)
            updatePlayerToState(existingPlayer, noAnimation = true)
            if (existingPlayer.isPlaying) {
            if (existingPlayer.isPlaying) {
@@ -256,7 +257,9 @@ class MediaCarouselController @Inject constructor(
            } else {
            } else {
                mediaContent.addView(existingPlayer.view?.player)
                mediaContent.addView(existingPlayer.view?.player)
            }
            }
        } else if (existingPlayer.isPlaying &&
        } else {
            existingPlayer.bind(data)
            if (existingPlayer.isPlaying &&
                    mediaContent.indexOfChild(existingPlayer.view?.player) != 0) {
                    mediaContent.indexOfChild(existingPlayer.view?.player) != 0) {
                if (visualStabilityManager.isReorderingAllowed) {
                if (visualStabilityManager.isReorderingAllowed) {
                    mediaContent.removeView(existingPlayer.view?.player)
                    mediaContent.removeView(existingPlayer.view?.player)
@@ -265,7 +268,7 @@ class MediaCarouselController @Inject constructor(
                    needsReordering = true
                    needsReordering = true
                }
                }
            }
            }
        existingPlayer?.bind(data)
        }
        updatePageIndicator()
        updatePageIndicator()
        mediaCarouselScrollHandler.onPlayersChanged()
        mediaCarouselScrollHandler.onPlayersChanged()
        mediaCarousel.requiresRemeasuring = true
        mediaCarousel.requiresRemeasuring = true
+9 −7
Original line number Original line Diff line number Diff line
@@ -268,7 +268,6 @@ class MediaViewController @Inject constructor(
    fun attach(transitionLayout: TransitionLayout) {
    fun attach(transitionLayout: TransitionLayout) {
        this.transitionLayout = transitionLayout
        this.transitionLayout = transitionLayout
        layoutController.attach(transitionLayout)
        layoutController.attach(transitionLayout)
        ensureAllMeasurements()
        if (currentEndLocation == -1) {
        if (currentEndLocation == -1) {
            return
            return
        }
        }
@@ -414,14 +413,17 @@ class MediaViewController @Inject constructor(
     * Clear all existing measurements and refresh the state to match the view.
     * Clear all existing measurements and refresh the state to match the view.
     */
     */
    fun refreshState() {
    fun refreshState() {
        if (!firstRefresh) {
        // Let's clear all of our measurements and recreate them!
        // Let's clear all of our measurements and recreate them!
        viewStates.clear()
        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,
        setCurrentState(currentStartLocation, currentEndLocation, currentTransitionProgress,
                applyImmediately = true)
                applyImmediately = true)
    }
    }
        firstRefresh = false
    }
}
}


/**
/**