铭牌fix

This commit is contained in:
oujunhui
2020-05-24 23:24:16 +08:00
parent 7e2c8814c0
commit 1b005e3d22
8 changed files with 53 additions and 46 deletions

View File

@@ -181,7 +181,7 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
ImageView ivOfficialMask = inOfficialMask.findViewById(R.id.iv_official_mask);
if (ivOfficialMask != null) {
NobleUtil.loadResource(iconPic, ivOfficialMask);
ImageLoadUtils.loadImage(mContext, iconPic, ivOfficialMask);
}
} else {

View File

@@ -1563,15 +1563,14 @@ public class MessageView extends FrameLayout {
// 官方主播认证
String tvOfficialMask = NobleUtil.getLevel(UserInfo.OAC_NAME, chatRoomMessage);
String ivOfficialMask = NobleUtil.getLevel(UserInfo.OAC_ICON, chatRoomMessage);
if (!TextUtils.isEmpty(tvOfficialMask) && !TextUtils.isEmpty(ivOfficialMask) && extension != null) { // extension != null 表示自己
text.appendBgAndContent(ivOfficialMask, tvOfficialMask, SizeUtils.dp2px(tvContent.getContext(), 59),
if (!TextUtils.isEmpty(tvOfficialMask) && !TextUtils.isEmpty(ivOfficialMask)) { // extension != null 表示自己
text.appendBgAndContent(ivOfficialMask, tvOfficialMask, SizeUtils.dp2px(tvContent.getContext(), 62),
SizeUtils.dp2px(tvContent.getContext(), 15));
}
text.append(userLevel, expLevelWidth, expLevelHeight)
.append(extension == null ? "" : RegexUtil.getPrintableString(extension.getSenderNick()), new ForegroundColorSpan(greyColor))
.append("" + chatRoomMessage.getContent(), new ForegroundColorSpan(getResources().getColor(R.color.white)))
;
.append("" + chatRoomMessage.getContent(), new ForegroundColorSpan(getResources().getColor(R.color.white)));
tvContent.setText(text.build());
}
@@ -2156,7 +2155,7 @@ public class MessageView extends FrameLayout {
String tvOfficialMask = NobleUtil.getLevel(UserInfo.OAC_NAME, chatRoomMessage);
String ivOfficialMask = NobleUtil.getLevel(UserInfo.OAC_ICON, chatRoomMessage);
if (!TextUtils.isEmpty(tvOfficialMask) && !TextUtils.isEmpty(ivOfficialMask) && extension != null) { // extension != null 表示自己
text.appendBgAndContent(ivOfficialMask, tvOfficialMask, SizeUtils.dp2px(tvContent.getContext(), 59),
text.appendBgAndContent(ivOfficialMask, tvOfficialMask, SizeUtils.dp2px(tvContent.getContext(), 62),
SizeUtils.dp2px(tvContent.getContext(), 15));
}

View File

@@ -123,7 +123,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
private AppCompatImageView ivNewUser;
private AppCompatImageView mIvGoodNumber;
private AppCompatImageView mIvUserLevel;
private AppCompatImageView mIvUserNameplate;
private AppCompatImageView mIvUserCharm;
private LinearLayout llFamily;
private TextView tvFamilyNameLabel;
@@ -196,7 +195,6 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
mIvGoodNumber = findViewById(R.id.iv_good_number);
mIvUserLevel = findViewById(R.id.iv_user_level);
mIvUserCharm = findViewById(R.id.iv_user_charm);
mIvUserNameplate = findViewById(R.id.iv_user_nameplate);
llFamily = (LinearLayout) findViewById(R.id.ll_family);
tvFamilyNameLabel = (TextView) findViewById(R.id.tv_family_name_label);
@@ -473,16 +471,11 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
ImageLoadUtils.loadImage(context, userLevelVo.getCharmUrl(), mIvUserCharm);
}
}
if (!TextUtils.isEmpty(userInfo.getNameplatePic())){
mIvUserNameplate.setVisibility(View.VISIBLE);
ImageLoadUtils.loadImage(context, userInfo.getNameplatePic(), mIvUserNameplate);
}
// 改变贵族
updateNobleView();
UserInfo.NamePlate namePlate = userInfo.getNameplate();
if (namePlate != null) {
setOfficialMask(namePlate.getFixedWord(), namePlate.getIconPic());
if (!TextUtils.isEmpty(userInfo.getNameplateWord()) && !TextUtils.isEmpty(userInfo.getNameplatePic())) {
setOfficialMask(userInfo.getNameplateWord(), userInfo.getNameplatePic());
} else {
setOfficialMask(null, null);
}
@@ -548,7 +541,7 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
ImageView ivOfficialMask;
ivOfficialMask = inOfficialMask.findViewById(R.id.iv_official_mask);
if (ivOfficialMask != null) {
NobleUtil.loadResource(icon, ivOfficialMask);
ImageLoadUtils.loadImage(context, userInfo.getNameplatePic(), ivOfficialMask);
}
} else {

View File

@@ -119,14 +119,7 @@
tools:src="@mipmap/ic_user_level_king"
tools:visibility="visible" />
<include
android:id="@+id/in_official_mask"
layout="@layout/layout_official_mask"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15"
android:layout_gravity="center"
android:layout_marginEnd="5.5dp"
android:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_user_level"
@@ -152,14 +145,32 @@
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_user_nameplate"
android:layout_width="wrap_content"
android:layout_marginEnd="@dimen/dp_3"
android:layout_height="@dimen/dp_15"
android:layout_marginEnd="3dp"
android:adjustViewBounds="true"
android:scaleType="fitXY"
android:visibility="gone"
tools:src="@mipmap/ic_user_level"
tools:visibility="visible" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15"
android:orientation="horizontal"
android:layout_gravity="center_vertical"
>
<include
android:id="@+id/in_official_mask"
layout="@layout/layout_official_mask"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible" />
</LinearLayout>
</LinearLayout>
<LinearLayout

View File

@@ -13,7 +13,7 @@
android:id="@+id/iv_official_mask"
android:layout_width="wrap_content"
android:layout_height="match_parent"
android:minWidth="59dp"
android:minWidth="62dp"
tools:src="@drawable/ic_temp_official_mask"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintEnd_toEndOf="parent"
@@ -24,11 +24,12 @@
android:id="@+id/tv_official_mask"
android:layout_width="38.5dp"
android:layout_height="wrap_content"
android:layout_marginEnd="5.5dp"
android:layout_marginEnd="4.5dp"
android:gravity="center"
android:textColor="@color/white"
android:textSize="8dp"
tools:text="金牌主持"
android:includeFontPadding="false"
app:layout_constraintEnd_toEndOf="@id/iv_official_mask"
app:layout_constraintTop_toTopOf="parent"
app:layout_constraintBottom_toBottomOf="parent" />

View File

@@ -13,24 +13,14 @@
android:layout_marginRight="10dp"
tools:layout_width="60dp" />
<include
android:id="@+id/in_official_mask"
layout="@layout/layout_official_mask"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15"
android:layout_gravity="center"
android:layout_marginTop="10dp"
android:layout_marginEnd="5.5dp"
android:layout_toEndOf="@id/noble_avatar_view"
android:visibility="gone"
tools:visibility="visible" />
<TextView
android:id="@+id/nick"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="10dp"
android:layout_toEndOf="@id/in_official_mask"
android:layout_toEndOf="@id/noble_avatar_view"
android:ellipsize="end"
android:maxWidth="80dp"
android:maxLines="1"
@@ -93,6 +83,17 @@
android:layout_marginEnd="@dimen/dp_5"
android:src="@drawable/icon_admin_logo" />
<include
android:id="@+id/in_official_mask"
layout="@layout/layout_official_mask"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15"
android:layout_gravity="center"
android:layout_marginEnd="5.5dp"
android:layout_toEndOf="@id/noble_avatar_view"
android:visibility="gone"
tools:visibility="visible" />
<androidx.appcompat.widget.AppCompatImageView
android:id="@+id/iv_user_exper"
android:layout_width="wrap_content"
@@ -112,6 +113,8 @@
android:visibility="visible"
tools:visibility="visible" />
</LinearLayout>
<ImageView

View File

@@ -86,7 +86,7 @@
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_15"
android:orientation="horizontal"
app:layout_constraintStart_toEndOf="@id/iv_user_charm_level"
app:layout_constraintBottom_toBottomOf="@id/iv_user_wealth_level"
@@ -96,10 +96,10 @@
<include
android:id="@+id/in_official_mask"
layout="@layout/layout_official_mask"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_15"
android:layout_height="match_parent"
android:visibility="gone"
tools:visibility="visible"
layout="@layout/layout_official_mask" />
tools:visibility="visible" />
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>

View File

@@ -548,9 +548,9 @@ public class UserInfo implements Serializable {
map.put(HAS_PRETTY, userInfo.isHasPrettyErbanNo());
// 官方认证文本,图标
if (userInfo.getNameplate() != null) {
map.put(OAC_NAME, userInfo.getNameplate().getFixedWord());
map.put(OAC_ICON, userInfo.getNameplate().getIconPic());
if (!TextUtils.isEmpty(userInfo.getNameplateWord()) && !TextUtils.isEmpty(userInfo.getNameplatePic())) {
map.put(OAC_NAME, userInfo.getNameplateWord());
map.put(OAC_ICON, userInfo.getNameplatePic());
} else {
map.put(OAC_NAME, "");
map.put(OAC_ICON, "");