TextViewStyle.Builder
public final class TextViewStyle.Builder
Builder for the TextViewStyle.
Summary
Public constructors |
|---|
Builder() |
Public methods |
|
|---|---|
@NonNull TextViewStyle |
build()Returns a subclass of |
@NonNull TextViewStyle.Builder |
setTextColor(@ColorInt int textColor)Specifies the text color. |
@NonNull TextViewStyle.Builder |
setTextSize(float textSize)Specifies the text size, in sp. |
@NonNull TextViewStyle.Builder |
setTextSize(int unit, float size)Specifies the text size in the provided unit. |
@NonNull TextViewStyle.Builder |
setTypeface(@NonNull String fontFamily, int fontStyle)Specifies the text font family and style. |
Public methods
build
public @NonNull TextViewStyle build()
Returns a subclass of BundledStyle built by this builder.
setTextColor
public @NonNull TextViewStyle.Builder setTextColor(@ColorInt int textColor)
Specifies the text color.
| Parameters | |
|---|---|
@ColorInt int textColor |
A color value in the form 0xAARRGGBB. |
| See also | |
|---|---|
setTextColor |
setTextSize
public @NonNull TextViewStyle.Builder setTextSize(float textSize)
Specifies the text size, in sp.
| Parameters | |
|---|---|
float textSize |
The scaled pixel size. |
| See also | |
|---|---|
setTextSize |
setTextSize
public @NonNull TextViewStyle.Builder setTextSize(int unit, float size)
Specifies the text size in the provided unit.
| Parameters | |
|---|---|
int unit |
The desired dimension unit. |
float size |
The device independent pixel size. |
| See also | |
|---|---|
setTextSize |
setTypeface
public @NonNull TextViewStyle.Builder setTypeface(@NonNull String fontFamily, int fontStyle)
Specifies the text font family and style. If the font family can not be found/loaded from the renderer process, it may fallback to the default system font.
| Parameters | |
|---|---|
@NonNull String fontFamily |
the font family for the type face |
int fontStyle |
the style for the type face. |
| See also | |
|---|---|
create |
|
setTypeface |