Merge "Changing the system theme no longer causes a UMO flicker" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
fc27977780
@@ -150,12 +150,13 @@ class MediaCarouselController @Inject constructor(
|
|||||||
}
|
}
|
||||||
private val configListener = object : ConfigurationController.ConfigurationListener {
|
private val configListener = object : ConfigurationController.ConfigurationListener {
|
||||||
override fun onDensityOrFontScaleChanged() {
|
override fun onDensityOrFontScaleChanged() {
|
||||||
recreatePlayers()
|
// System font changes should only happen when UMO is offscreen or a flicker may occur
|
||||||
|
updatePlayers(recreateMedia = true)
|
||||||
inflateSettingsButton()
|
inflateSettingsButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onThemeChanged() {
|
override fun onThemeChanged() {
|
||||||
recreatePlayers()
|
updatePlayers(recreateMedia = false)
|
||||||
inflateSettingsButton()
|
inflateSettingsButton()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -165,7 +166,7 @@ class MediaCarouselController @Inject constructor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onUiModeChanged() {
|
override fun onUiModeChanged() {
|
||||||
recreatePlayers()
|
updatePlayers(recreateMedia = false)
|
||||||
inflateSettingsButton()
|
inflateSettingsButton()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -539,7 +540,7 @@ class MediaCarouselController @Inject constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun recreatePlayers() {
|
private fun updatePlayers(recreateMedia: Boolean) {
|
||||||
pageIndicator.tintList = ColorStateList.valueOf(
|
pageIndicator.tintList = ColorStateList.valueOf(
|
||||||
context.getColor(R.color.media_paging_indicator)
|
context.getColor(R.color.media_paging_indicator)
|
||||||
)
|
)
|
||||||
@@ -554,7 +555,9 @@ class MediaCarouselController @Inject constructor(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
val isSsReactivated = MediaPlayerData.isSsReactivated(key)
|
val isSsReactivated = MediaPlayerData.isSsReactivated(key)
|
||||||
removePlayer(key, dismissMediaData = false, dismissRecommendation = false)
|
if (recreateMedia) {
|
||||||
|
removePlayer(key, dismissMediaData = false, dismissRecommendation = false)
|
||||||
|
}
|
||||||
addOrUpdatePlayer(
|
addOrUpdatePlayer(
|
||||||
key = key, oldKey = null, data = data, isSsReactivated = isSsReactivated)
|
key = key, oldKey = null, data = data, isSsReactivated = isSsReactivated)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user