SpanBuilder

class SpanBuilder

Constructors

SpanBuilder
Link copied to clipboard
fun SpanBuilder(textView: TextView)

Types

Align
Link copied to clipboard
annotation class Align
Companion
Link copied to clipboard
object Companion

Functions

append
Link copied to clipboard
fun append(text: CharSequence): SpanBuilder
Append the text text.
appendImage
Link copied to clipboard
fun appendImage(bitmap: Bitmap, align: Int = ALIGN_BOTTOM): SpanBuilder
Append one image.
fun appendImage(drawable: Drawable, align: Int = ALIGN_BOTTOM): SpanBuilder
Append one image.
fun appendImage(uri: Uri, align: Int = ALIGN_BOTTOM): SpanBuilder
Append one image.
fun appendImage(@DrawableRes() resourceId: Int, align: Int = ALIGN_BOTTOM): SpanBuilder
Append one image.
appendLine
Link copied to clipboard
fun appendLine(): SpanBuilder
Append one line.
fun appendLine(text: CharSequence): SpanBuilder
Append text and one line.
appendSpace
Link copied to clipboard
fun appendSpace(@IntRange(from = 0.toLong()size: Int, @ColorInt() color: Int = Color.TRANSPARENT): SpanBuilder
Append space.
build
Link copied to clipboard
fun build(): SpannableStringBuilder
Create the span string.
get
Link copied to clipboard
fun get(): SpannableStringBuilder
setBackgroundColor
Link copied to clipboard
fun setBackgroundColor(@ColorInt() color: Int): SpanBuilder
Set the span of background's color.
setBackgroundColorRes
Link copied to clipboard
fun setBackgroundColorRes(@ColorRes() color: Int): SpanBuilder
Set the span of background's color.
setBlur
Link copied to clipboard
fun setBlur(@FloatRange(from = 0.0.toDouble(), fromInclusive = falseradius: Float, style: BlurMaskFilter.Blur): SpanBuilder
Set the span of blur.
setBold
Link copied to clipboard
fun setBold(): SpanBuilder
Set the span of bold.
setBoldItalic
Link copied to clipboard
fun setBoldItalic(): SpanBuilder
Set the span of bold italic.
setBullet
Link copied to clipboard
fun setBullet(@IntRange(from = 0.toLong()gapWidth: Int): SpanBuilder
Set the span of bullet.
fun setBullet(@ColorInt() color: Int, @IntRange(from = 0.toLong()radius: Int, @IntRange(from = 0.toLong()gapWidth: Int): SpanBuilder
Set the span of bullet.
setClickSpan
Link copied to clipboard
fun setClickSpan(clickSpan: ClickableSpan): SpanBuilder
Set the span of click.
setFlag
Link copied to clipboard
fun setFlag(flag: Int): SpanBuilder
Set the span of flag.
setFontFamily
Link copied to clipboard
fun setFontFamily(fontFamily: String): SpanBuilder
Set the span of font family.
setFontProportion
Link copied to clipboard
fun setFontProportion(proportion: Float): SpanBuilder
Set the span of proportion of font.
setFontSize
Link copied to clipboard
fun setFontSize(@IntRange(from = 0.toLong()size: Int, isSp: Boolean = false): SpanBuilder
Set the span of size of font.
setFontXProportion
Link copied to clipboard
fun setFontXProportion(proportion: Float): SpanBuilder
Set the span of transverse proportion of font.
setForegroundColor
Link copied to clipboard
fun setForegroundColor(@ColorInt() color: Int): SpanBuilder
Set the span of foreground's color.
setForegroundColorRes
Link copied to clipboard
fun setForegroundColorRes(@ColorRes() color: Int): SpanBuilder
Set the span of foreground's color.
setHorizontalAlign
Link copied to clipboard
fun setHorizontalAlign(alignment: Layout.Alignment): SpanBuilder
Set the span of horizontal alignment.
setItalic
Link copied to clipboard
fun setItalic(): SpanBuilder
Set the span of italic.
setLeadingMargin
Link copied to clipboard
fun setLeadingMargin(@IntRange(from = 0.toLong()first: Int, @IntRange(from = 0.toLong()rest: Int): SpanBuilder
Set the span of leading margin.
setLineHeight
Link copied to clipboard
fun setLineHeight(@IntRange(from = 0.toLong()lineHeight: Int, align: Int = ALIGN_CENTER): SpanBuilder
Set the span of line height.
setQuoteColor
Link copied to clipboard
fun setQuoteColor(@ColorInt() color: Int, @IntRange(from = 1.toLong()stripeWidth: Int = 2, @IntRange(from = 0.toLong()gapWidth: Int = 2): SpanBuilder
Set the span of quote's color.
setShader
Link copied to clipboard
fun setShader(shader: Shader): SpanBuilder
Set the span of shader.
setShadow
Link copied to clipboard
fun setShadow(@FloatRange(from = 0.0.toDouble(), fromInclusive = falseradius: Float, dx: Float, dy: Float, shadowColor: Int): SpanBuilder
Set the span of shadow.
setSpans
Link copied to clipboard
fun setSpans(vararg spans: Any): SpanBuilder
Set the spans.
setStrikethrough
Link copied to clipboard
fun setStrikethrough(): SpanBuilder
Set the span of strikethrough.
setSubscript
Link copied to clipboard
fun setSubscript(): SpanBuilder
Set the span of subscript.
setSuperscript
Link copied to clipboard
fun setSuperscript(): SpanBuilder
Set the span of superscript.
setTypeface
Link copied to clipboard
fun setTypeface(typeface: Typeface): SpanBuilder
Set the span of typeface.
setUnderline
Link copied to clipboard
fun setUnderline(): SpanBuilder
Set the span of underline.
setUrl
Link copied to clipboard
fun setUrl(url: String): SpanBuilder
Set the span of url.
setVerticalAlign
Link copied to clipboard
fun setVerticalAlign(align: Int): SpanBuilder
Set the span of vertical alignment.