Companion

object Companion

Functions

Link copied to clipboard
@JvmStatic
@JvmOverloads
fun activateClick(textView: TextView, background: Boolean = true): TextView

兼容Java适配 @see TextView.activateClick

Link copied to clipboard
@JvmStatic
fun color(colorString: String): Int
Link copied to clipboard
@JvmStatic
fun create(): Span

构建Span

Link copied to clipboard
@JvmStatic
fun dp(value: Int): Int

dp 2 px

Link copied to clipboard
@JvmStatic
@JvmOverloads
fun drawableSize(size: Int, unit: Int = ConversionUnit.NOT_CONVERT): DrawableSize

快速构建 DrawableSize

Link copied to clipboard
@JvmStatic
fun removeAllSpans(span: Spannable)

删除所有CharacterStyle Span

Link copied to clipboard
@JvmStatic
fun removeSpans(text: CharSequence, type: Class<*>): CharSequence
Link copied to clipboard
@JvmStatic
fun sp(value: Int): Int

sp 2 px

Link copied to clipboard
@JvmStatic
fun spannedString(vararg texts: CharSequence): SpannedString

适配Java不支持CharSequence operator plus eg. SpanExtension.spannedString(spanImage(...),spanColor(..))

Link copied to clipboard
@JvmStatic
@JvmOverloads
fun toReplaceRule(replaceString: String, isRegex: Boolean = false, matchIndex: Int? = null, matchRange: IntRange? = null, newString: CharSequence? = null, replacementMatch: OnSpanReplacementMatch? = null): ReplaceRule

兼容Java适配 @see toReplaceRule