From c95170ecbd9b2d4a4e7125baf7e2194986b4e79a Mon Sep 17 00:00:00 2001 From: LisoUseInAIKyrios <118716522+LisoUseInAIKyrios@users.noreply.github.com> Date: Mon, 27 Oct 2025 11:11:51 +0400 Subject: [PATCH] fix fullscreen button vertical alignment --- .../playercontrols/PlayerControlsPatch.kt | 12 +++++++ .../youtube_controls_bottom_ui_container.xml | 2 +- .../youtube_controls_bottom_ui_container.xml | 35 +++++++++---------- 3 files changed, 30 insertions(+), 19 deletions(-) diff --git a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/PlayerControlsPatch.kt b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/PlayerControlsPatch.kt index 00edcbe4f..6af9b1a13 100644 --- a/patches/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/PlayerControlsPatch.kt +++ b/patches/src/main/kotlin/app/revanced/patches/youtube/misc/playercontrols/PlayerControlsPatch.kt @@ -72,6 +72,18 @@ internal val playerControlsResourcePatch = resourcePatch { bottomLastLeftOf, ) + // Modify the fullscreen button stub attributes for correct positioning. + // The fullscreen button is lower than the ReVanced buttons (unpatched app bug). + // Issue is only present in later app targets, but this change seems to + // do no harm to earlier releases. + bottomTargetDocumentChildNodes.findElementByAttributeValueOrThrow( + "android:id", + "@id/youtube_controls_fullscreen_button_stub" + ).apply { + setAttribute("android:layout_marginBottom", "6.0dip") + setAttribute("android:layout_width", "48.0dip") + } + addTopControl = { resourceDirectoryName -> val resourceFileName = "host/layout/youtube_controls_layout.xml" val hostingResourceStream = inputStreamFromBundledResource( diff --git a/patches/src/main/resources/downloads/host/layout/youtube_controls_bottom_ui_container.xml b/patches/src/main/resources/downloads/host/layout/youtube_controls_bottom_ui_container.xml index a243eea71..a3f7a9e11 100644 --- a/patches/src/main/resources/downloads/host/layout/youtube_controls_bottom_ui_container.xml +++ b/patches/src/main/resources/downloads/host/layout/youtube_controls_bottom_ui_container.xml @@ -11,7 +11,7 @@ style="@style/YouTubePlayerButton" android:layout_width="48.0dip" android:layout_height="60.0dip" - android:paddingTop="6.5dp" + android:paddingTop="6.0dp" android:paddingBottom="0dp" android:longClickable="false" android:scaleType="center" diff --git a/patches/src/main/resources/loopvideobutton/host/layout/youtube_controls_bottom_ui_container.xml b/patches/src/main/resources/loopvideobutton/host/layout/youtube_controls_bottom_ui_container.xml index bcd7def9e..1947f997e 100644 --- a/patches/src/main/resources/loopvideobutton/host/layout/youtube_controls_bottom_ui_container.xml +++ b/patches/src/main/resources/loopvideobutton/host/layout/youtube_controls_bottom_ui_container.xml @@ -1,22 +1,21 @@ - + - + android:id="@+id/revanced_loop_video_button" + style="@style/YouTubePlayerButton" + android:layout_width="48.0dip" + android:layout_height="60.0dip" + android:longClickable="false" + android:paddingTop="6.0dp" + android:paddingBottom="0dp" + android:scaleType="center" + android:src="@drawable/revanced_loop_video_button_off" + yt:layout_constraintBottom_toTopOf="@+id/quick_actions_container" + yt:layout_constraintRight_toLeftOf="@+id/fullscreen_button" />