feat:完成部分等级ICON替换(本地资源)(未自测)
@@ -17,6 +17,7 @@ import com.netease.nimlib.sdk.RequestCallbackWrapper;
|
|||||||
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
|
import com.netease.nimlib.sdk.uinfo.constant.GenderEnum;
|
||||||
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
import com.netease.nimlib.sdk.uinfo.model.NimUserInfo;
|
||||||
import com.nnbc123.app.R;
|
import com.nnbc123.app.R;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||||
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
||||||
import com.nnbc123.app.utils.RegexUtil;
|
import com.nnbc123.app.utils.RegexUtil;
|
||||||
@@ -97,20 +98,25 @@ public class OnlineUserAdapter extends BaseMultiItemQuickAdapter<OnlineChatMembe
|
|||||||
// 官字
|
// 官字
|
||||||
baseViewHolder.getView(R.id.iv_user_official).setVisibility(onlineChatMember.isOfficial() ? View.VISIBLE : View.GONE);
|
baseViewHolder.getView(R.id.iv_user_official).setVisibility(onlineChatMember.isOfficial() ? View.VISIBLE : View.GONE);
|
||||||
//经验等级
|
//经验等级
|
||||||
AppCompatImageView ivUserExper = baseViewHolder.getView(R.id.iv_user_exper);
|
|
||||||
String experLevelUrl = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, onlineChatMember.chatRoomMember);
|
String experLevelUrl = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, onlineChatMember.chatRoomMember);
|
||||||
boolean isExperLevelUrlEmpty = TextUtils.isEmpty(experLevelUrl);
|
AppCompatImageView wealthView = baseViewHolder.getView(R.id.iv_user_exper);
|
||||||
ivUserExper.setVisibility(!isExperLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIconByUrl(experLevelUrl);
|
||||||
if (!isExperLevelUrlEmpty) {
|
if (wealthIconId != null) {
|
||||||
ImageLoadUtils.loadImage(mContext, experLevelUrl, ivUserExper);
|
wealthView.setImageResource(wealthIconId);
|
||||||
|
wealthView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
wealthView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
//魅力等级
|
//魅力等级
|
||||||
AppCompatImageView ivUserCharm = baseViewHolder.getView(R.id.iv_user_charm);
|
|
||||||
String charmLevelUrl = NobleUtil.getLevel(UserLevelResourceType.CHARM_URL, onlineChatMember.chatRoomMember);
|
String charmLevelUrl = NobleUtil.getLevel(UserLevelResourceType.CHARM_URL, onlineChatMember.chatRoomMember);
|
||||||
boolean isCharmLevelUrlEmpty = TextUtils.isEmpty(charmLevelUrl);
|
AppCompatImageView charmView = baseViewHolder.getView(R.id.iv_user_charm);
|
||||||
ivUserCharm.setVisibility(!isCharmLevelUrlEmpty ? View.VISIBLE : View.GONE);
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIconByUrl(charmLevelUrl);
|
||||||
if (!isCharmLevelUrlEmpty) {
|
if (charmIconId != null) {
|
||||||
ImageLoadUtils.loadImage(mContext, charmLevelUrl, ivUserCharm);
|
charmView.setImageResource(charmIconId);
|
||||||
|
charmView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
charmView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
// 官方主播铭牌标识
|
// 官方主播铭牌标识
|
||||||
|
@@ -61,6 +61,7 @@ import com.nnbc123.app.avroom.dialog.PKResultDialog;
|
|||||||
import com.nnbc123.app.common.widget.CustomAutoWidthImageSpan;
|
import com.nnbc123.app.common.widget.CustomAutoWidthImageSpan;
|
||||||
import com.nnbc123.app.common.widget.CustomImageSpan;
|
import com.nnbc123.app.common.widget.CustomImageSpan;
|
||||||
import com.nnbc123.app.common.widget.OriginalDrawStatusClickSpan;
|
import com.nnbc123.app.common.widget.OriginalDrawStatusClickSpan;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.app.ui.utils.ImageLoadKt;
|
import com.nnbc123.app.ui.utils.ImageLoadKt;
|
||||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||||
import com.nnbc123.app.ui.widget.DividerItemDecoration;
|
import com.nnbc123.app.ui.widget.DividerItemDecoration;
|
||||||
@@ -2059,8 +2060,26 @@ public class MessageView extends FrameLayout {
|
|||||||
builder.append(ivOfficialMask, SizeUtils.dp2px(mContext, 62), expLevelHeight);
|
builder.append(ivOfficialMask, SizeUtils.dp2px(mContext, 62), expLevelHeight);
|
||||||
}
|
}
|
||||||
//等级
|
//等级
|
||||||
builder.append(userLevel, expLevelWidth, expLevelHeight);
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIconByUrl(userLevel);
|
||||||
builder.append(charmLevel, expLevelWidth, expLevelHeight);
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIconByUrl(charmLevel);
|
||||||
|
Drawable wealthDrawable = null;
|
||||||
|
Drawable charmDrawable = null;
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
wealthDrawable = ResourcesCompat.getDrawable(getResources(),
|
||||||
|
wealthIconId, null);
|
||||||
|
}
|
||||||
|
if (charmIconId != null) {
|
||||||
|
charmDrawable = ResourcesCompat.getDrawable(getResources(),
|
||||||
|
charmIconId, null);
|
||||||
|
}
|
||||||
|
if (wealthDrawable != null) {
|
||||||
|
builder.append(wealthDrawable, expLevelWidth, expLevelHeight);
|
||||||
|
}
|
||||||
|
if (charmDrawable != null) {
|
||||||
|
builder.append(charmDrawable, expLevelWidth, expLevelHeight);
|
||||||
|
}
|
||||||
|
// builder.append(userLevel, expLevelWidth, expLevelHeight);
|
||||||
|
// builder.append(charmLevel, expLevelWidth, expLevelHeight);
|
||||||
//铭牌
|
//铭牌
|
||||||
String tvNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_WORD, chatRoomMessage).trim();
|
String tvNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_WORD, chatRoomMessage).trim();
|
||||||
String ivNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_PIC, chatRoomMessage);
|
String ivNamePlate = NobleUtil.getNamePlate(UserInfo.NAMEPLATE_PIC, chatRoomMessage);
|
||||||
@@ -2587,7 +2606,16 @@ public class MessageView extends FrameLayout {
|
|||||||
String userLevel = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, chatRoomMessage);
|
String userLevel = NobleUtil.getLevel(UserLevelResourceType.EXPER_URL, chatRoomMessage);
|
||||||
SpannableBuilder text = new SpannableBuilder(tvContent);
|
SpannableBuilder text = new SpannableBuilder(tvContent);
|
||||||
//等级
|
//等级
|
||||||
text.append(userLevel, expLevelWidth, expLevelHeight);
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIconByUrl(userLevel);
|
||||||
|
Drawable wealthDrawable = null;
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
wealthDrawable = ResourcesCompat.getDrawable(getResources(),
|
||||||
|
wealthIconId, null);
|
||||||
|
}
|
||||||
|
if (wealthDrawable != null) {
|
||||||
|
text.append(wealthDrawable, expLevelWidth, expLevelHeight);
|
||||||
|
}
|
||||||
|
// text.append(userLevel, expLevelWidth, expLevelHeight);
|
||||||
text.append(senderNick, new ForegroundColorSpan(appColor),
|
text.append(senderNick, new ForegroundColorSpan(appColor),
|
||||||
new OriginalDrawStatusClickSpan() {
|
new OriginalDrawStatusClickSpan() {
|
||||||
@Override
|
@Override
|
||||||
|
@@ -34,6 +34,7 @@ import com.nnbc123.app.home.helper.OpenRoomHelper
|
|||||||
import com.nnbc123.app.qiyukefu.CustomerServerHelper
|
import com.nnbc123.app.qiyukefu.CustomerServerHelper
|
||||||
import com.nnbc123.app.skill.activity.SkillHomeActivity
|
import com.nnbc123.app.skill.activity.SkillHomeActivity
|
||||||
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.start
|
import com.nnbc123.app.skill.activity.SkillHomeActivity.Companion.start
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper
|
||||||
import com.nnbc123.app.ui.patriarch.PatriarchModeActivity
|
import com.nnbc123.app.ui.patriarch.PatriarchModeActivity
|
||||||
import com.nnbc123.app.ui.pay.ChargeActivity
|
import com.nnbc123.app.ui.pay.ChargeActivity
|
||||||
import com.nnbc123.app.ui.relation.AttentionListActivity
|
import com.nnbc123.app.ui.relation.AttentionListActivity
|
||||||
@@ -327,15 +328,15 @@ class MeFragment : BaseFragment(), View.OnClickListener {
|
|||||||
mBinding.ivUserCharm.visibility = View.GONE
|
mBinding.ivUserCharm.visibility = View.GONE
|
||||||
mBinding.ivUserLevel.visibility = View.GONE
|
mBinding.ivUserLevel.visibility = View.GONE
|
||||||
if (userLevelVo != null) {
|
if (userLevelVo != null) {
|
||||||
val userLevelUrl = userLevelVo.getExperUrl()
|
val charmIconId = LevelIconHelper.getCharmIcon(userLevelVo.charmLevelSeq)
|
||||||
val userCharmUrl = userLevelVo.getCharmUrl()
|
val wealthIconId = LevelIconHelper.getWealthIcon(userLevelVo.experLevelSeq)
|
||||||
if (!TextUtils.isEmpty(userLevelUrl)) {
|
if (charmIconId != null) {
|
||||||
mBinding.ivUserLevel.visibility = View.VISIBLE
|
mBinding.ivUserCharm.setImageResource(charmIconId)
|
||||||
ImageLoadUtils.loadImage(mContext, userLevelUrl, mBinding.ivUserLevel)
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(userCharmUrl)) {
|
|
||||||
mBinding.ivUserCharm.visibility = View.VISIBLE
|
mBinding.ivUserCharm.visibility = View.VISIBLE
|
||||||
ImageLoadUtils.loadImage(mContext, userCharmUrl, mBinding.ivUserCharm)
|
}
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
mBinding.ivUserLevel.setImageResource(wealthIconId)
|
||||||
|
mBinding.ivUserLevel.visibility = View.VISIBLE
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
92
app/src/main/java/com/nnbc123/app/support/LevelIconHelper.kt
Normal file
@@ -0,0 +1,92 @@
|
|||||||
|
package com.nnbc123.app.support
|
||||||
|
|
||||||
|
import androidx.collection.ArrayMap
|
||||||
|
import com.chuhai.utils.AppUtils
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Max on 2023/11/3 18:00
|
||||||
|
* Desc:等级图标助手
|
||||||
|
**/
|
||||||
|
object LevelIconHelper {
|
||||||
|
|
||||||
|
private val map: ArrayMap<String, Int> by lazy() {
|
||||||
|
ArrayMap()
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取魅力等级ICON
|
||||||
|
* @param iconUrl 图标地址
|
||||||
|
*/
|
||||||
|
fun getCharmIconByUrl(iconUrl: String?): Int? {
|
||||||
|
return getCharmIcon(parseLevelNumber(iconUrl))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取财富等级ICON
|
||||||
|
* @param iconUrl 图标地址
|
||||||
|
*/
|
||||||
|
fun getWealthIconByUrl(iconUrl: String?): Int? {
|
||||||
|
return getWealthIcon(parseLevelNumber(iconUrl))
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取魅力等级ICON
|
||||||
|
* @param level 等级
|
||||||
|
* @return 图标资源ID
|
||||||
|
*/
|
||||||
|
fun getCharmIcon(level: Int?): Int? {
|
||||||
|
val levelName = getLevelName(level) ?: return null
|
||||||
|
return getDrawableRedIdByName("charm_ic_$levelName")
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取财富等级ICON
|
||||||
|
* @param level 等级
|
||||||
|
* @return 图标资源ID
|
||||||
|
*/
|
||||||
|
fun getWealthIcon(level: Int?): Int? {
|
||||||
|
val levelName = getLevelName(level) ?: return null
|
||||||
|
return getDrawableRedIdByName("wealth_ic_$levelName")
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getDrawableRedIdByName(name: String): Int? {
|
||||||
|
val value = map[name]
|
||||||
|
if (value != null) {
|
||||||
|
return value
|
||||||
|
}
|
||||||
|
return try {
|
||||||
|
val id = AppUtils.getApp().resources.getIdentifier(
|
||||||
|
name,
|
||||||
|
"drawable",
|
||||||
|
AppUtils.getApp().packageName
|
||||||
|
)
|
||||||
|
map[name] = id
|
||||||
|
id
|
||||||
|
} catch (e: Exception) {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun parseLevelNumber(levelIconUrl: String?): Int? {
|
||||||
|
if (levelIconUrl == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
// TODO 待实现
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun getLevelName(level: Int?): String? {
|
||||||
|
if (level == null) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
if (level <= 0 || level > 110) {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
return if (level < 10) {
|
||||||
|
"0$level"
|
||||||
|
} else {
|
||||||
|
level.toString()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@@ -7,18 +7,21 @@ import androidx.core.content.ContextCompat;
|
|||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
import com.nnbc123.app.R;
|
import com.nnbc123.app.R;
|
||||||
import com.nnbc123.app.friend.action.AbstractSelectFriendAction;
|
import com.nnbc123.app.friend.action.AbstractSelectFriendAction;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity;
|
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity;
|
||||||
import com.nnbc123.app.ui.user.UserInfoActivity;
|
import com.nnbc123.app.ui.user.UserInfoActivity;
|
||||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||||
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
||||||
import com.nnbc123.app.vip.VipHelper;
|
import com.nnbc123.app.vip.VipHelper;
|
||||||
import com.nnbc123.app.room_chat.activity.NimRoomP2PMessageActivity;
|
import com.nnbc123.app.room_chat.activity.NimRoomP2PMessageActivity;
|
||||||
|
import com.nnbc123.core.level.UserLevelVo;
|
||||||
import com.nnbc123.core.noble.NobleUtil;
|
import com.nnbc123.core.noble.NobleUtil;
|
||||||
import com.nnbc123.core.user.bean.UserInfo;
|
import com.nnbc123.core.user.bean.UserInfo;
|
||||||
import com.nnbc123.core.utils.StringExtensionKt;
|
import com.nnbc123.core.utils.StringExtensionKt;
|
||||||
@@ -91,18 +94,27 @@ public class FriendListAdapter extends BaseQuickAdapter<UserInfo, BaseViewHolder
|
|||||||
ivNobleLevel.setVisibility(View.GONE);
|
ivNobleLevel.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppCompatImageView ivUserLevel = helper.getView(R.id.iv_user_level);
|
ImageView charmView = helper.getView(R.id.iv_charm_level);
|
||||||
ivUserLevel.setVisibility(View.GONE);
|
ImageView wealthView = helper.getView(R.id.iv_user_level);
|
||||||
if (item.getUserLevelVo() != null && !TextUtils.isEmpty(item.getUserLevelVo().getExperUrl())) {
|
UserLevelVo userLevelVo = item.getUserLevelVo();
|
||||||
ivUserLevel.setVisibility(View.VISIBLE);
|
if (userLevelVo != null) {
|
||||||
ImageLoadUtils.loadImage(mContext, item.getUserLevelVo().getExperUrl(), ivUserLevel);
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIcon(userLevelVo.charmLevelSeq);
|
||||||
}
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIcon(userLevelVo.experLevelSeq);
|
||||||
|
if (charmIconId != null) {
|
||||||
AppCompatImageView ivCharmLevel = helper.getView(R.id.iv_charm_level);
|
charmView.setImageResource(charmIconId);
|
||||||
ivCharmLevel.setVisibility(View.GONE);
|
charmView.setVisibility(View.VISIBLE);
|
||||||
if (item.getUserLevelVo() != null && !TextUtils.isEmpty(item.getUserLevelVo().getCharmUrl())) {
|
} else {
|
||||||
ivCharmLevel.setVisibility(View.VISIBLE);
|
charmView.setVisibility(View.GONE);
|
||||||
ImageLoadUtils.loadImage(mContext, item.getUserLevelVo().getCharmUrl(), ivCharmLevel);
|
}
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
wealthView.setImageResource(wealthIconId);
|
||||||
|
wealthView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
wealthView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
charmView.setVisibility(View.GONE);
|
||||||
|
wealthView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
helper.getView(R.id.container).setOnClickListener(new View.OnClickListener() {
|
helper.getView(R.id.container).setOnClickListener(new View.OnClickListener() {
|
||||||
|
@@ -1,18 +1,22 @@
|
|||||||
package com.nnbc123.app.ui.relation.adapter;
|
package com.nnbc123.app.ui.relation.adapter;
|
||||||
|
|
||||||
import androidx.appcompat.widget.AppCompatImageView;
|
import androidx.appcompat.widget.AppCompatImageView;
|
||||||
|
|
||||||
import android.text.TextUtils;
|
import android.text.TextUtils;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.ImageView;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.chad.library.adapter.base.BaseQuickAdapter;
|
import com.chad.library.adapter.base.BaseQuickAdapter;
|
||||||
import com.chad.library.adapter.base.BaseViewHolder;
|
import com.chad.library.adapter.base.BaseViewHolder;
|
||||||
import com.nnbc123.app.R;
|
import com.nnbc123.app.R;
|
||||||
import com.nnbc123.app.friend.action.AbstractSelectFriendAction;
|
import com.nnbc123.app.friend.action.AbstractSelectFriendAction;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
import com.nnbc123.app.ui.utils.ImageLoadUtils;
|
||||||
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
import com.nnbc123.app.ui.widget.NobleAvatarView;
|
||||||
import com.nnbc123.app.vip.VipHelper;
|
import com.nnbc123.app.vip.VipHelper;
|
||||||
import com.nnbc123.core.im.friend.IMFriendModel;
|
import com.nnbc123.core.im.friend.IMFriendModel;
|
||||||
|
import com.nnbc123.core.level.UserLevelVo;
|
||||||
import com.nnbc123.core.noble.NobleUtil;
|
import com.nnbc123.core.noble.NobleUtil;
|
||||||
import com.nnbc123.core.user.bean.FansInfo;
|
import com.nnbc123.core.user.bean.FansInfo;
|
||||||
import com.nnbc123.core.utils.StringExtensionKt;
|
import com.nnbc123.core.utils.StringExtensionKt;
|
||||||
@@ -51,7 +55,7 @@ public class FansViewAdapter extends BaseQuickAdapter<FansInfo, BaseViewHolder>
|
|||||||
@Override
|
@Override
|
||||||
protected void convert(BaseViewHolder baseViewHolder, final FansInfo fansInfo) {
|
protected void convert(BaseViewHolder baseViewHolder, final FansInfo fansInfo) {
|
||||||
if (fansInfo == null) return;
|
if (fansInfo == null) return;
|
||||||
baseViewHolder.setText(R.id.tv_userName, StringExtensionKt.subAndReplaceDot(fansInfo.getNick(),8))
|
baseViewHolder.setText(R.id.tv_userName, StringExtensionKt.subAndReplaceDot(fansInfo.getNick(), 8))
|
||||||
.setText(R.id.tv_user_desc, fansInfo.getUserDesc() != null ?
|
.setText(R.id.tv_user_desc, fansInfo.getUserDesc() != null ?
|
||||||
fansInfo.getUserDesc()
|
fansInfo.getUserDesc()
|
||||||
: baseViewHolder.itemView.getContext().getResources().getString(R.string.msg_no_user_desc))
|
: baseViewHolder.itemView.getContext().getResources().getString(R.string.msg_no_user_desc))
|
||||||
@@ -104,18 +108,27 @@ public class FansViewAdapter extends BaseQuickAdapter<FansInfo, BaseViewHolder>
|
|||||||
nobleAvatarView.setSize(55, 75, 15);
|
nobleAvatarView.setSize(55, 75, 15);
|
||||||
nobleAvatarView.setData(fansInfo.getAvatar(), fansInfo.getNobleUsers());
|
nobleAvatarView.setData(fansInfo.getAvatar(), fansInfo.getNobleUsers());
|
||||||
|
|
||||||
AppCompatImageView ivUserLevel = baseViewHolder.getView(R.id.iv_user_level);
|
ImageView charmView = baseViewHolder.getView(R.id.iv_charm_level);
|
||||||
ivUserLevel.setVisibility(View.GONE);
|
ImageView wealthView = baseViewHolder.getView(R.id.iv_user_level);
|
||||||
if (fansInfo.getUserLevelVo() != null && !TextUtils.isEmpty(fansInfo.getUserLevelVo().getExperUrl())) {
|
UserLevelVo userLevelVo = fansInfo.getUserLevelVo();
|
||||||
ivUserLevel.setVisibility(View.VISIBLE);
|
if (userLevelVo != null) {
|
||||||
ImageLoadUtils.loadImage(mContext, fansInfo.getUserLevelVo().getExperUrl(), ivUserLevel);
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIcon(userLevelVo.charmLevelSeq);
|
||||||
}
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIcon(userLevelVo.experLevelSeq);
|
||||||
|
if (charmIconId != null) {
|
||||||
AppCompatImageView ivCharmLevel = baseViewHolder.getView(R.id.iv_charm_level);
|
charmView.setImageResource(charmIconId);
|
||||||
ivCharmLevel.setVisibility(View.GONE);
|
charmView.setVisibility(View.VISIBLE);
|
||||||
if (fansInfo.getUserLevelVo() != null && !TextUtils.isEmpty(fansInfo.getUserLevelVo().getCharmUrl())) {
|
} else {
|
||||||
ivCharmLevel.setVisibility(View.VISIBLE);
|
charmView.setVisibility(View.GONE);
|
||||||
ImageLoadUtils.loadImage(mContext, fansInfo.getUserLevelVo().getCharmUrl(), ivCharmLevel);
|
}
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
wealthView.setImageResource(wealthIconId);
|
||||||
|
wealthView.setVisibility(View.VISIBLE);
|
||||||
|
} else {
|
||||||
|
wealthView.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
charmView.setVisibility(View.GONE);
|
||||||
|
wealthView.setVisibility(View.GONE);
|
||||||
}
|
}
|
||||||
|
|
||||||
AppCompatImageView ivBadge = baseViewHolder.getView(R.id.iv_noble_level);
|
AppCompatImageView ivBadge = baseViewHolder.getView(R.id.iv_noble_level);
|
||||||
|
@@ -41,6 +41,7 @@ import com.nnbc123.app.family.view.activity.FamilyMemberListActivity;
|
|||||||
import com.nnbc123.app.family.view.activity.FamilyMemberSearchActivity;
|
import com.nnbc123.app.family.view.activity.FamilyMemberSearchActivity;
|
||||||
import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter;
|
import com.nnbc123.app.home.adapter.MainMagicIndicatorAdapter;
|
||||||
import com.nnbc123.app.module_hall.hall.activity.ModuleClanActivity;
|
import com.nnbc123.app.module_hall.hall.activity.ModuleClanActivity;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.app.ui.im.avtivity.NimFriendModel;
|
import com.nnbc123.app.ui.im.avtivity.NimFriendModel;
|
||||||
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity;
|
import com.nnbc123.app.ui.im.avtivity.NimP2PMessageActivity;
|
||||||
import com.nnbc123.app.ui.user.adapter.SelfPhotoAdapter;
|
import com.nnbc123.app.ui.user.adapter.SelfPhotoAdapter;
|
||||||
@@ -426,15 +427,15 @@ public class UserInfoActivity extends BaseBindingActivity<ActivityUserInfoBindin
|
|||||||
mBinding.ivUserCharm.setVisibility(View.GONE);
|
mBinding.ivUserCharm.setVisibility(View.GONE);
|
||||||
mBinding.ivUserLevel.setVisibility(View.GONE);
|
mBinding.ivUserLevel.setVisibility(View.GONE);
|
||||||
if (userLevelVo != null) {
|
if (userLevelVo != null) {
|
||||||
String userLevelUrl = userLevelVo.getExperUrl();
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIcon(userLevelVo.charmLevelSeq);
|
||||||
String userCharmUrl = userLevelVo.getCharmUrl();
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIcon(userLevelVo.experLevelSeq);
|
||||||
if (!TextUtils.isEmpty(userLevelUrl)) {
|
if (charmIconId != null) {
|
||||||
mBinding.ivUserLevel.setVisibility(View.VISIBLE);
|
mBinding.ivUserCharm.setImageResource(charmIconId);
|
||||||
ImageLoadUtils.loadImage(this, userLevelUrl, mBinding.ivUserLevel);
|
|
||||||
}
|
|
||||||
if (!TextUtils.isEmpty(userCharmUrl)) {
|
|
||||||
mBinding.ivUserCharm.setVisibility(View.VISIBLE);
|
mBinding.ivUserCharm.setVisibility(View.VISIBLE);
|
||||||
ImageLoadUtils.loadImage(this, userCharmUrl, mBinding.ivUserCharm);
|
}
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
mBinding.ivUserLevel.setImageResource(wealthIconId);
|
||||||
|
mBinding.ivUserLevel.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -26,6 +26,7 @@ import androidx.recyclerview.widget.RecyclerView;
|
|||||||
|
|
||||||
import com.google.android.flexbox.FlexboxLayout;
|
import com.google.android.flexbox.FlexboxLayout;
|
||||||
import com.netease.nim.uikit.common.util.sys.ClipboardUtil;
|
import com.netease.nim.uikit.common.util.sys.ClipboardUtil;
|
||||||
|
import com.nnbc123.app.support.LevelIconHelper;
|
||||||
import com.nnbc123.core.Constants;
|
import com.nnbc123.core.Constants;
|
||||||
import com.nnbc123.core.auth.AuthModel;
|
import com.nnbc123.core.auth.AuthModel;
|
||||||
import com.nnbc123.core.bean.RoomMicInfo;
|
import com.nnbc123.core.bean.RoomMicInfo;
|
||||||
@@ -550,16 +551,18 @@ public class UserInfoDialog extends AppCompatDialog implements View.OnClickListe
|
|||||||
}
|
}
|
||||||
|
|
||||||
UserLevelVo userLevelVo = userInfo.getUserLevelVo();
|
UserLevelVo userLevelVo = userInfo.getUserLevelVo();
|
||||||
mIvUserLevel.setVisibility(userLevelVo == null ? View.GONE : View.VISIBLE);
|
mIvUserLevel.setVisibility(View.GONE);
|
||||||
mIvUserCharm.setVisibility(View.GONE);
|
mIvUserCharm.setVisibility(View.GONE);
|
||||||
if (userLevelVo != null) {
|
if (userLevelVo != null) {
|
||||||
mIvUserLevel.setVisibility(TextUtils.isEmpty(userLevelVo.getExperUrl()) ? View.GONE : View.VISIBLE);
|
Integer charmIconId = LevelIconHelper.INSTANCE.getCharmIcon(userLevelVo.charmLevelSeq);
|
||||||
if (!TextUtils.isEmpty(userLevelVo.getExperUrl())) {
|
Integer wealthIconId = LevelIconHelper.INSTANCE.getWealthIcon(userLevelVo.experLevelSeq);
|
||||||
ImageLoadUtils.loadImage(context, userLevelVo.getExperUrl(), mIvUserLevel);
|
if (charmIconId != null) {
|
||||||
}
|
mIvUserCharm.setImageResource(charmIconId);
|
||||||
if (!TextUtils.isEmpty(userLevelVo.getCharmUrl())) {
|
|
||||||
mIvUserCharm.setVisibility(View.VISIBLE);
|
mIvUserCharm.setVisibility(View.VISIBLE);
|
||||||
ImageLoadUtils.loadImage(context, userLevelVo.getCharmUrl(), mIvUserCharm);
|
}
|
||||||
|
if (wealthIconId != null) {
|
||||||
|
mIvUserLevel.setImageResource(wealthIconId);
|
||||||
|
mIvUserLevel.setVisibility(View.VISIBLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_01.webp
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_02.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_03.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_04.webp
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_05.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_06.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_07.webp
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_08.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_09.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_10.webp
Normal file
After Width: | Height: | Size: 5.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_100.webp
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_101.webp
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_102.webp
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_103.webp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_104.webp
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_105.webp
Normal file
After Width: | Height: | Size: 9.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_106.webp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_107.webp
Normal file
After Width: | Height: | Size: 9.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_108.webp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_109.webp
Normal file
After Width: | Height: | Size: 9.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_11.webp
Normal file
After Width: | Height: | Size: 5.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_110.webp
Normal file
After Width: | Height: | Size: 9.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_12.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_13.webp
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_14.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_15.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_16.webp
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_17.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_18.webp
Normal file
After Width: | Height: | Size: 6.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_19.webp
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_20.webp
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_21.webp
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_22.webp
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_23.webp
Normal file
After Width: | Height: | Size: 6.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_24.webp
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_25.webp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_26.webp
Normal file
After Width: | Height: | Size: 6.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_27.webp
Normal file
After Width: | Height: | Size: 6.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_28.webp
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_29.webp
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_30.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_31.webp
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_32.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_33.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_34.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_35.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_36.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_37.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_38.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_39.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_40.webp
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_41.webp
Normal file
After Width: | Height: | Size: 6.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_42.webp
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_43.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_44.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_45.webp
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_46.webp
Normal file
After Width: | Height: | Size: 7.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_47.webp
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_48.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_49.webp
Normal file
After Width: | Height: | Size: 7.1 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_50.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_51.webp
Normal file
After Width: | Height: | Size: 6.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_52.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_53.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_54.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_55.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_56.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_57.webp
Normal file
After Width: | Height: | Size: 7.2 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_58.webp
Normal file
After Width: | Height: | Size: 7.4 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_59.webp
Normal file
After Width: | Height: | Size: 7.3 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_60.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_61.webp
Normal file
After Width: | Height: | Size: 7.6 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_62.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_63.webp
Normal file
After Width: | Height: | Size: 8.0 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_64.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_65.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_66.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_67.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_68.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_69.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_70.webp
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_71.webp
Normal file
After Width: | Height: | Size: 7.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_72.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_73.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_74.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_75.webp
Normal file
After Width: | Height: | Size: 7.8 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_76.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_77.webp
Normal file
After Width: | Height: | Size: 7.7 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_78.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_79.webp
Normal file
After Width: | Height: | Size: 7.9 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_80.webp
Normal file
After Width: | Height: | Size: 8.5 KiB |
BIN
app/src/main/res/drawable-xxhdpi/charm_ic_81.webp
Normal file
After Width: | Height: | Size: 8.3 KiB |