TextAppearanceInfo.Builder


public static final class TextAppearanceInfo.Builder
extends Object

java.lang.Object
   ↳ android.view.inputmethod.TextAppearanceInfo.Builder


Builder for TextAppearanceInfo.

Summary

Public constructors

Builder()

Public methods

TextAppearanceInfo build()

Returns TextAppearanceInfo using parameters in this TextAppearanceInfo.Builder.

TextAppearanceInfo.Builder setAllCaps(boolean allCaps)

Set whether the transformation method applied to the current editor is set to all caps.

TextAppearanceInfo.Builder setElegantTextHeight(boolean elegantTextHeight)

Set the elegant height metrics flag.

TextAppearanceInfo.Builder setFallbackLineSpacing(boolean fallbackLineSpacing)

Set whether to expand linespacing based on fallback fonts.

TextAppearanceInfo.Builder setFontFeatureSettings(String fontFeatureSettings)

Set the font feature settings.

TextAppearanceInfo.Builder setFontVariationSettings(String fontVariationSettings)

Set the font variation settings.

TextAppearanceInfo.Builder setHighlightTextColor(int highlightTextColor)

Set the color of the text selection highlight.

TextAppearanceInfo.Builder setHintTextColor(int hintTextColor)

Set the current color of the hint text.

TextAppearanceInfo.Builder setLetterSpacing(float letterSpacing)

Set the text letter-spacing, which determines the spacing between characters.

TextAppearanceInfo.Builder setLineBreakStyle(int lineBreakStyle)

Set the line-break strategies for text wrapping.

TextAppearanceInfo.Builder setLineBreakWordStyle(int lineBreakWordStyle)

Set the line-break word strategies for text wrapping.

TextAppearanceInfo.Builder setLinkTextColor(int linkTextColor)

Set the text color used to paint the links in the editor.

TextAppearanceInfo.Builder setShadowColor(int shadowColor)

Set the color of the text shadow.

TextAppearanceInfo.Builder setShadowDx(float shadowDx)

Set the horizontal offset (in pixels) of the text shadow.

TextAppearanceInfo.Builder setShadowDy(float shadowDy)

Set the vertical offset (in pixels) of the text shadow.

TextAppearanceInfo.Builder setShadowRadius(float shadowRadius)

Set the blur radius (in pixels) of the text shadow.

TextAppearanceInfo.Builder setSystemFontFamilyName(String systemFontFamilyName)

Set the system font family name if the Typeface of the text is created from a system font family.

TextAppearanceInfo.Builder setTextColor(int textColor)

Set the current text color of the editor.

TextAppearanceInfo.Builder setTextFontWeight(int textFontWeight)

Set the weight of the text.

TextAppearanceInfo.Builder setTextLocales(LocaleList textLocales)

Set the LocaleList of the text.

TextAppearanceInfo.Builder setTextScaleX(float textScaleX)

Set the extent by which text should be stretched horizontally.

TextAppearanceInfo.Builder setTextSize(float textSize)

Set the text size (in pixels) obtained from the current editor.

TextAppearanceInfo.Builder setTextStyle(int textStyle)

Set the style (normal, bold, italic, bold|italic) of the text.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

Added in API level 34
public TextAppearanceInfo build ()

Returns TextAppearanceInfo using parameters in this TextAppearanceInfo.Builder.

Returns
TextAppearanceInfo This value cannot be null.

setAllCaps

Added in API level 34
public TextAppearanceInfo.Builder setAllCaps (boolean allCaps)

Set whether the transformation method applied to the current editor is set to all caps.

Parameters
allCaps boolean

Returns
TextAppearanceInfo.Builder This value cannot be null.

setElegantTextHeight

Added in API level 34
public TextAppearanceInfo.Builder setElegantTextHeight (boolean elegantTextHeight)

Set the elegant height metrics flag. This setting selects font variants that have not been compacted to fit Latin-based vertical metrics, and also increases top and bottom bounds to provide more space.

Parameters
elegantTextHeight boolean

Returns
TextAppearanceInfo.Builder This value cannot be null.

setFallbackLineSpacing

Added in API level 34
public TextAppearanceInfo.Builder setFallbackLineSpacing (boolean fallbackLineSpacing)

Set whether to expand linespacing based on fallback fonts.

Parameters
fallbackLineSpacing boolean

Returns
TextAppearanceInfo.Builder This value cannot be null.

setFontFeatureSettings

Added in API level 34
public TextAppearanceInfo.Builder setFontFeatureSettings (String fontFeatureSettings)

Set the font feature settings.

Parameters
fontFeatureSettings String: This value may be null.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setFontVariationSettings

Added in API level 34
public TextAppearanceInfo.Builder setFontVariationSettings (String fontVariationSettings)

