Skip to content

Commit bb916a7

Browse files
committed
fix(YouTube/Theme): reverts background color of More comments icon in live chats inotia00/ReVanced_Extended#2197
1 parent 53df153 commit bb916a7

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/kotlin/app/revanced/patches/youtube/layout/theme/BaseThemePatch.kt

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import app.revanced.patcher.patch.ResourcePatch
55
import app.revanced.patcher.patch.annotation.Patch
66
import app.revanced.patches.shared.drawable.DrawableColorPatch
77
import app.revanced.patches.youtube.utils.integrations.Constants.UTILS_PATH
8+
import app.revanced.util.doRecursively
89
import org.w3c.dom.Element
910

1011
@Patch(dependencies = [DrawableColorPatch::class])
@@ -87,6 +88,24 @@ object BaseThemePatch : ResourcePatch() {
8788
}
8889
}
8990

91+
/**
92+
* Since YouTube 19.20.35, the visibility of the background color of the `More comments` icon in live chat has worsened.
93+
* See <a href="https://github.com/inotia00/ReVanced_Extended/issues/2197">ReVanced_Extended#2197</a>
94+
*
95+
* As a temporary workaround, revert to the colors of YouTube 19.19.39.
96+
*/
97+
context.xmlEditor["res/drawable/live_chat_more_comments_selector.xml"].use { editor ->
98+
editor.file.doRecursively loop@{ node ->
99+
if (node !is Element) return@loop
100+
101+
node.getAttributeNode("android:color")?.let { attribute ->
102+
if (attribute.textContent == "?ytInvertedBackground") {
103+
attribute.textContent = "?ytThemedBlue"
104+
}
105+
}
106+
}
107+
}
108+
90109
}
91110

92111
internal var isMonetPatchIncluded: Boolean = false

0 commit comments

Comments
 (0)