about: fix inconsistent tinting

This commit is contained in:
Alexander Capehart
2026-02-07 18:17:26 -07:00
parent fa8d0d66cf
commit 09b2beecd9
@@ -548,9 +548,14 @@ constructor(context: Context, attrs: AttributeSet? = null, @AttrRes defStyleAttr
*/ */
private class StyledDrawable( private class StyledDrawable(
context: Context, context: Context,
private val inner: Drawable, inner: Drawable,
@Px val iconSize: Int?, @Px val iconSize: Int?,
) : Drawable() { ) : Drawable() {
// Never tint a shared drawable instance. These icons are also used elsewhere (e.g. the
// About screen), and tinting without mutation can leak the modified tint state across
// views in inconsistent ways depending on drawable caching/inflation order.
private val inner: Drawable = (inner.constantState?.newDrawable() ?: inner).mutate()
init { init {
// Re-tint the drawable to use the analogous "on surface" color for // Re-tint the drawable to use the analogous "on surface" color for
// StyledImageView. // StyledImageView.