Commit 88c6ccf6 authored by Vladislav Bogdashkin's avatar Vladislav Bogdashkin 🎣

fix <a href ..> tag

parent 0aca8f0a
package com.biganto.visual.roompark.presentation.screen.article.util package com.biganto.visual.roompark.presentation.screen.article.util
import android.text.Html
import android.text.method.LinkMovementMethod
import android.view.LayoutInflater import android.view.LayoutInflater
import android.view.View import android.view.View
import android.view.ViewGroup import android.view.ViewGroup
...@@ -77,9 +79,13 @@ abstract class HtmlTagViewHolder<M:HtmlTag>(itemView: View) : RecyclerView.ViewH ...@@ -77,9 +79,13 @@ abstract class HtmlTagViewHolder<M:HtmlTag>(itemView: View) : RecyclerView.ViewH
class HtmlTextViewHolder(itemView: View) : HtmlTagViewHolder<HtmlTag.Text>(itemView) { class HtmlTextViewHolder(itemView: View) : HtmlTagViewHolder<HtmlTag.Text>(itemView) {
override fun onViewBound(model: HtmlTag.Text) { override fun onViewBound(model: HtmlTag.Text) {
(itemView as MaterialTextView).text = model.text if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
(itemView as MaterialTextView).text = Html.fromHtml(model.text,Html.FROM_HTML_MODE_COMPACT)
} else {
(itemView as MaterialTextView).text = Html.fromHtml(model.text)
}
itemView.movementMethod = LinkMovementMethod.getInstance()
} }
} }
class HtmlImageViewHolder(itemView: View) :HtmlTagViewHolder<HtmlTag.ImageSource>(itemView) { class HtmlImageViewHolder(itemView: View) :HtmlTagViewHolder<HtmlTag.ImageSource>(itemView) {
......
...@@ -5,4 +5,5 @@ ...@@ -5,4 +5,5 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginStart="16dp" android:layout_marginStart="16dp"
android:layout_marginEnd="16dp" android:layout_marginEnd="16dp"
android:linksClickable="true"
android:minHeight="16dp" /> android:minHeight="16dp" />
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment