mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-19 07:47:17 +02:00
add hide-double-tap-overlay-filter
patch https://github.com/inotia00/ReVanced_Extended/issues/258
This commit is contained in:
parent
9fa2ecc345
commit
3964a36bb6
@ -0,0 +1,46 @@
|
|||||||
|
package app.revanced.patches.youtube.layout.etc.doubletapbackground.patch
|
||||||
|
|
||||||
|
import app.revanced.patcher.annotation.Description
|
||||||
|
import app.revanced.patcher.annotation.Name
|
||||||
|
import app.revanced.patcher.annotation.Version
|
||||||
|
import app.revanced.patcher.data.ResourceContext
|
||||||
|
import app.revanced.patcher.patch.PatchResult
|
||||||
|
import app.revanced.patcher.patch.PatchResultSuccess
|
||||||
|
import app.revanced.patcher.patch.ResourcePatch
|
||||||
|
import app.revanced.patcher.patch.annotations.DependsOn
|
||||||
|
import app.revanced.patcher.patch.annotations.Patch
|
||||||
|
import app.revanced.patches.shared.annotation.YouTubeCompatibility
|
||||||
|
import app.revanced.patches.youtube.misc.settings.resource.patch.SettingsPatch
|
||||||
|
|
||||||
|
@Patch(false)
|
||||||
|
@Name("hide-double-tap-overlay-filter")
|
||||||
|
@Description("Remove the double tap dark filter layer.")
|
||||||
|
@DependsOn([SettingsPatch::class])
|
||||||
|
@YouTubeCompatibility
|
||||||
|
@Version("0.0.1")
|
||||||
|
class DoubleTapOverlayBackgroundPatch : ResourcePatch {
|
||||||
|
override fun execute(context: ResourceContext): PatchResult {
|
||||||
|
context.xmlEditor[RESOURCE_FILE_PATH].use {
|
||||||
|
it.file.getElementsByTagName("merge").item(0).childNodes.apply {
|
||||||
|
for (i in 1 until length) {
|
||||||
|
val view = item(i)
|
||||||
|
if (
|
||||||
|
view.hasAttributes() &&
|
||||||
|
view.attributes.getNamedItem("android:id").nodeValue.endsWith("dark_background")
|
||||||
|
) {
|
||||||
|
view.attributes.getNamedItem("android:src").nodeValue = "@color/full_transparent"
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsPatch.updatePatchStatus("hide-double-tap-overlay-filter")
|
||||||
|
|
||||||
|
return PatchResultSuccess()
|
||||||
|
}
|
||||||
|
|
||||||
|
private companion object {
|
||||||
|
const val RESOURCE_FILE_PATH = "res/layout/quick_seek_overlay.xml"
|
||||||
|
}
|
||||||
|
}
|
@ -543,6 +543,7 @@
|
|||||||
<Preference android:title="client-spoof" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="client-spoof" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="hide-pip-notification" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="hide-pip-notification" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="hide-tooltip-content" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="hide-tooltip-content" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
|
<Preference android:title="hide-double-tap-overlay-filter" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="optimize-resource" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="optimize-resource" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="translations" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
<Preference android:title="translations" android:summary="@string/revanced_patches_excluded" android:selectable="false"/>
|
||||||
<Preference android:title="labels" android:summary="@string/revanced_labels_default" android:selectable="false"/>
|
<Preference android:title="labels" android:summary="@string/revanced_labels_default" android:selectable="false"/>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user