关系任务十级时候经验值超出显示不全
This commit is contained in:
@@ -57,9 +57,16 @@ class CpTaskActivity : BaseBindingActivity<ActivityCpTaskBinding>(),
|
||||
val progress = ((entity.cpSecretVal.toFloat() / entity.cpNextLevelSecretVal) * 100).toInt()
|
||||
mBinding.progressBar.progress = progress
|
||||
mBinding.tvProgress.text = "${entity.cpSecretVal}/${entity.cpNextLevelSecretVal}"
|
||||
var pl = mBinding.progressBar.width * (progress * 1f / 100).toInt() - ScreenUtil.dip2px(10f)
|
||||
if (pl < 0) pl = ScreenUtil.dip2px(5f)
|
||||
mBinding.tvProgress.setPadding(pl, 0, 0, 0)
|
||||
mBinding.tvProgress.measure(0, 0)
|
||||
val pRight = ScreenUtil.dip2px(5f)
|
||||
val pLeft = ScreenUtil.dip2px(5f)
|
||||
val tvWidth = mBinding.tvProgress.measuredWidth
|
||||
val pbWidth = mBinding.progressBar.width
|
||||
var left = pbWidth * (progress * 1f / 100).toInt() - pRight - tvWidth
|
||||
if (left < 0) {
|
||||
left = pLeft
|
||||
}
|
||||
mBinding.tvProgress.translationX = left.toFloat()
|
||||
mBinding.ivDropDown.visibility = entity.isDamp.visibility()
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user