public class Ui extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
FILL_SHADOW_COLOR |
static int |
KEY_SHADOW_COLOR |
static int |
SHADOW_ELEVATION |
static float |
SHADOW_RADIUS |
static boolean |
SUPPER_LOLLIPOP |
static int |
TOUCH_PRESS_COLOR |
static float |
X_OFFSET |
static float |
Y_OFFSET |
| 构造器和说明 |
|---|
Ui() |
| 限定符和类型 | 方法和说明 |
|---|---|
static int |
changeColorAlpha(int color,
int alpha)
Change the color to new alpha
|
static float |
dipToPx(Resources resources,
float dp)
Change Dip to PX
|
static int |
getBackgroundColor(Context context,
AttributeSet attrs)
Get Background color if the attr is color value
|
static int[] |
getColorsFromArrayRes(Resources resources,
int resId)
Get color array values form array resource
|
static Typeface |
getFont(Context context,
String fontFile) |
static boolean |
isHaveAttribute(AttributeSet attrs,
String attribute)
Check the AttributeSet values have a attribute String, on user set the attribute resource.
|
static boolean |
isTrueFromAttribute(AttributeSet attrs,
String attribute,
boolean defaultValue)
Get the attribute have enabled value
Form android styles namespace
|
static int |
modulateAlpha(int colorAlpha,
int alpha)
Modulate the colorAlpha to new alpha
|
static int |
modulateColorAlpha(int color,
int alpha)
Modulate the color to new alpha
|
static float |
spToPx(Resources resources,
float sp)
Change SP to PX
|
public static boolean SUPPER_LOLLIPOP
public static final int TOUCH_PRESS_COLOR
public static final int KEY_SHADOW_COLOR
public static final int FILL_SHADOW_COLOR
public static final float X_OFFSET
public static final float Y_OFFSET
public static final float SHADOW_RADIUS
public static final int SHADOW_ELEVATION
public static float dipToPx(Resources resources, float dp)
resources - Resourcesdp - Dippublic static float spToPx(Resources resources, float sp)
resources - Resourcessp - SPpublic static int modulateAlpha(int colorAlpha,
int alpha)
colorAlpha - Color's alphaalpha - Modulate alphapublic static int modulateColorAlpha(int color,
int alpha)
color - Coloralpha - Modulate alphapublic static int changeColorAlpha(int color,
int alpha)
color - Coloralpha - New alphapublic static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue)
attrs - AttributeSetattribute - The attribute to retrievedefaultValue - What to return if the attribute isn't foundpublic static int getBackgroundColor(Context context, AttributeSet attrs)
context - Contextattrs - AttributeSetpublic static int[] getColorsFromArrayRes(Resources resources, int resId)
resources - ResourcesresId - Resources idpublic static boolean isHaveAttribute(AttributeSet attrs, String attribute)
attrs - AttributeSetattribute - The attribute to retrieve