mirror of
https://github.com/inotia00/revanced-patches.git
synced 2025-05-30 05:40:19 +02:00
feat(YouTube/Overlay buttons): add patch option WiderButtonsSpace
(#87)
* add patch option "WiderButtonsSpace" * add patch option "WiderButtonsSpace" * fix: fix build errors and remove duplicate resources --------- Co-authored-by: inotia00 <108592928+inotia00@users.noreply.github.com>
This commit is contained in:
parent
8119eefedb
commit
38274249d8
@ -70,6 +70,15 @@ object OverlayButtonsPatch : BaseResourcePatch(
|
|||||||
required = true
|
required = true
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Option to choose wider between-buttons space
|
||||||
|
private val WiderButtonsSpace by booleanPatchOption(
|
||||||
|
key = "WiderButtonsSpace",
|
||||||
|
default = false,
|
||||||
|
title = "Wider between-buttons space",
|
||||||
|
description = "Prevent adjacent button presses by increasing the horizontal spacing between buttons.",
|
||||||
|
required = true
|
||||||
|
)
|
||||||
|
|
||||||
// Option to change top buttons
|
// Option to change top buttons
|
||||||
private val ChangeTopButtons by booleanPatchOption(
|
private val ChangeTopButtons by booleanPatchOption(
|
||||||
key = "ChangeTopButtons",
|
key = "ChangeTopButtons",
|
||||||
@ -203,16 +212,22 @@ object OverlayButtonsPatch : BaseResourcePatch(
|
|||||||
"@id/timestamps_container" to "14.0dip"
|
"@id/timestamps_container" to "14.0dip"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
val widerButtonsSpace = WiderButtonsSpace == true
|
||||||
|
val layoutHeightWidth = if (widerButtonsSpace)
|
||||||
|
"56.0dip"
|
||||||
|
else
|
||||||
|
"48.0dip"
|
||||||
|
|
||||||
if (isButton) {
|
if (isButton) {
|
||||||
node.setAttribute("android:layout_marginBottom", marginBottom)
|
node.setAttribute("android:layout_marginBottom", marginBottom)
|
||||||
node.setAttribute("android:paddingLeft", "0.0dip")
|
node.setAttribute("android:paddingLeft", "0.0dip")
|
||||||
node.setAttribute("android:paddingRight", "0.0dip")
|
node.setAttribute("android:paddingRight", "0.0dip")
|
||||||
node.setAttribute("android:paddingBottom", "22.0dip")
|
node.setAttribute("android:paddingBottom", "22.0dip")
|
||||||
if (heightIsNotZero && widthIsNotZero) {
|
if (heightIsNotZero && widthIsNotZero) {
|
||||||
node.setAttribute("android:layout_height", "48.0dip")
|
node.setAttribute("android:layout_height", layoutHeightWidth)
|
||||||
node.setAttribute("android:layout_width", "48.0dip")
|
node.setAttribute("android:layout_width", layoutHeightWidth)
|
||||||
}
|
}
|
||||||
} else if (timBarItem.containsKey(id)) {
|
} else if (!widerButtonsSpace && timBarItem.containsKey(id)) {
|
||||||
node.setAttribute("android:layout_marginBottom", marginBottom)
|
node.setAttribute("android:layout_marginBottom", marginBottom)
|
||||||
node.setAttribute("android:paddingBottom", timBarItem.getValue(id))
|
node.setAttribute("android:paddingBottom", timBarItem.getValue(id))
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user