1
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2024-12-23 00:20:32 +00:00

Fix regression in screen rotation animation

This commit is contained in:
Stypox 2022-08-24 15:08:24 +02:00
parent 6805c75c9c
commit 500acce178
No known key found for this signature in database
GPG Key ID: 4BDF1B40A49FDD23

View File

@ -1302,8 +1302,14 @@ public final class VideoDetailFragment
}
private void tryAddVideoPlayerView() {
// do all the null checks in the posted lambda, since the player, the binding and the view
// could be set or unset before the lambda gets executed on the next main thread cycle
if (isPlayerAvailable() && getView() != null) {
// Setup the surface view height, so that it fits the video correctly; this is done also
// here, and not only in the Handler, to avoid a choppy fullscreen rotation animation.
setHeightThumbnail();
}
// do all the null checks in the posted lambda, too, since the player, the binding and the
// view could be set or unset before the lambda gets executed on the next main thread cycle
new Handler(Looper.getMainLooper()).post(() -> {
if (!isPlayerAvailable() || getView() == null) {
return;