Set the font variation settings. Set null if no variation is specified.

Parameters
fontVariationSettings String: This value may be null.

Returns
TextAppearanceInfo.Builder

setHighlightTextColor

Added in API level 34
public TextAppearanceInfo.Builder setHighlightTextColor (int highlightTextColor)

Set the color of the text selection highlight.

Parameters
highlightTextColor int

Returns
TextAppearanceInfo.Builder This value cannot be null.

setHintTextColor

Added in API level 34
public TextAppearanceInfo.Builder setHintTextColor (int hintTextColor)

Set the current color of the hint text.

Parameters
hintTextColor int

Returns
TextAppearanceInfo.Builder This value cannot be null.

setLetterSpacing

Added in API level 34
public TextAppearanceInfo.Builder setLetterSpacing (float letterSpacing)

Set the text letter-spacing, which determines the spacing between characters. The value is in 'EM' units. Normally, this value is 0.0.

Parameters
letterSpacing float

Returns
TextAppearanceInfo.Builder This value cannot be null.

setLineBreakWordStyle

Added in API level 34
public TextAppearanceInfo.Builder setLineBreakWordStyle (int lineBreakWordStyle)

Set the line-break word strategies for text wrapping.

Parameters
lineBreakWordStyle int: Value is LineBreakConfig.LINE_BREAK_WORD_STYLE_NONE, LineBreakConfig.LINE_BREAK_WORD_STYLE_PHRASE, LineBreakConfig.LINE_BREAK_WORD_STYLE_UNSPECIFIED, or LineBreakConfig.LINE_BREAK_WORD_STYLE_AUTO

Returns
TextAppearanceInfo.Builder This value cannot be null.

setLinkTextColor

Added in API level 34
public TextAppearanceInfo.Builder setLinkTextColor (int linkTextColor)

Set the text color used to paint the links in the editor.

Parameters
linkTextColor int

Returns
TextAppearanceInfo.Builder This value cannot be null.

setShadowColor

Added in API level 34
public TextAppearanceInfo.Builder setShadowColor (int shadowColor)

Set the color of the text shadow.

Parameters
shadowColor int

Returns
TextAppearanceInfo.Builder This value cannot be null.

setShadowDx

Added in API level 34
public TextAppearanceInfo.Builder setShadowDx (float shadowDx)

Set the horizontal offset (in pixels) of the text shadow.

Parameters
shadowDx float: This units of this value are pixels.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setShadowDy

Added in API level 34
public TextAppearanceInfo.Builder setShadowDy (float shadowDy)

Set the vertical offset (in pixels) of the text shadow.

Parameters
shadowDy float: This units of this value are pixels.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setShadowRadius

Added in API level 34
public TextAppearanceInfo.Builder setShadowRadius (float shadowRadius)

Set the blur radius (in pixels) of the text shadow.

Parameters
shadowRadius float: This units of this value are pixels.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setSystemFontFamilyName

Added in API level 34
public TextAppearanceInfo.Builder setSystemFontFamilyName (String systemFontFamilyName)

Set the system font family name if the Typeface of the text is created from a system font family.

Parameters
systemFontFamilyName String: This value may be null.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextColor

Added in API level 34
public TextAppearanceInfo.Builder setTextColor (int textColor)

Set the current text color of the editor.

Parameters
textColor int

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextFontWeight

Added in API level 34
public TextAppearanceInfo.Builder setTextFontWeight (int textFontWeight)

Set the weight of the text.

Parameters
textFontWeight int: Value is between FontStyle.FONT_WEIGHT_UNSPECIFIED and FontStyle.FONT_WEIGHT_MAX inclusive

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextLocales

Added in API level 34
public TextAppearanceInfo.Builder setTextLocales (LocaleList textLocales)

Set the LocaleList of the text.

Parameters
textLocales LocaleList: This value cannot be null.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextScaleX

Added in API level 34
public TextAppearanceInfo.Builder setTextScaleX (float textScaleX)

Set the extent by which text should be stretched horizontally.

Parameters
textScaleX float

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextSize

Added in API level 34
public TextAppearanceInfo.Builder setTextSize (float textSize)

Set the text size (in pixels) obtained from the current editor.

Parameters
textSize float: This units of this value are pixels.

Returns
TextAppearanceInfo.Builder This value cannot be null.

setTextStyle

Added in API level 34
public TextAppearanceInfo.Builder setTextStyle (int textStyle)

Set the style (normal, bold, italic, bold|italic) of the text.

Parameters
textStyle int: Value is Typeface.NORMAL, Typeface.BOLD, Typeface.ITALIC, or Typeface.BOLD_ITALIC

Returns
TextAppearanceInfo.Builder This value cannot be null.

See also: