测试更改

This commit is contained in:
18401019693 2022-11-18 15:59:15 +08:00
parent 859d884941
commit 2c13c3dce1

View File

@ -230,31 +230,31 @@ public class LiveTextRender {
int index = 0; int index = 0;
if (levelDrawable != null) { if (levelDrawable != null) {
builder.append(" "); builder.append(" ");
levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14)); levelDrawable.setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(14));
builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(levelDrawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
if (gzDrawablesMap.containsKey(bean)) {//贵族 if (gzDrawablesMap.containsKey(bean)) {//贵族
builder.append(" "); builder.append(" ");
gzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(18)); gzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(32), DpUtil.dp2px(18));
builder.setSpan(new VerticalImageSpan(gzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(gzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
if (ryxzDrawablesMap.containsKey(bean)) {//荣誉勋章 if (ryxzDrawablesMap.containsKey(bean)) {//荣誉勋章
builder.append(" "); builder.append(" ");
ryxzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(18)); ryxzDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(18));
builder.setSpan(new VerticalImageSpan(ryxzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(ryxzDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
if (nhDrawablesMap.containsKey(bean)) {//靓号 if (nhDrawablesMap.containsKey(bean)) {//靓号
builder.append(" "); builder.append(" ");
nhDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(17)); nhDrawablesMap.get(bean).setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(17));
builder.setSpan(new VerticalImageSpan(nhDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(nhDrawablesMap.get(bean)), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
if (bean.getGuardType() != Constants.GUARD_TYPE_NONE) {//守护图标 if (bean.getGuardType() != Constants.GUARD_TYPE_NONE) {//守护图标
@ -268,10 +268,10 @@ public class LiveTextRender {
} }
if (drawable != null) { if (drawable != null) {
builder.append(" "); builder.append(" ");
drawable.setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(16)); drawable.setBounds(0, 0, DpUtil.dp2px(18), DpUtil.dp2px(16));
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
} }
@ -280,10 +280,10 @@ public class LiveTextRender {
&& !bean.getMedalNmae().equals("null") && !bean.getMedalNmae().equals("(null)") && !bean.getMedalNmae().equals("<null>")) {//粉丝徽章图标 && !bean.getMedalNmae().equals("null") && !bean.getMedalNmae().equals("(null)") && !bean.getMedalNmae().equals("<null>")) {//粉丝徽章图标
Drawable drawable = getMedalImage(bean); Drawable drawable = getMedalImage(bean);
if (drawable != null) { if (drawable != null) {
builder.append(" "); builder.append(" ");
drawable.setBounds(0, 0, DpUtil.dp2px(44), DpUtil.dp2px(17)); drawable.setBounds(0, 0, DpUtil.dp2px(44), DpUtil.dp2px(17));
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
} }
@ -291,21 +291,21 @@ public class LiveTextRender {
if (bean.isManager()) {//直播间管理员图标 if (bean.isManager()) {//直播间管理员图标
Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m); Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_m);
if (drawable != null) { if (drawable != null) {
builder.append(" "); builder.append(" ");
drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14)); drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14));
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
index += 2; index = builder.length();
} }
} }
if (!TextUtils.isEmpty(bean.getLiangName())) {//靓号图标 if (!TextUtils.isEmpty(bean.getLiangName())) {//靓号图标
Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_liang); Drawable drawable = ContextCompat.getDrawable(CommonAppContext.sInstance, R.mipmap.icon_live_chat_liang);
if (drawable != null) { if (drawable != null) {
builder.append(" "); builder.append(" ");
drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14)); drawable.setBounds(0, 0, DpUtil.dp2px(17), DpUtil.dp2px(14));
builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); builder.setSpan(new VerticalImageSpan(drawable), index, index + 1, Spannable.SPAN_EXCLUSIVE_EXCLUSIVE);
// new add // new add
index += 2; index = builder.length();
} }
} }