Skip to content

Commit

Permalink
HW-4 DataBindingAdapter - HtmlCompact 로 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
mtjin committed Mar 25, 2020
1 parent 1aef5d3 commit af549d9
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,17 @@
package com.mtjin.androidarchitecturestudy.utils

import android.os.Build
import android.text.Html
import android.widget.ImageView
import android.widget.RatingBar
import android.widget.TextView
import androidx.core.text.HtmlCompat
import androidx.databinding.BindingAdapter
import com.bumptech.glide.Glide
import com.mtjin.androidarchitecturestudy.R


@BindingAdapter("htmlText")
fun setHtmlText(textView: TextView, html: String) {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
textView.text = Html.fromHtml(html, Html.FROM_HTML_MODE_COMPACT)
} else {
textView.text = Html.fromHtml(html)
}
HtmlCompat.fromHtml(html, HtmlCompat.FROM_HTML_MODE_COMPACT)
}

@BindingAdapter("urlImage")
Expand Down

0 comments on commit af549d9

Please sign in to comment.