From 1d052a84e05bd9a25d5dd83d7fe5e455cba2130c Mon Sep 17 00:00:00 2001 From: inotia00 <108592928+inotia00@users.noreply.github.com> Date: Fri, 27 Oct 2023 12:47:17 +0900 Subject: [PATCH] fix(YouTube/Overlay buttons): increase the size of the overlay button by 6% and add some bottom margin --- .../general/OverlayButtonsPatch.kt | 20 +++++++++---------- .../youtube_controls_bottom_ui_container.xml | 10 +++++----- 2 files changed, 14 insertions(+), 16 deletions(-) diff --git a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt index 255b1287d..d4fedea2b 100644 --- a/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt +++ b/src/main/kotlin/app/revanced/patches/youtube/overlaybutton/general/OverlayButtonsPatch.kt @@ -171,16 +171,13 @@ object OverlayButtonsPatch : ResourcePatch() { } // Adjust Fullscreen Button size and padding - val padding = "0.0dip" to arrayOf( - "paddingLeft", - "paddingRight", - "paddingTop", - "paddingBottom" - ) - val size = "45.0dip" to arrayOf("layout_width", "layout_height") it.getAttributeNode("android:id")?.let { attribute -> if (attribute.textContent == "@id/fullscreen_button") { - arrayOf(padding, size).forEach { (replace, attributes) -> + arrayOf( + "0.0dip" to arrayOf("paddingLeft", "paddingRight"), + "22.0dip" to arrayOf("paddingBottom"), + "48.0dip" to arrayOf("layout_height", "layout_width") + ).forEach { (replace, attributes) -> attributes.forEach { name -> it.getAttributeNode("android:$name").textContent = replace } @@ -189,9 +186,10 @@ object OverlayButtonsPatch : ResourcePatch() { } // Adjust TimeBar and Chapter bottom padding - val timeBarChapter = "@id/time_bar_chapter_title" to "14.0dip" - val timeStampContainer = "@id/timestamps_container" to "12.0dip" - arrayOf(timeBarChapter, timeStampContainer).forEach { (id, replace) -> + arrayOf( + "@id/time_bar_chapter_title" to "14.0dip", + "@id/timestamps_container" to "12.0dip" + ).forEach { (id, replace) -> it.getAttributeNode("android:id")?.let { attribute -> if (attribute.textContent == id) { it.getAttributeNode("android:paddingBottom").textContent = replace diff --git a/src/main/resources/youtube/overlaybuttons/shared/host/layout/youtube_controls_bottom_ui_container.xml b/src/main/resources/youtube/overlaybuttons/shared/host/layout/youtube_controls_bottom_ui_container.xml index 6a3bb5372..138d7b8d8 100644 --- a/src/main/resources/youtube/overlaybuttons/shared/host/layout/youtube_controls_bottom_ui_container.xml +++ b/src/main/resources/youtube/overlaybuttons/shared/host/layout/youtube_controls_bottom_ui_container.xml @@ -1,8 +1,8 @@ - - - - - + + + + +