mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-02 07:34:31 +02:00
chore: lint code
This commit is contained in:
parent
32ceb7fd8a
commit
8b1f2e8aaf
@ -1,38 +0,0 @@
|
||||
package app.revanced.patches.shared.voicesearch
|
||||
|
||||
import app.revanced.patcher.data.ResourceContext
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
object VoiceSearchUtils {
|
||||
private const val IMAGE_VIEW_TAG = "android.support.v7.widget.AppCompatImageView"
|
||||
private const val VOICE_SEARCH_ID = "@id/voice_search"
|
||||
|
||||
internal fun ResourceContext.patchXml(
|
||||
paths: Array<String>,
|
||||
replacements: Array<String>
|
||||
) {
|
||||
val resDirectory = this["res"]
|
||||
|
||||
paths.forEach { path ->
|
||||
val targetXmlPath = resDirectory.resolve("layout").resolve(path)
|
||||
|
||||
if (targetXmlPath.exists()) {
|
||||
this.xmlEditor["res/layout/$path"].use { editor ->
|
||||
val document = editor.file
|
||||
val imageViewTags = document.getElementsByTagName(IMAGE_VIEW_TAG)
|
||||
List(imageViewTags.length) { imageViewTags.item(it) as Element }
|
||||
.filter { it.getAttribute("android:id").equals(VOICE_SEARCH_ID) }
|
||||
.forEach { node ->
|
||||
replacements.forEach replacement@{ replacement ->
|
||||
node.getAttributeNode("android:layout_$replacement")
|
||||
?.let { attribute ->
|
||||
attribute.textContent = "0.0dip"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -8,7 +8,7 @@ import app.revanced.util.patch.BaseResourcePatch
|
||||
import org.w3c.dom.Element
|
||||
|
||||
@Suppress("Deprecation", "unused")
|
||||
object ForcePlayerButtonBackgroundPatch : BaseResourcePatch(
|
||||
object PlayerButtonBackgroundPatch : BaseResourcePatch(
|
||||
name = "Force hide player buttons background",
|
||||
description = "Removes, at compile time, the dark background surrounding the video player controls.",
|
||||
dependencies = setOf(SettingsPatch::class),
|
||||
|
@ -833,7 +833,7 @@ Limitation: Video title disappears when clicked."</string>
|
||||
<string name="revanced_hide_player_fullscreen_button_title">Hide Fullscreen button</string>
|
||||
<string name="revanced_hide_player_fullscreen_button_summary_on">Fullscreen button is hidden.</string>
|
||||
<string name="revanced_hide_player_fullscreen_button_summary_off">Fullscreen button is shown.</string>
|
||||
<string name="revanced_hide_player_previous_next_button_title">Hide previous & next buttons</string>
|
||||
<string name="revanced_hide_player_previous_next_button_title">Hide Previous & Next buttons</string>
|
||||
<string name="revanced_hide_player_previous_next_button_summary_on">Buttons are hidden.</string>
|
||||
<string name="revanced_hide_player_previous_next_button_summary_off">Buttons are shown.</string>
|
||||
<string name="revanced_hide_player_youtube_music_button_title">Hide YouTube Music button</string>
|
||||
|
Loading…
x
Reference in New Issue
Block a user