Static Layout Builder Compat
Class to create StaticLayout using StaticLayout.Builder on API23+ and a hidden StaticLayout constructor before that.
Usage:
StaticLayout staticLayout =
StaticLayoutBuilderCompat.obtain("Lorem Ipsum", new TextPaint(), 100)
.setAlignment(Alignment.ALIGN_NORMAL)
.build();
Content copied to clipboard
Types
Functions
Link copied to clipboard
Link copied to clipboard
open fun obtain(@NonNull source: CharSequence, @NonNull paint: TextPaint, @IntRange(from = 0 ) width: Int): StaticLayoutBuilderCompat
Obtain a builder for constructing StaticLayout objects.
Link copied to clipboard
@CanIgnoreReturnValue
Set the alignment.
Link copied to clipboard
@CanIgnoreReturnValue
Set ellipsizing on the layout.
Link copied to clipboard
@CanIgnoreReturnValue
Set the hyphenation frequency.
Link copied to clipboard
Set whether to include extra space beyond font ascent and descent (which is needed to avoid clipping in some languages, such as Arabic and Kannada).
Link copied to clipboard
Link copied to clipboard
@CanIgnoreReturnValue
Set the line spacing addition and multiplier frequency.
Link copied to clipboard
@CanIgnoreReturnValue
Set maximum number of lines.
Link copied to clipboard
@CanIgnoreReturnValue
Set the StaticLayoutBuilderConfigurer which allows additional custom configurations on the static layout.