fix(YouTube): Resolve button flickering when taping seekbar (#4500)

This commit is contained in:
MarcaD 2025-02-24 20:34:28 +02:00 committed by GitHub
parent afeef0bbec
commit 1f08047b48
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -90,7 +90,13 @@ public class PlayerControlButton {
}
public void setVisibilityImmediate(boolean visible) {
private_setVisibility(visible, false);
if (visible) {
// Fix button flickering, by pushing this call to the back of
// the main thread and letting other layout code run first.
Utils.runOnMainThread(() -> private_setVisibility(true, false));
} else {
private_setVisibility(false, false);
}
}
public void setVisibility(boolean visible, boolean animated) {