mirror of
https://github.com/AntennaPod/AntennaPod.git
synced 2025-01-21 21:36:12 +01:00
Variable cannot be final
This commit is contained in:
parent
b38d016ec3
commit
e56e3868da
@ -7,6 +7,7 @@ import android.os.Build;
|
|||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.Handler;
|
import android.os.Handler;
|
||||||
import android.support.v4.view.WindowCompat;
|
import android.support.v4.view.WindowCompat;
|
||||||
|
import android.support.v7.app.ActionBar;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.util.Pair;
|
import android.util.Pair;
|
||||||
import android.view.MotionEvent;
|
import android.view.MotionEvent;
|
||||||
@ -353,20 +354,23 @@ public class VideoplayerActivity extends MediaplayerActivity {
|
|||||||
|
|
||||||
private static final int DELAY = 2500;
|
private static final int DELAY = 2500;
|
||||||
|
|
||||||
private final WeakReference<VideoplayerActivity> activity;
|
private WeakReference<VideoplayerActivity> activity;
|
||||||
|
|
||||||
public VideoControlsHider(VideoplayerActivity activity) {
|
VideoControlsHider(VideoplayerActivity activity) {
|
||||||
this.activity = new WeakReference<>(activity);
|
this.activity = new WeakReference<>(activity);
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Runnable hideVideoControls = () -> {
|
private final Runnable hideVideoControls = () -> {
|
||||||
VideoplayerActivity vpa = activity.get();
|
VideoplayerActivity vpa = activity != null ? activity.get() : null;
|
||||||
if(vpa == null) {
|
if(vpa == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (vpa.videoControlsShowing) {
|
if (vpa.videoControlsShowing) {
|
||||||
Log.d(TAG, "Hiding video controls");
|
Log.d(TAG, "Hiding video controls");
|
||||||
vpa.getSupportActionBar().hide();
|
ActionBar actionBar = vpa.getSupportActionBar();
|
||||||
|
if(actionBar != null) {
|
||||||
|
actionBar.hide();
|
||||||
|
}
|
||||||
vpa.hideVideoControls();
|
vpa.hideVideoControls();
|
||||||
vpa.videoControlsShowing = false;
|
vpa.videoControlsShowing = false;
|
||||||
}
|
}
|
||||||
@ -376,7 +380,7 @@ public class VideoplayerActivity extends MediaplayerActivity {
|
|||||||
this.postDelayed(hideVideoControls, DELAY);
|
this.postDelayed(hideVideoControls, DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void stop() {
|
void stop() {
|
||||||
this.removeCallbacks(hideVideoControls);
|
this.removeCallbacks(hideVideoControls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user