Fix regression in screen rotation animation
This commit is contained in:
parent
6805c75c9c
commit
500acce178
|
@ -1302,8 +1302,14 @@ public final class VideoDetailFragment
|
||||||
}
|
}
|
||||||
|
|
||||||
private void tryAddVideoPlayerView() {
|
private void tryAddVideoPlayerView() {
|
||||||
// do all the null checks in the posted lambda, since the player, the binding and the view
|
if (isPlayerAvailable() && getView() != null) {
|
||||||
// could be set or unset before the lambda gets executed on the next main thread cycle
|
// 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(() -> {
|
new Handler(Looper.getMainLooper()).post(() -> {
|
||||||
if (!isPlayerAvailable() || getView() == null) {
|
if (!isPlayerAvailable() || getView() == null) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue