| | |
| | | package com.weikou.beibeivideo.util.video; |
| | | |
| | | import android.content.Context; |
| | | import android.graphics.Typeface; |
| | | import android.text.SpannableString; |
| | | import android.text.Spanned; |
| | | import android.text.style.AbsoluteSizeSpan; |
| | | import android.text.style.StyleSpan; |
| | | import android.view.View; |
| | | |
| | | import com.bumptech.glide.Glide; |
| | |
| | | viewHolder.tv_tag.setVisibility(View.VISIBLE); |
| | | } |
| | | |
| | | info.setScore("9.6"); |
| | | |
| | | if (!StringUtils.isEmpty(info.getScore())) { |
| | | viewHolder.tv_score.setVisibility(View.VISIBLE); |
| | | //改变 |
| | | SpannableString spannableString = new SpannableString(info.getScore() + "分"); |
| | | spannableString.setSpan(new AbsoluteSizeSpan(DimenUtils.spToPixels(13, mContext)), 0, 1, Spanned.SPAN_INCLUSIVE_EXCLUSIVE); |
| | | spannableString.setSpan(new StyleSpan(Typeface.BOLD_ITALIC), 0, info.getScore().length(), Spanned.SPAN_INCLUSIVE_EXCLUSIVE); |
| | | viewHolder.tv_score.setText(spannableString); |
| | | } else { |
| | | viewHolder.tv_score.setVisibility(View.INVISIBLE); |