Skip to content

Commit e3f203a

Browse files
committed
YouTube: Fix fullscreen button missing in some cases
Sets the height of custom bottom controls to match the fullscreen button's height. Also, skips rearranging buttons that are hidden (`GONE`).
1 parent 2645d2c commit e3f203a

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

app/src/main/java/io/github/chsbuffer/revancedxposed/youtube/misc/playercontrols/PlayerControlsPatch.kt

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,18 @@ fun YoutubeHook.PlayerControls() {
123123
val controlsView = it.thisObject as ViewGroup
124124
if (controlsView.id != youtube_controls_bottom_ui_container) return@after
125125

126-
var rightButton =
126+
val fullscreenButton =
127127
Utils.getChildViewByResourceName<View>(controlsView, "fullscreen_button")
128+
var rightButton = fullscreenButton
128129

129130
for (bottomControl in bottomControls) {
130131
val leftButton = controlsView.findViewById<View>(bottomControl.id)
132+
if (leftButton.visibility == View.GONE) continue
131133
// put this button to the left
132134
leftButton.x = rightButton.x - leftButton.width
133135
leftButton.y = rightButton.y
134-
leftButton.layoutParams = rightButton.layoutParams.apply {
135-
width = leftButton.width
136+
leftButton.layoutParams = leftButton.layoutParams.apply {
137+
height = fullscreenButton.height
136138
}
137139
rightButton = leftButton
138140
}

0 commit comments

Comments
 (0)