diff options
author | H. Lehmann <ByteHamster@users.noreply.github.com> | 2020-07-26 17:30:36 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-26 17:30:36 +0200 |
commit | 18fd908e6be3fde4d7d45061f057c6a1783b93d7 (patch) | |
tree | 0bea4269ed6103c1cf44a3cc063438a30e023a91 /core | |
parent | 68d38a0b58becc125da8e752a784f6149bfa93bb (diff) | |
parent | 10db0f3d11e46f60e66748e3a1b1a27bbdbbf828 (diff) | |
download | AntennaPod-18fd908e6be3fde4d7d45061f057c6a1783b93d7.zip |
Merge pull request #4318 from johnjohndoe/htmlcompat-fromhtml
Replace deprecated Html#fromHtml with HtmlCompat#fromHtml.
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java index e85d5fae1..0c0561279 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java +++ b/core/src/main/java/de/danoeh/antennapod/core/syndication/namespace/atom/AtomText.java @@ -1,7 +1,7 @@ package de.danoeh.antennapod.core.syndication.namespace.atom; -import android.os.Build; -import android.text.Html; +import androidx.core.text.HtmlCompat; + import de.danoeh.antennapod.core.syndication.namespace.Namespace; import de.danoeh.antennapod.core.syndication.namespace.SyndElement; @@ -24,11 +24,7 @@ public class AtomText extends SyndElement { if (type == null) { return content; } else if (type.equals(TYPE_HTML)) { - if (Build.VERSION.SDK_INT >= 24) { - return Html.fromHtml(content, Html.FROM_HTML_MODE_LEGACY).toString(); - } else { - return Html.fromHtml(content).toString(); - } + return HtmlCompat.fromHtml(content, HtmlCompat.FROM_HTML_MODE_LEGACY).toString(); } else if (type.equals(TYPE_XHTML)) { return content; } else { // Handle as text by default |