summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2021-05-14 21:44:59 +0200
committerByteHamster <info@bytehamster.com>2021-05-14 22:07:35 +0200
commit33ad1a91f0c125bb999642167a931f9a05b3384b (patch)
tree6b9189053abb9e7aa8cad0d90f124db3e2dc6280 /app/src/main/java/de
parentc3d7209f09f3b6c3974ada7836fe08f9d131e09b (diff)
downloadAntennaPod-33ad1a91f0c125bb999642167a931f9a05b3384b.zip
Remove unneccessary method call chaining
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java60
1 files changed, 17 insertions, 43 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 dc4345c21..4572cf1c4 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -230,12 +230,12 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
@Override
public void onBufferStart() {
- VideoplayerActivity.this.onBufferStart();
+ progressIndicator.setVisibility(View.VISIBLE);
}
@Override
public void onBufferEnd() {
- VideoplayerActivity.this.onBufferEnd();
+ progressIndicator.setVisibility(View.INVISIBLE);
}
@Override
@@ -247,7 +247,11 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
@Override
public void handleError(int code) {
- VideoplayerActivity.this.handleError(code);
+ final AlertDialog.Builder errorDialog = new AlertDialog.Builder(VideoplayerActivity.this);
+ errorDialog.setTitle(R.string.error_label);
+ errorDialog.setMessage(MediaPlayerError.getErrorString(VideoplayerActivity.this, code));
+ errorDialog.setNeutralButton(android.R.string.ok, (dialog, which) -> finish());
+ errorDialog.show();
}
@Override
@@ -272,7 +276,11 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
@Override
public void onAwaitingVideoSurface() {
- VideoplayerActivity.this.onAwaitingVideoSurface();
+ setupVideoAspectRatio();
+ if (videoSurfaceCreated && controller != null) {
+ Log.d(TAG, "Videosurface already created, setting videosurface now");
+ controller.setVideoSurface(videoview.getHolder());
+ }
}
@Override
@@ -282,8 +290,11 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
@Override
protected void setScreenOn(boolean enable) {
- super.setScreenOn(enable);
- VideoplayerActivity.this.setScreenOn(enable);
+ if (enable) {
+ getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ } else {
+ getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
+ }
}
};
}
@@ -408,14 +419,6 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
videoview.setAvailableSize(videoframe.getWidth(), videoframe.getHeight()));
}
- protected void onAwaitingVideoSurface() {
- setupVideoAspectRatio();
- if (videoSurfaceCreated && controller != null) {
- Log.d(TAG, "Videosurface already created, setting videosurface now");
- controller.setVideoSurface(videoview.getHolder());
- }
- }
-
private final View.OnTouchListener onVideoviewTouched = (v, event) -> {
if (event.getAction() == MotionEvent.ACTION_DOWN) {
if (PictureInPictureUtil.isInPictureInPictureMode(this)) {
@@ -544,19 +547,6 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
setupVideoControlsToggler();
}
- private void handleError(int errorCode) {
- final AlertDialog.Builder errorDialog = new AlertDialog.Builder(this);
- errorDialog.setTitle(R.string.error_label);
- errorDialog.setMessage(MediaPlayerError.getErrorString(this, errorCode));
- errorDialog.setNeutralButton("OK",
- (dialog, which) -> {
- dialog.dismiss();
- finish();
- }
- );
- errorDialog.create().show();
- }
-
private final SurfaceHolder.Callback surfaceHolderCallback = new SurfaceHolder.Callback() {
@Override
public void surfaceChanged(SurfaceHolder holder, int format, int width,
@@ -602,14 +592,6 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
}
}
- protected void onBufferStart() {
- progressIndicator.setVisibility(View.VISIBLE);
- }
-
- protected void onBufferEnd() {
- progressIndicator.setVisibility(View.INVISIBLE);
- }
-
@SuppressLint("NewApi")
private void showVideoControls() {
videoOverlay.setVisibility(View.VISIBLE);
@@ -644,14 +626,6 @@ public class VideoplayerActivity extends CastEnabledActivity implements SeekBar.
hideVideoControls(true);
}
- private void setScreenOn(boolean enable) {
- if (enable) {
- getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- } else {
- getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
- }
- }
-
@Subscribe(threadMode = ThreadMode.MAIN)
public void onEventMainThread(PlaybackPositionEvent event) {
onPositionObserverUpdate();