Package 

Class TextViewSpanktxKt

    • Method Summary

      Modifier and Type Method Description
      final static TextView sizeSpan(TextView $self, String str, IntRange range, Float scale) 设置 TextView 的文字大小,并应用给定范围的 Span。
      final static TextView sizeSpan(TextView $self, String str, IntRange range, Integer textSize) 设置 TextView 的文字大小,并应用给定范围的 Span。
      final static TextView appendSizeSpan(TextView $self, String str, Float scale) 设置 TextView 的文字大小,并应用给定范围的 Span。
      final static TextView appendSizeSpan(TextView $self, String str, Integer textSize) 设置 TextView 的文字大小,并应用给定范围的 Span。
      final static TextView colorSpan(TextView $self, String str, IntRange range, Integer color) 向 TextView 追加文字,并设置追加文本的颜色。
      final static TextView appendColorSpan(TextView $self, String str, Integer color) 向 TextView 追加文字,并设置追加文本的颜色。
      final static TextView backgroundColorSpan(TextView $self, String str, IntRange range, Integer color) 设置 TextView 的背景颜色,并应用给定范围的 Span。
      final static TextView appendBackgroundColorSpan(TextView $self, String str, Integer color) 设置 TextView 的背景颜色,并应用给定范围的 Span。
      final static TextView strikeThroughtSpan(TextView $self, String str, IntRange range) 设置 TextView 的文本并添加删除线样式。
      final static TextView appendStrikeThroughtSpan(TextView $self, String str) 设置 TextView 的文本并添加删除线样式。
      final static TextView clickSpan(TextView $self, String str, IntRange range, Integer color, Boolean isUnderlineText, Function0<Unit> clickAction) 向 TextView 追加文本,并为追加的文本添加点击事件。
      final static TextView appendClickSpan(TextView $self, String str, Integer color, Boolean isUnderlineText, Function0<Unit> clickAction) 向 TextView 追加文本,并为追加的文本添加点击事件。
      final static TextView styleSpan(TextView $self, String str, IntRange range, Integer style) 设置 TextView 的文本样式。
      final static TextView appendStyleSpan(TextView $self, String str, Integer style) 向 TextView 追加文本,并为追加的文本设置文本样式。
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • sizeSpan

         final static TextView sizeSpan(TextView $self, String str, IntRange range, Float scale)

        设置 TextView 的文字大小,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        range - 应用 Span 的文本范围。
        scale - 相对于当前文本大小的比例。
      • sizeSpan

         final static TextView sizeSpan(TextView $self, String str, IntRange range, Integer textSize)

        设置 TextView 的文字大小,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        range - 应用 Span 的文本范围。
      • appendSizeSpan

         final static TextView appendSizeSpan(TextView $self, String str, Float scale)

        设置 TextView 的文字大小,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        scale - 相对于当前文本大小的比例。
      • appendSizeSpan

         final static TextView appendSizeSpan(TextView $self, String str, Integer textSize)

        设置 TextView 的文字大小,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
      • colorSpan

         final static TextView colorSpan(TextView $self, String str, IntRange range, Integer color)

        向 TextView 追加文字,并设置追加文本的颜色。

        Parameters:
        str - 要追加的文本,为空时追加当前文本。
        range - 应用 Span 的文本范围。
        color - 文本颜色,默认为红色。
      • appendColorSpan

         final static TextView appendColorSpan(TextView $self, String str, Integer color)

        向 TextView 追加文字,并设置追加文本的颜色。

        Parameters:
        str - 要追加的文本,为空时追加当前文本。
        color - 文本颜色,默认为红色。
      • backgroundColorSpan

         final static TextView backgroundColorSpan(TextView $self, String str, IntRange range, Integer color)

        设置 TextView 的背景颜色,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        range - 应用 Span 的文本范围。
        color - 背景颜色,默认为红色。
      • appendBackgroundColorSpan

         final static TextView appendBackgroundColorSpan(TextView $self, String str, Integer color)

        设置 TextView 的背景颜色,并应用给定范围的 Span。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        color - 背景颜色,默认为红色。
      • strikeThroughtSpan

         final static TextView strikeThroughtSpan(TextView $self, String str, IntRange range)

        设置 TextView 的文本并添加删除线样式。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        range - 应用 Span 的文本范围。
      • appendStrikeThroughtSpan

         final static TextView appendStrikeThroughtSpan(TextView $self, String str)

        设置 TextView 的文本并添加删除线样式。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
      • clickSpan

         final static TextView clickSpan(TextView $self, String str, IntRange range, Integer color, Boolean isUnderlineText, Function0<Unit> clickAction)

        向 TextView 追加文本,并为追加的文本添加点击事件。

        Parameters:
        str - 要追加的文本,为空时追加当前文本。
        range - 应用 Span 的文本范围。
        color - 文本颜色,默认为红色。
        isUnderlineText - 是否显示下划线,默认为 false。
        clickAction - 点击文本时执行的 lambda 表达式。
      • appendClickSpan

         final static TextView appendClickSpan(TextView $self, String str, Integer color, Boolean isUnderlineText, Function0<Unit> clickAction)

        向 TextView 追加文本,并为追加的文本添加点击事件。

        Parameters:
        str - 要追加的文本,为空时追加当前文本。
        color - 文本颜色,默认为红色。
        isUnderlineText - 是否显示下划线,默认为 false。
        clickAction - 点击文本时执行的 lambda 表达式。
      • styleSpan

         final static TextView styleSpan(TextView $self, String str, IntRange range, Integer style)

        设置 TextView 的文本样式。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        range - 应用 Span 的文本范围。
        style - 文本样式,如粗体、斜体等,默认为粗体。
      • appendStyleSpan

         final static TextView appendStyleSpan(TextView $self, String str, Integer style)

        向 TextView 追加文本,并为追加的文本设置文本样式。

        Parameters:
        str - 要设置的文本,为空时使用当前文本。
        style - 文本样式,如粗体、斜体等,默认为粗体。