From 2d5995d1a5fb17ae312f5e6b92d5b65c58ca736c Mon Sep 17 00:00:00 2001 From: ByteHamster Date: Mon, 27 May 2019 13:06:52 +0200 Subject: [PATCH] Allow mixed content --- .../danoeh/antennapod/fragment/ItemDescriptionFragment.java | 6 +++++- .../java/de/danoeh/antennapod/fragment/ItemFragment.java | 3 +++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java index ed591d21c..5cf2c5eeb 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemDescriptionFragment.java @@ -10,6 +10,7 @@ import android.content.SharedPreferences; import android.content.res.TypedArray; import android.graphics.Color; import android.net.Uri; +import android.os.Build; import android.os.Bundle; import android.support.annotation.NonNull; import android.support.v4.app.Fragment; @@ -61,7 +62,6 @@ public class ItemDescriptionFragment extends Fragment { private String selectedURL; - @SuppressLint("NewApi") @Override public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { @@ -81,6 +81,10 @@ public class ItemDescriptionFragment extends Fragment { webvDescription.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // Use cached resources, even if they have expired } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webvDescription.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } + webvDescription.getSettings().setUseWideViewPort(false); webvDescription.getSettings().setLayoutAlgorithm(WebSettings.LayoutAlgorithm.SINGLE_COLUMN); webvDescription.getSettings().setLoadWithOverviewMode(true); diff --git a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java index 2b8b2aa33..79b15a112 100644 --- a/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java +++ b/app/src/main/java/de/danoeh/antennapod/fragment/ItemFragment.java @@ -198,6 +198,9 @@ public class ItemFragment extends Fragment implements OnSwipeGesture { webvDescription.getSettings().setCacheMode(WebSettings.LOAD_CACHE_ELSE_NETWORK); // Use cached resources, even if they have expired } + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + webvDescription.getSettings().setMixedContentMode(WebSettings.MIXED_CONTENT_ALWAYS_ALLOW); + } webvDescription.getSettings().setUseWideViewPort(false); webvDescription.getSettings().setLayoutAlgorithm( WebSettings.LayoutAlgorithm.NARROW_COLUMNS);