Skip to content

Commit

Permalink
1,优化代码
Browse files Browse the repository at this point in the history
  • Loading branch information
FlyJingFish committed Jan 10, 2023
1 parent 1fc0fd5 commit c74c123
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,8 @@ import android.util.AttributeSet
import android.util.LayoutDirection
import android.view.View
import androidx.annotation.StringRes
import java.lang.NullPointerException
import androidx.core.text.TextUtilsCompat
import java.util.*
import kotlin.math.max


class FormatTextView : BaseTextView {
Expand Down Expand Up @@ -83,8 +81,8 @@ class FormatTextView : BaseTextView {
}

fun setFormatText(formatTextValue: String, vararg args: Int) {
val formatTexts: Array<FormatText?> = arrayOfNulls<FormatText>(args.size)
for (i in 0 until args.size) {
val formatTexts: Array<FormatText?> = arrayOfNulls(args.size)
for (i in args.indices) {
formatTexts[i] = FormatText().setResValue(args[i])
}
setFormatTextBean(formatTextValue, *formatTexts)
Expand All @@ -95,8 +93,8 @@ class FormatTextView : BaseTextView {
}

fun setFormatText(formatTextValue: String, vararg args: String) {
val formatTexts: Array<FormatText?> = arrayOfNulls<FormatText>(args.size)
for (i in 0 until args.size) {
val formatTexts: Array<FormatText?> = arrayOfNulls(args.size)
for (i in args.indices) {
formatTexts[i] = FormatText().setStrValue(args[i])
}
setFormatTextBean(formatTextValue, *formatTexts)
Expand Down

0 comments on commit c74c123

Please sign in to comment.