Package com.sendbird.uikit.model
Class TextUIConfig
- java.lang.Object
-
- com.sendbird.uikit.model.TextUIConfig
-
public class TextUIConfig extends java.lang.Object
A configurations of text. This provides a way of applyingTextAppearance
into this class's properties. A background color property is not applied automatically because background attributes is not a property ofTextAppearance
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TextUIConfig.Builder
-
Field Summary
Fields Modifier and Type Field Description static <any>
CREATOR
static int
UNDEFINED_RESOURCE_ID
-
Constructor Summary
Constructors Modifier Constructor Description protected
TextUIConfig(Parcel in)
Constructor
-
Method Summary
Modifier and Type Method Description TextUIConfig
apply(TextUIConfig config)
Apply values in the givenTextUIConfig
into this.SpannableString
apply(Context context, java.lang.String text)
Apply values into given whole text.void
bind(Context context, Spannable spannable, int start, int end)
Apply values into Spannable text.int
describeContents()
Typeface
generateTypeface()
Generates typeface from text style.int
getCustomFontRes()
Returns a custom font res ID.java.lang.String
getFamilyName()
Returns a value of text typeface family.int
getTextBackgroundColor()
Returns a value of background color int.int
getTextColor()
Returns a value of text color int.int
getTextSize()
Returns a value of text size int.int
getTextStyle()
Returns a value ofandroid.graphics.Typeface
.void
mergeFromTextAppearance(Context context, int textAppearance)
Merge attributes into this instance's values by givenTextAppearance
.void
mergeFromTextAppearance(Context context, int textAppearance, int textBackgroundColor)
Merge attributes into this instance's values by givenTextAppearance
and background color.void
writeToParcel(Parcel dest, int flags)
-
-
-
Field Detail
-
UNDEFINED_RESOURCE_ID
public static final int UNDEFINED_RESOURCE_ID
- See Also:
- Constant Field Values
-
CREATOR
public static final <any> CREATOR
-
-
Method Detail
-
getTextBackgroundColor
@ColorInt public int getTextBackgroundColor()
Returns a value of background color int.- Returns:
- A background color int value.
- Since:
- 3.0.0
-
getTextColor
@ColorInt public int getTextColor()
Returns a value of text color int.- Returns:
- A text color int value.
- Since:
- 3.0.0
-
getTextStyle
public int getTextStyle()
Returns a value ofandroid.graphics.Typeface
.- Typeface.NORMAL
- Typeface.BOLD
- Typeface.ITALIC
- Typeface.BOLD_ITALIC
- Returns:
- A text style of text.
- Since:
- 3.0.0
-
getTextSize
public int getTextSize()
Returns a value of text size int.- Returns:
- A text size int value.
- Since:
- 3.1.1
-
getFamilyName
@Nullable public java.lang.String getFamilyName()
Returns a value of text typeface family.- Returns:
- A typeface family name value.
- Since:
- 3.1.1
-
getCustomFontRes
public int getCustomFontRes()
Returns a custom font res ID.- Returns:
- A custom font resource ID.
- Since:
- 3.2.1
-
apply
@NonNull public TextUIConfig apply(@NonNull TextUIConfig config)
Apply values in the givenTextUIConfig
into this.- Parameters:
config
- ATextUIConfig
to apply.- Returns:
- This TextUIConfig object that applied with given data.
- Since:
- 3.0.0
-
apply
@NonNull public SpannableString apply(@NonNull Context context, @NonNull java.lang.String text)
Apply values into given whole text.- Parameters:
text
- A text to apply.- Since:
- 3.2.1
-
bind
public void bind(@NonNull Context context, @NonNull Spannable spannable, int start, int end)
Apply values into Spannable text.- Parameters:
spannable
- A spannable text to apply.start
- A starting position to apply value.end
- An end position to apply value.- Since:
- 3.0.0
-
mergeFromTextAppearance
public void mergeFromTextAppearance(@NonNull Context context, @StyleRes int textAppearance)
Merge attributes into this instance's values by givenTextAppearance
.- Parameters:
context
- the UI context.textAppearance
- A TextAppearance to apply.- Since:
- 3.0.0
-
mergeFromTextAppearance
public void mergeFromTextAppearance(@NonNull Context context, @StyleRes int textAppearance, @ColorRes int textBackgroundColor)
Merge attributes into this instance's values by givenTextAppearance
and background color.- Parameters:
context
- the context of view.textAppearance
- A TextAppearance to apply.textBackgroundColor
- A background color to apply.- Since:
- 3.0.0
-
generateTypeface
@NonNull public Typeface generateTypeface()
Generates typeface from text style.- Returns:
- The typeface instance
- Since:
- 3.1.1
-
describeContents
public int describeContents()
-
writeToParcel
public void writeToParcel(@NonNull Parcel dest, int flags)
-
-