I have this kind of price html from server
<del><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">₹</span>12,000.00</span></del> <ins><span class="woocommerce-Price-amount amount"><span class="woocommerce-Price-currencySymbol">₹</span>3,999.00</span></ins>
I am using HTMLCompact to render it in textview
HtmlCompat.fromHtml(description, HtmlCompat.FROM_HTML_MODE_COMPACT)
But discount text is not StrikeThrough. Del tag is completely being ingnored.
Code Implementation as requested
<TextView
android:id="@+id/course_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="16dp"
android:fontFamily="@font/open_sans_semi_bold"
app:renderHtmlText="@{viewModel.product.priceHtml}"
android:textSize="18sp" />
//Binding Adapter
@BindingAdapter("renderHtmlText")
fun bindRenderHtmlText(view: TextView, description: String?) {
if (description != null) {
view.text = HtmlCompat.fromHtml(description, HtmlCompat.FROM_HTML_MODE_COMPACT)
} else {
view.text = ""
}
}