From 06251d7cc09139557c26d40c583c7f150a09b788 Mon Sep 17 00:00:00 2001 From: Christine Coenen Date: Sun, 11 Aug 2024 13:03:34 +0200 Subject: [PATCH] Fix html entities visible in program information titles #439 --- .../ui/detail/ProgramInfoSheetDialogFragment.kt | 7 +++++-- .../app/livestream/ui/list/adapter/ChannelViewHolder.kt | 9 +++++++-- app/src/main/res/raw-en/changelog.md | 3 +++ app/src/main/res/raw/changelog.md | 3 +++ 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/detail/ProgramInfoSheetDialogFragment.kt b/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/detail/ProgramInfoSheetDialogFragment.kt index c42297e7..7bc9c17f 100644 --- a/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/detail/ProgramInfoSheetDialogFragment.kt +++ b/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/detail/ProgramInfoSheetDialogFragment.kt @@ -50,12 +50,15 @@ class ProgramInfoSheetDialogFragment( } private fun onTitleChanged(title: String) { - binding.title.text = title + binding.title.text = HtmlCompat.fromHtml(title, HtmlCompat.FROM_HTML_MODE_LEGACY) } private fun onSubtitleChanged(subtitle: String?) { binding.subtitle.isVisible = !subtitle.isNullOrEmpty() - binding.subtitle.text = subtitle + + if (!subtitle.isNullOrEmpty()) { + binding.subtitle.text = HtmlCompat.fromHtml(subtitle, HtmlCompat.FROM_HTML_MODE_LEGACY) + } } private fun onDescriptionChanged(description: String?) { diff --git a/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/list/adapter/ChannelViewHolder.kt b/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/list/adapter/ChannelViewHolder.kt index 4753ed7f..319569ff 100644 --- a/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/list/adapter/ChannelViewHolder.kt +++ b/app/src/main/java/de/christinecoenen/code/zapp/app/livestream/ui/list/adapter/ChannelViewHolder.kt @@ -2,6 +2,7 @@ package de.christinecoenen.code.zapp.app.livestream.ui.list.adapter import android.view.View import android.view.View.OnLongClickListener +import androidx.core.text.HtmlCompat import androidx.core.view.isVisible import androidx.lifecycle.LifecycleOwner import androidx.recyclerview.widget.RecyclerView @@ -60,12 +61,16 @@ class ChannelViewHolder( } private fun onShowTitleChanged(title: String) { - bindingAdapter.showTitle.text = title + bindingAdapter.showTitle.text = HtmlCompat.fromHtml(title, HtmlCompat.FROM_HTML_MODE_LEGACY) } private fun onShowSubtitleChanged(subtitle: String?) { bindingAdapter.showSubtitle.isVisible = !subtitle.isNullOrEmpty() - bindingAdapter.showSubtitle.text = subtitle + + if (!subtitle.isNullOrEmpty()) { + bindingAdapter.showSubtitle.text = + HtmlCompat.fromHtml(subtitle, HtmlCompat.FROM_HTML_MODE_LEGACY) + } } private fun onShowTimeChanged(time: String?) { diff --git a/app/src/main/res/raw-en/changelog.md b/app/src/main/res/raw-en/changelog.md index cfede622..12b056c9 100644 --- a/app/src/main/res/raw-en/changelog.md +++ b/app/src/main/res/raw-en/changelog.md @@ -1,3 +1,6 @@ +# v-next +* Fixed html entities visible in program information titles + # 8.5.2 * Removed duplicate entries when scrolling the mediathek list diff --git a/app/src/main/res/raw/changelog.md b/app/src/main/res/raw/changelog.md index 8bd681e8..51e930a0 100644 --- a/app/src/main/res/raw/changelog.md +++ b/app/src/main/res/raw/changelog.md @@ -1,3 +1,6 @@ +# v-next +* Sichtbare HTML-Entities in Programm-Information repariert + # 8.5.2 * Duplikate beim Scrollen in der Mediathek-Liste entfernt