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

Commit 7645704f authored by Hawkwood Glazier's avatar Hawkwood Glazier Committed by Automerger Merge Worker
Browse files

Merge "Changing the system theme no longer causes a UMO flicker" into tm-dev am: fc279777

parents 80f59839 fc279777
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -150,12 +150,13 @@ class MediaCarouselController @Inject constructor(
        }
    private val configListener = object : ConfigurationController.ConfigurationListener {
        override fun onDensityOrFontScaleChanged() {
            recreatePlayers()
            // System font changes should only happen when UMO is offscreen or a flicker may occur
            updatePlayers(recreateMedia = true)
            inflateSettingsButton()
        }

        override fun onThemeChanged() {
            recreatePlayers()
            updatePlayers(recreateMedia = false)
            inflateSettingsButton()
        }

@@ -165,7 +166,7 @@ class MediaCarouselController @Inject constructor(
        }

        override fun onUiModeChanged() {
            recreatePlayers()
            updatePlayers(recreateMedia = false)
            inflateSettingsButton()
        }
    }
@@ -539,7 +540,7 @@ class MediaCarouselController @Inject constructor(
        }
    }

    private fun recreatePlayers() {
    private fun updatePlayers(recreateMedia: Boolean) {
        pageIndicator.tintList = ColorStateList.valueOf(
            context.getColor(R.color.media_paging_indicator)
        )
@@ -554,7 +555,9 @@ class MediaCarouselController @Inject constructor(
                }
            } else {
                val isSsReactivated = MediaPlayerData.isSsReactivated(key)
                if (recreateMedia) {
                    removePlayer(key, dismissMediaData = false, dismissRecommendation = false)
                }
                addOrUpdatePlayer(
                        key = key, oldKey = null, data = data, isSsReactivated = isSsReactivated)
            }