diff options
author | ByteHamster <info@bytehamster.com> | 2022-11-01 11:58:48 +0100 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-11-01 12:06:21 +0100 |
commit | 1e336ac0f8dd7ad74f576f2ce478222eaab26c1b (patch) | |
tree | ec1d3c6efadd542631f5f5a31c450a716ef24675 /app | |
parent | a83674507904cd8c29ca0c3bd9d52d45fa7115a4 (diff) | |
download | AntennaPod-1e336ac0f8dd7ad74f576f2ce478222eaab26c1b.zip |
No need to have a virtual method that is only used in one single instance
Diffstat (limited to 'app')
-rw-r--r-- | app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java | 28 |
1 files changed, 10 insertions, 18 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java index 8c2d7b314..b96b18e85 100644 --- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java +++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java @@ -190,6 +190,16 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar. @Override protected void updatePlayButtonShowsPlay(boolean showPlay) { viewBinding.playButton.setIsShowPlay(showPlay); + if (showPlay) { + getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + } else { + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); + setupVideoAspectRatio(); + if (videoSurfaceCreated && controller != null) { + Log.d(TAG, "Videosurface already created, setting videosurface now"); + controller.setVideoSurface(viewBinding.videoView.getHolder()); + } + } } @Override @@ -198,27 +208,9 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar. } @Override - public void onAwaitingVideoSurface() { - setupVideoAspectRatio(); - if (videoSurfaceCreated && controller != null) { - Log.d(TAG, "Videosurface already created, setting videosurface now"); - controller.setVideoSurface(viewBinding.videoView.getHolder()); - } - } - - @Override public void onPlaybackEnd() { finish(); } - - @Override - protected void setScreenOn(boolean enable) { - if (enable) { - getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - } else { - getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); - } - } }; } |