summaryrefslogtreecommitdiff
path: root/app/src/main/java/de/danoeh/antennapod/activity
diff options
context:
space:
mode:
authorByteHamster <info@bytehamster.com>2019-05-19 18:59:03 +0200
committerByteHamster <info@bytehamster.com>2019-05-19 18:59:03 +0200
commit73744e3d4c2d108ff757dce9700d6f44521c8303 (patch)
treebe3609ab8c4f3af58792562eaa40a9490c2ef2fd /app/src/main/java/de/danoeh/antennapod/activity
parent09f4ebf08ad17435249d0daddfe290ae1d0484f4 (diff)
parent135df61692ee1d6d3cee59039ae633a0ac9549f3 (diff)
downloadAntennaPod-73744e3d4c2d108ff757dce9700d6f44521c8303.zip
Merge branch 'develop' into eventbus-v3
Diffstat (limited to 'app/src/main/java/de/danoeh/antennapod/activity')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java17
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java3
-rw-r--r--app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java33
3 files changed, 16 insertions, 37 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
index ecfdf24b0..1bcdada44 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/AboutActivity.java
@@ -1,7 +1,9 @@
package de.danoeh.antennapod.activity;
+import android.content.Intent;
import android.content.res.TypedArray;
import android.graphics.Color;
+import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
@@ -46,22 +48,23 @@ public class AboutActivity extends AppCompatActivity {
webViewContainer = findViewById(R.id.webViewContainer);
webView = findViewById(R.id.webViewAbout);
webView.getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE);
- if (UserPreferences.getTheme() == R.style.Theme_AntennaPod_Dark) {
- if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
- webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
- }
- webView.setBackgroundColor(Color.TRANSPARENT);
+ if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
+ webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null);
}
+ webView.setBackgroundColor(Color.TRANSPARENT);
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
- if (!url.startsWith("http")) {
+ if (url.startsWith("http")) {
+ Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
+ startActivity(browserIntent);
+ return true;
+ } else {
url = url.replace("file:///android_asset/", "");
loadAsset(url);
return true;
}
- return false;
}
});
diff --git a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
index 023a566d6..154c7c148 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/MediaplayerActivity.java
@@ -277,9 +277,6 @@ public abstract class MediaplayerActivity extends CastEnabledActivity implements
@Override
protected void onStart() {
super.onStart();
- if (controller != null) {
- controller.release();
- }
controller = newPlaybackController();
controller.init();
loadMediaInfo();
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 fa5012b74..78cc15b2c 100644
--- a/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
+++ b/app/src/main/java/de/danoeh/antennapod/activity/VideoplayerActivity.java
@@ -47,7 +47,6 @@ public class VideoplayerActivity extends MediaplayerActivity {
*/
private boolean videoControlsShowing = true;
private boolean videoSurfaceCreated = false;
- private boolean playbackStoppedUponExitVideo = false;
private boolean destroyingDueToReload = false;
private VideoControlsHider videoControlsHider = new VideoControlsHider(this);
@@ -78,7 +77,6 @@ public class VideoplayerActivity extends MediaplayerActivity {
@Override
protected void onResume() {
super.onResume();
- playbackStoppedUponExitVideo = false;
if (TextUtils.equals(getIntent().getAction(), Intent.ACTION_VIEW)) {
playExternalMedia(getIntent(), MediaType.VIDEO);
} else if (PlaybackService.isCasting()) {
@@ -93,32 +91,12 @@ public class VideoplayerActivity extends MediaplayerActivity {
@Override
protected void onStop() {
- stopPlaybackIfUserPreferencesSpecified(); // MUST be called before super.onStop(), while it still has member variable controller
super.onStop();
if (!PictureInPictureUtil.isInPictureInPictureMode(this)) {
videoControlsHider.stop();
}
}
- void stopPlaybackIfUserPreferencesSpecified() {
- // to avoid the method being called twice during leaving Videoplayer
- // , which will double-pause the media
- // (it is usually first called by surfaceHolderCallback.surfaceDestroyed(),
- // then VideoplayerActivity.onStop() , but sometimes VideoplayerActivity.onStop()
- // will first be invoked.)
- if (playbackStoppedUponExitVideo) {
- return;
- }
- playbackStoppedUponExitVideo = true;
-
- if (controller != null && !destroyingDueToReload
- && UserPreferences.getVideoBackgroundBehavior()
- != UserPreferences.VideoBackgroundBehavior.CONTINUE_PLAYING) {
- Log.v(TAG, "stop video playback per UserPreference");
- controller.notifyVideoSurfaceAbandoned();
- }
- }
-
@Override
public void onUserLeaveHint () {
if (!PictureInPictureUtil.isInPictureInPictureMode(this) && UserPreferences.getVideoBackgroundBehavior()
@@ -297,12 +275,13 @@ public class VideoplayerActivity extends MediaplayerActivity {
@Override
public void surfaceDestroyed(SurfaceHolder holder) {
- Log.d(TAG, "Videosurface was destroyed." );
- Log.v(TAG, " hasController=" + (controller != null)
- + " , destroyingDueToReload=" + destroyingDueToReload
- + " , videoBackgroundBehavior=" + UserPreferences.getVideoBackgroundBehavior());
+ Log.d(TAG, "Videosurface was destroyed");
videoSurfaceCreated = false;
- stopPlaybackIfUserPreferencesSpecified();
+ if (controller != null && !destroyingDueToReload
+ && UserPreferences.getVideoBackgroundBehavior()
+ != UserPreferences.VideoBackgroundBehavior.CONTINUE_PLAYING) {
+ controller.notifyVideoSurfaceAbandoned();
+ }
}
};