Some refactorings after review comments

This commit is contained in:
Stypox 2022-07-09 17:17:30 +02:00
parent 7e64750460
commit 65651e0302
5 changed files with 42 additions and 60 deletions

View file

@ -1311,11 +1311,12 @@ public final class VideoDetailFragment
setHeightThumbnail();
// Prevent from re-adding a view multiple times
new Handler().post(() -> player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
}));
new Handler(Looper.getMainLooper()).post(() ->
player.UIs().get(MainPlayerUi.class).ifPresent(playerUi -> {
playerUi.removeViewFromParent();
binding.playerPlaceholder.addView(playerUi.getBinding().getRoot());
playerUi.setupVideoSurfaceIfNeeded();
}));
}
private void removeVideoPlayerView() {