TextViewCompat

Helper for accessing features in TextView.

Types

Link copied to clipboard

Properties

Link copied to clipboard
The TextView does not auto-size text (default).
Link copied to clipboard
The TextView scales text size both horizontally and vertically to fit within the container.

Functions

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun getAutoSizeTextType(@NonNull textView: TextView): Int
Returns the type of auto-size set for this widget.
Link copied to clipboard
Returns drawables for the start, top, end, and bottom borders from the given text view.
Link copied to clipboard
Return the tint applied to any compound drawables.
Link copied to clipboard
Return the tint mode applied to any compound drawables.
Link copied to clipboard
Returns the distance between the first text baseline and the top of this TextView.
Link copied to clipboard
Returns the distance between the last text baseline and the bottom of this TextView.
Link copied to clipboard
open fun getMaxLines(@NonNull textView: TextView): Int
Returns the maximum number of lines displayed in the given TextView, or -1 if the maximum height was set in pixels instead.
Link copied to clipboard
open fun getMinLines(@NonNull textView: TextView): Int
Returns the minimum number of lines displayed in the given TextView, or -1 if the minimum height was set in pixels instead.
Link copied to clipboard
Gets the parameters for text layout precomputation, for use with PrecomputedTextCompat.
open fun 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.
open fun setAutoSizeTextTypeUniformWithPresetSizes(@NonNull textView: TextView, @NonNull presetSizes: Array<Int>, unit: Int)
Specify whether this widget should automatically scale the text to try to perfectly fit within the layout bounds.
Link copied to clipboard
open fun 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.
Link copied to clipboard
Sets the Drawables (if any) to appear to the start of, above, to the end of, and below the text.
Sets the Drawables (if any) to appear to the start of, above, to the end of, and below the text.
Link copied to clipboard
Applies a tint to any compound drawables.
Link copied to clipboard
Applies a tint mode to any compound drawables.
Link copied to clipboard
Sets a selection action mode callback on a TextView.
Link copied to clipboard
open fun setFirstBaselineToTopHeight(@NonNull textView: TextView, @Px @IntRange(from = 0) firstBaselineToTopHeight: Int)
Updates the top padding of the TextView so that firstBaselineToTopHeight is equal to the distance between the first text baseline and the top of this TextView.
Link copied to clipboard
open fun setLastBaselineToBottomHeight(@NonNull textView: TextView, @Px @IntRange(from = 0) lastBaselineToBottomHeight: Int)
Updates the bottom padding of the TextView so that lastBaselineToBottomHeight is equal to the distance between the last text baseline and the bottom of this TextView.
Link copied to clipboard
open fun setLineHeight(@NonNull textView: TextView, @Px @IntRange(from = 0) lineHeight: Int)
Sets an explicit line height for this TextView.
open fun setLineHeight(@NonNull textView: TextView, unit: Int, @FloatRange(from = 0) lineHeight: Float)
Sets an explicit line height to a given unit and value for the TextView.
Link copied to clipboard
open fun setPrecomputedText(@NonNull textView: TextView, @NonNull precomputed: PrecomputedTextCompat)
Sets the PrecomputedTextCompat to the TextView If the given PrecomputeTextCompat is not compatible with textView, throws an IllegalArgumentException.
Link copied to clipboard
open fun setTextAppearance(@NonNull textView: TextView, @StyleRes resId: Int)
Sets the text appearance from the specified style resource.
Link copied to clipboard
Apply the text layout parameter.