Skip to content

Commit

Permalink
Fix html entities visible in program information titles #439
Browse files Browse the repository at this point in the history
  • Loading branch information
cemrich committed Aug 11, 2024
1 parent d3c16ec commit 06251d7
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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?) {
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/raw-en/changelog.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/raw/changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# v-next
* Sichtbare HTML-Entities in Programm-Information repariert

# 8.5.2
* Duplikate beim Scrollen in der Mediathek-Liste entfernt

Expand Down

0 comments on commit 06251d7

Please sign in to comment.