Google 致力于为黑人社区推动种族平等。查看具体举措

TextViewCompat

class TextViewCompat
kotlin.Any
   ↳ androidx.core.widget.TextViewCompat

Helper for accessing features in TextView.

Summary

Constants
static Int

The TextView does not auto-size text (default).

static Int

The TextView scales text size both horizontally and vertically to fit within the container.

Public methods
static Int
getAutoSizeMaxTextSize(@NonNull textView: TextView)

static Int
getAutoSizeMinTextSize(@NonNull textView: TextView)

static Int

static IntArray

static Int
getAutoSizeTextType(@NonNull textView: TextView)

Returns the type of auto-size set for this widget.

static ColorStateList?

Return the tint applied to any compound drawables.

static Mode?

Return the tint mode applied to any compound drawables.

static Array<Drawable!>

Returns drawables for the start, top, end, and bottom borders from the given text view.

static Int

Returns the distance between the first text baseline and the top of this TextView.

static Int

Returns the distance between the last text baseline and the bottom of this TextView.

static Int
getMaxLines(@NonNull textView: TextView)

Returns the maximum number of lines displayed in the given TextView, or -1 if the maximum height was set in pixels instead.

static Int
getMinLines(@NonNull textView: TextView)

Returns the minimum number of lines displayed in the given TextView, or -1 if the minimum height was set in pixels instead.

static PrecomputedTextCompat.Params
getTextMetricsParams(@NonNull textView: TextView)

Gets the parameters for text layout precomputation, for use with PrecomputedTextCompat.

static Unit
setAutoSizeTextTypeUniformWithConfiguration(@NonNull textView: TextView, autoSizeMinTextSize: Int, autoSizeMaxTextSize: Int, autoSizeStepGranularity: Int, unit: Int)

Specify whether this widget should automatically scale the text to try to perfectly fit within the layout bounds.

static Unit
setAutoSizeTextTypeUniformWithPresetSizes(@NonNull textView: TextView, @NonNull presetSizes: IntArray, unit: Int)

Specify whether this widget should automatically scale the text to try to perfectly fit within the layout bounds.

static Unit
setAutoSizeTextTypeWithDefaults(@NonNull textView: TextView, autoSizeTextType: Int)

Specify whether this widget should automatically scale the text to try to perfectly fit within the layout bounds by using the default auto-size configuration.

static Unit
setCompoundDrawableTintList(@NonNull textView: TextView, @Nullable tint: ColorStateList?)

Applies a tint to any compound drawables.

static Unit
setCompoundDrawableTintMode(@NonNull textView: TextView, @Nullable tintMode: Mode?)

Applies a tint mode to any compound drawables.

static Unit