public class TextViewUtil
extends java.lang.Object
TextView
objects.Modifier and Type | Method and Description |
---|---|
static float |
getFontSize(android.widget.TextView textview)
Returns the font size for a
TextView . |
static java.lang.String |
getText(android.widget.TextView textview)
Returns the text for a
TextView . |
static boolean |
isEnabled(android.widget.TextView textview)
Returns the enabled state a
TextView . |
static void |
setAlignment(android.widget.TextView textview,
int alignment,
boolean centerVertically)
TextView alignment setter.
|
static void |
setBackgroundColor(android.widget.TextView textview,
int argb)
TextView background color setter. |
static void |
setEnabled(android.widget.TextView textview,
boolean enabled)
Enables a
TextView . |
static void |
setFontSize(android.widget.TextView textview,
float size)
Sets the font size for a
TextView . |
static void |
setFontTypeface(android.widget.TextView textview,
int typeface,
boolean bold,
boolean italic)
Sets the font typeface for a
TextView . |
static void |
setPadding(android.widget.TextView textview,
int padding)
Sets the padding for a
TextView . |
static void |
setText(android.widget.TextView textview,
java.lang.String text)
Sets the text for a
TextView . |
static void |
setTextColor(android.widget.TextView textview,
int argb)
Sets the text color for a
TextView . |
static void |
setTextColors(android.widget.TextView textview,
android.content.res.ColorStateList colorStateList) |
public static void setAlignment(android.widget.TextView textview, int alignment, boolean centerVertically)
alignment
- one of Component.ALIGNMENT_NORMAL
,
Component.ALIGNMENT_CENTER
or
Component.ALIGNMENT_OPPOSITE
centerVertically
- whether the text should be centered verticallypublic static void setBackgroundColor(android.widget.TextView textview, int argb)
TextView
background color setter. Generally, the caller will
not pass Component.COLOR_DEFAULT
, instead substituting in the
appropriate color.textview
- text view instanceargb
- background RGB color with alphapublic static boolean isEnabled(android.widget.TextView textview)
TextView
.textview
- text view instancetrue
for enabled, false
disabledpublic static void setEnabled(android.widget.TextView textview, boolean enabled)
TextView
.textview
- text view instanceenabled
- true
for enabled, false
disabledpublic static float getFontSize(android.widget.TextView textview)
TextView
.textview
- text view instancepublic static void setFontSize(android.widget.TextView textview, float size)
TextView
.textview
- text view instancesize
- font size in pixelpublic static void setFontTypeface(android.widget.TextView textview, int typeface, boolean bold, boolean italic)
TextView
.textview
- text view instancetypeface
- one of @link Component#TYPEFACE_DEFAULT},
Component.TYPEFACE_SERIF
,
Component.TYPEFACE_SANSSERIF
or
Component.TYPEFACE_MONOSPACE
bold
- true for bold, false for not bolditalic
- true for italic, false for not italicpublic static java.lang.String getText(android.widget.TextView textview)
TextView
.textview
- text view instancepublic static void setText(android.widget.TextView textview, java.lang.String text)
TextView
.textview
- text view instancetext
- new text to be shownpublic static void setPadding(android.widget.TextView textview, int padding)
TextView
.textview
- text view instancepadding
- left and right padding to be setpublic static void setTextColor(android.widget.TextView textview, int argb)
TextView
.textview
- text view instanceargb
- text RGB color with alphapublic static void setTextColors(android.widget.TextView textview, android.content.res.ColorStateList colorStateList)