public class Ui extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static String |
androidStyleNameSpace |
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 ColorStateList |
createColorStateList(int normal,
int unable) |
static ColorStateList |
createColorStateList(int normal,
int pressed,
int unable) |
static StateListDrawable |
createStateListDrawable(Drawable[] drawable)
=============================================================================================
Init State List Drawable and Color
=============================================================================================
|
static float |
dipToPx(Context context,
float dp)
Change Dip to PX
|
static float |
dipToPx(Resources resources,
float dp)
Change Dip to PX
|
static Drawable |
getActionBarDrawable(Activity activity,
int theme,
boolean dark)
Returns a suitable drawable for ActionBar with theme colors.
|
static Drawable |
getActionBarDrawable(Activity activity,
int theme,
boolean dark,
float borderBottom)
Returns a suitable drawable for ActionBar with theme colors.
|
static int |
getActionMasked(MotionEvent event)
MotionEventCompat getActionMasked
|
static int |
getBackgroundColor(Context context,
AttributeSet attrs)
Get Background color if the attr is color value
|
static Typeface |
getFont(Context context,
String fontFile) |
static boolean |
isEnableAttr(Context context,
AttributeSet attrs)
Get the attribute have enabled value
|
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(Context context,
float sp)
Change SP to PX
|
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 Drawable getActionBarDrawable(Activity activity, int theme, boolean dark)
theme - selected themedark - boolean for choosing dark colors or primary colorspublic static Drawable getActionBarDrawable(Activity activity, int theme, boolean dark, float borderBottom)
theme - selected themedark - boolean for choosing dark colors or primary colorsborderBottom - bottom border widthpublic static float dipToPx(Context context, float dp)
context - Contextdp - Dippublic static float dipToPx(Resources resources, float dp)
resources - Resourcesdp - Dippublic static float spToPx(Context context, float sp)
context - Contextsp - SPpublic 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 isEnableAttr(Context context, AttributeSet attrs)
context - Contextattrs - AttributeSetpublic static int getBackgroundColor(Context context, AttributeSet attrs)
context - Contextattrs - AttributeSetpublic static int getActionMasked(MotionEvent event)
event - MotionEventpublic static StateListDrawable createStateListDrawable(Drawable[] drawable)
public static ColorStateList createColorStateList(int normal, int unable)
public static ColorStateList createColorStateList(int normal, int pressed, int unable)