feat(Stocard): Add Hide offers tab and Hide story bubbles patch (#3359)

Co-authored-by: oSumAtrIX <johan.melkonyan1@web.de>
This commit is contained in:
epireyn
2024-06-27 22:26:35 +02:00
committed by GitHub
parent c6b2f8c017
commit fbd0507ce5
3 changed files with 66 additions and 0 deletions

View File

@ -0,0 +1,27 @@
package app.revanced.patches.stocard.layout
import app.revanced.patcher.data.ResourceContext
import app.revanced.patcher.patch.ResourcePatch
import app.revanced.patcher.patch.annotation.CompatiblePackage
import app.revanced.patcher.patch.annotation.Patch
import app.revanced.util.childElementsSequence
import app.revanced.util.getNode
@Patch(
name = "Hide offers tab",
compatiblePackages = [CompatiblePackage("de.stocard.stocard")],
)
@Suppress("unused")
object HideOffersTabPatch : ResourcePatch() {
override fun execute(context: ResourceContext) {
context.document["res/menu/bottom_navigation_menu.xml"].use { document ->
document.getNode("menu").apply {
removeChild(
childElementsSequence().first {
it.attributes.getNamedItem("android:id")?.nodeValue?.contains("offer") ?: false
},
)
}
}
}
}