Package com.drake.engine.text

Types

SpanBuilder
Link copied to clipboard
class SpanBuilder

Functions

addSpan
Link copied to clipboard
fun CharSequence.addSpan(text: CharSequence, what: Any? = null): CharSequence
添加字符串并添加效果, 同时保留以前文字效果
replaceSpan
Link copied to clipboard
fun CharSequence.replaceSpan(oldValue: String, ignoreCase: Boolean = false, replacement: (MatchResult) -> Any?): CharSequence
替换匹配的字符串
fun CharSequence.replaceSpan(regex: Regex, quoteGroup: Boolean = false, replacement: (MatchResult) -> Any?): CharSequence
使用正则替换匹配字符串
replaceSpanFirst
Link copied to clipboard
fun CharSequence.replaceSpanFirst(oldValue: String, ignoreCase: Boolean = false, replacement: (MatchResult) -> Any?): CharSequence
替换匹配的字符串
fun CharSequence.replaceSpanFirst(regex: Regex, quoteGroup: Boolean = false, replacement: (MatchResult) -> Any?): CharSequence
使用正则替换第一个匹配字符串
setSpan
Link copied to clipboard
fun CharSequence.setSpan(what: Any?): CharSequence
设置Span文字效果
toSpanBuilder
Link copied to clipboard
fun TextView.toSpanBuilder(): SpanBuilder
fun String.toSpanBuilder(): SpanBuilder