From 469e6f0afa44ea66f9c26ee87267804bc27c77eb Mon Sep 17 00:00:00 2001 From: IndusAryan Date: Sun, 4 Feb 2024 12:43:11 +0530 Subject: [PATCH] feat(twitter): good morning! --- .../org/patches/twitter/SplashScreenHelper.kt | 31 +++++++------------ .../indus/org/patches/twitter/XMLUtils.kt | 11 +++---- .../patches/twitter/brand/BlackBirdIcon.kt | 8 ++--- 3 files changed, 20 insertions(+), 30 deletions(-) diff --git a/src/main/kotlin/indus/org/patches/twitter/SplashScreenHelper.kt b/src/main/kotlin/indus/org/patches/twitter/SplashScreenHelper.kt index 228341e..013a29f 100644 --- a/src/main/kotlin/indus/org/patches/twitter/SplashScreenHelper.kt +++ b/src/main/kotlin/indus/org/patches/twitter/SplashScreenHelper.kt @@ -6,27 +6,20 @@ class SplashScreenHelper { fun changeSplashScreen(context: ResourceContext) { - context.xmlEditor["res/values/styles.xml"].use { editor -> - val document = editor.file - val styles = document.getElementsByTagName("style") - for (i in 0 until styles.length) { - val styleNode = styles.item(i) - if (styleNode.attributes.getNamedItem("name")?.nodeValue == "Theme.LaunchScreen") { + val newSplashVector = """ + + + + + """.trimIndent() - val styleItems = setOf( - "windowSplashScreenAnimatedIcon" to "@drawable/ic_vector_twitter_white", - ) - styleItems.forEach { (k, v) -> - val styleElement = document.createElement("item") - styleElement.setAttribute("name", k) - styleElement.textContent = v - styleNode.appendChild(styleElement) - } + val splashFile = context["res/drawable/splash_screen_icon.xml"] + splashFile.writeText(newSplashVector) - break - } - } - } } } diff --git a/src/main/kotlin/indus/org/patches/twitter/XMLUtils.kt b/src/main/kotlin/indus/org/patches/twitter/XMLUtils.kt index d08160c..60dd670 100644 --- a/src/main/kotlin/indus/org/patches/twitter/XMLUtils.kt +++ b/src/main/kotlin/indus/org/patches/twitter/XMLUtils.kt @@ -65,7 +65,7 @@ object XMLUtils { """ private val ogBirdVectorWhite = """ - + +