public final class DrawableUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static android.graphics.drawable.StateListDrawable |
getDrawable()
实体 得到随机色 状态选择器 默认10px
|
static android.graphics.drawable.StateListDrawable |
getDrawable(int cornerRadius)
实体 得到随机色 状态选择器
|
static android.graphics.drawable.StateListDrawable |
getDrawable(int cornerRadius,
int normalColor)
实体 按下的颜色加深
|
static android.graphics.drawable.StateListDrawable |
getDrawable(int cornerRadius,
int pressedColor,
int normalColor)
实体 状态选择器
|
static android.graphics.drawable.StateListDrawable |
getRandomColorDrawable()
实心 得到随机背景色并且带选择器, 并且可以设置圆角
|
static android.graphics.drawable.StateListDrawable |
getRandomColorDrawable(int cornerRadius)
实心 得到 随机背景色并且带选择器, 并且可以设置圆角
|
static android.graphics.drawable.GradientDrawable |
getSolidRectDrawable(int cornerRadius,
int solidColor)
得到实心的drawable, 一般作为选中,点中的效果
|
static android.graphics.drawable.StateListDrawable |
getSolidStrokeDrawable(int cornerRadiusPX,
int strokeWidthPX,
int subColor,
int mainColor)
得到 正常空心, 按下实体的状态选择器
|
static android.graphics.drawable.StateListDrawable |
getStateListDrawable(android.graphics.drawable.Drawable pressedDrawable,
android.graphics.drawable.Drawable normalDrawable)
背景选择器
|
static android.graphics.drawable.StateListDrawable |
getStrokeRandomColorDrawable()
空心,按下实心 得到随机背景色并且带选择器, 并且可以设置圆角
|
static android.graphics.drawable.GradientDrawable |
getStrokeRectDrawable(int cornerRadius,
int solidColor,
int strokeColor,
int strokeWidth)
得到空心的效果,一般作为默认的效果
|
static android.graphics.drawable.StateListDrawable |
getStrokeSolidDrawable(int cornerRadiusPX,
int strokeWidthPX,
int subColor,
int mainColor)
得到 正常空心, 按下实体的状态选择器
|
static void |
setTextSolidTheme(android.widget.TextView textView)
默认实心 设置TextView 主题,随机颜色
|
static void |
setTextSolidTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius)
默认实心 设置TextView 主题,随机颜色
|
static void |
setTextSolidTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius,
int color)
默认实心 设置TextView 主题,
|
static void |
setTextStrokeTheme(android.widget.TextView textView)
默认空心 设置TextView 主题,随机颜色
|
static void |
setTextStrokeTheme(android.widget.TextView textView,
int color)
默认空心 设置TextView 主题,随机颜色
|
static void |
setTextStrokeTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius)
默认空心 设置TextView 主题,随机颜色
|
static void |
setTextStrokeTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius,
int color)
默认空心 设置TextView 主题,
|
public static android.graphics.drawable.GradientDrawable getSolidRectDrawable(int cornerRadius,
int solidColor)
cornerRadius - 圆角半径solidColor - 实心颜色public static android.graphics.drawable.GradientDrawable getStrokeRectDrawable(int cornerRadius,
int solidColor,
int strokeColor,
int strokeWidth)
cornerRadius - 圆角半径solidColor - 实心颜色strokeColor - 边框颜色strokeWidth - 边框宽度public static android.graphics.drawable.StateListDrawable getStateListDrawable(android.graphics.drawable.Drawable pressedDrawable,
android.graphics.drawable.Drawable normalDrawable)
pressedDrawable - 按下状态的DrawablenormalDrawable - 正常状态的Drawablepublic static android.graphics.drawable.StateListDrawable getDrawable(int cornerRadius,
int pressedColor,
int normalColor)
cornerRadius - 圆角半径pressedColor - 按下颜色normalColor - 正常的颜色public static android.graphics.drawable.StateListDrawable getStrokeSolidDrawable(int cornerRadiusPX,
int strokeWidthPX,
int subColor,
int mainColor)
cornerRadiusPX - 圆角半径strokeWidthPX - 边框宽度subColor - 表框颜色mainColor - 实心颜色public static android.graphics.drawable.StateListDrawable getSolidStrokeDrawable(int cornerRadiusPX,
int strokeWidthPX,
int subColor,
int mainColor)
cornerRadiusPX - 圆角半径strokeWidthPX - 边框宽度subColor - 表框颜色mainColor - 实心颜色public static android.graphics.drawable.StateListDrawable getDrawable(int cornerRadius,
int normalColor)
cornerRadius - 圆角半径normalColor - 正常的颜色public static android.graphics.drawable.StateListDrawable getDrawable(int cornerRadius)
cornerRadius - 圆角半径public static android.graphics.drawable.StateListDrawable getDrawable()
public static android.graphics.drawable.StateListDrawable getRandomColorDrawable(int cornerRadius)
cornerRadius - 圆角public static android.graphics.drawable.StateListDrawable getRandomColorDrawable()
public static android.graphics.drawable.StateListDrawable getStrokeRandomColorDrawable()
public static void setTextStrokeTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius,
int color)
textView - textViewstrokeWidth - 边框宽度 pxcornerRadius - 圆角color - 颜色public static void setTextStrokeTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius)
textView - textViewstrokeWidth - 边框宽度 pxcornerRadius - 圆角public static void setTextStrokeTheme(android.widget.TextView textView)
textView - textViewpublic static void setTextStrokeTheme(android.widget.TextView textView,
int color)
textView - 文本控件color - 颜色public static void setTextSolidTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius,
int color)
textView - textViewstrokeWidth - 边框宽度 pxcornerRadius - 圆角color - 颜色public static void setTextSolidTheme(android.widget.TextView textView,
int strokeWidth,
int cornerRadius)
textView - textViewstrokeWidth - 边框宽度 pxcornerRadius - 圆角public static void setTextSolidTheme(android.widget.TextView textView)
textView - textView