feat:完善从等级图标地址中解析等级逻辑
fix:修复公屏等级图标变形问题
This commit is contained in:
@@ -284,9 +284,9 @@ public class MessageView extends FrameLayout {
|
||||
sysIconHeight = Utils.dip2px(context, 14);
|
||||
smallFace = Utils.dip2px(context, 22);
|
||||
bigFace = Utils.dip2px(context, 30);
|
||||
//经验等级图片后台已经更换尺寸了,公屏同步下,尺寸是26:20
|
||||
expLevelHeight = Utils.dip2px(context, 20);
|
||||
expLevelWidth = expLevelHeight * 26 / 20;//expLevelHeight * 114 / 45
|
||||
//经验等级图片后台已经更换尺寸了,公屏同步下,尺寸是38:18
|
||||
expLevelHeight = Utils.dip2px(context, 18);
|
||||
expLevelWidth = expLevelHeight * 38 / 18;//expLevelHeight * 114 / 45
|
||||
giftLength = Utils.dip2px(context, 35);
|
||||
// 内容区域
|
||||
layoutManger = new LinearLayoutManager(context, RecyclerView.VERTICAL, false);
|
||||
|
@@ -2,18 +2,18 @@ package com.nnbc123.app.support
|
||||
|
||||
import androidx.collection.ArrayMap
|
||||
import com.chuhai.utils.AppUtils
|
||||
import com.chuhai.utils.log.ILog
|
||||
|
||||
/**
|
||||
* Created by Max on 2023/11/3 18:00
|
||||
* Desc:等级图标助手
|
||||
**/
|
||||
object LevelIconHelper {
|
||||
object LevelIconHelper : ILog {
|
||||
|
||||
private val map: ArrayMap<String, Int> by lazy() {
|
||||
ArrayMap()
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 获取魅力等级ICON
|
||||
* @param iconUrl 图标地址
|
||||
@@ -72,8 +72,13 @@ object LevelIconHelper {
|
||||
if (levelIconUrl == null) {
|
||||
return null
|
||||
}
|
||||
// TODO 待实现
|
||||
return 0
|
||||
// https://image.nnbc123.cn/charm_20.png
|
||||
val dotIndex = levelIconUrl.lastIndexOf('.')
|
||||
val separatorIndex = levelIconUrl.lastIndexOf('_') + 1
|
||||
if (dotIndex > 0 && separatorIndex > 0 && dotIndex > separatorIndex) {
|
||||
return levelIconUrl.substring(separatorIndex, dotIndex).toIntOrNull()
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
private fun getLevelName(level: Int?): String? {
|
||||
|
Reference in New Issue
Block a user