This commit is contained in:
lixiaopeng
2020-08-18 17:04:04 +08:00
parent ed61bef010
commit 1853f50bbc
5 changed files with 13 additions and 9 deletions

View File

@@ -2,6 +2,7 @@ package com.mogo.module.v2x.fragment;
import android.graphics.Color;
import android.graphics.Rect;
import android.graphics.Typeface;
import android.os.Bundle;
import android.text.SpannableString;
import android.text.Spanned;
@@ -179,10 +180,10 @@ public class V2XSurroundingFragment extends MvpFragment<SurroundingEventView, Su
//总条数
String originStr = String.format(getContext().getResources().getString(R.string.v2x_surrounding_top_brief), exploreWayList.size());
SpannableString spannableString = new SpannableString(originStr);
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#256BFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
spannableString.setSpan(new ForegroundColorSpan(Color.parseColor("#459DFF")), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
//设置字体大小true表示前面的字体大小20单位为dip
spannableString.setSpan(new AbsoluteSizeSpan(36, true), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
spannableString.setSpan(new StyleSpan(android.graphics.Typeface.BOLD), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
spannableString.setSpan(new StyleSpan(Typeface.NORMAL), 7, originStr.length() - 5, Spanned.SPAN_EXCLUSIVE_EXCLUSIVE);
mTotalTv.setText(spannableString);
} else {
mTopLayout.setVisibility(View.GONE);