增加支付接口相关逻辑
This commit is contained in:
@@ -10,20 +10,19 @@ import com.sw.dualscreen.model.response.TextBean
|
||||
|
||||
object SpannedUtils {
|
||||
|
||||
const val SPAN_FLAGS = Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
|
||||
public fun getAmountText(list: List<TextBean>): SpannedString {
|
||||
return buildSpannedString {
|
||||
list.forEach {
|
||||
append(
|
||||
it.text,
|
||||
AbsoluteSizeSpan(it.textSize, true),
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
val start = length
|
||||
append(it.text)
|
||||
val end = length
|
||||
if (it.textSize != 0) {
|
||||
setSpan(AbsoluteSizeSpan(it.textSize, true), start, end, SPAN_FLAGS)
|
||||
}
|
||||
if (it.textColor.isNullOrBlank().not()) {
|
||||
append(
|
||||
it.text,
|
||||
ForegroundColorSpan(it.textColor!!.toColorInt()),
|
||||
Spanned.SPAN_EXCLUSIVE_EXCLUSIVE
|
||||
)
|
||||
setSpan(ForegroundColorSpan(it.textColor!!.toColorInt()), start, end, SPAN_FLAGS)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user