public class XRoundDrawable
extends android.graphics.drawable.GradientDrawable
Drawable
setBgData(ColorStateList) 设置背景色setStrokeData(int, ColorStateList) 设置描边大小、描边颜色setIsRadiusAdjustBounds(boolean) 设置圆角大小是否自动适应为 View 的高度一半,默认为 trueTextView 控件及其子类有效,ViewGroup 无效| 构造器和说明 |
|---|
XRoundDrawable() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
fromAttributeSet(android.content.res.ColorStateList colorBg,
android.content.res.ColorStateList colorBorder,
int borderWidth,
int mRadiusTopLeft,
int mRadiusTopRight,
int mRadiusBottomLeft,
int mRadiusBottomRight,
boolean isRadiusAdjustBounds,
int mRadius) |
boolean |
isStateful() |
protected void |
onBoundsChange(android.graphics.Rect r) |
protected boolean |
onStateChange(int[] stateSet) |
void |
setBgData(android.content.res.ColorStateList colors)
设置按钮的背景色(只支持纯色,不支持 Bitmap 或 Drawable)
不支持按压效果
|
void |
setIsRadiusAdjustBounds(boolean isRadiusAdjustBounds)
设置圆角大小是否自动适应为 View 高度的一半
|
void |
setStrokeData(int width,
android.content.res.ColorStateList colors)
设置按钮的描边粗细和颜色
|
applyTheme, canApplyTheme, draw, getAlpha, getChangingConfigurations, getColor, getColorFilter, getColors, getConstantState, getCornerRadii, getCornerRadius, getGradientCenterX, getGradientCenterY, getGradientRadius, getGradientType, getIntrinsicHeight, getIntrinsicWidth, getOpacity, getOrientation, getOutline, getPadding, getShape, getUseLevel, inflate, mutate, onLevelChange, setAlpha, setColor, setColor, setColorFilter, setColors, setCornerRadii, setCornerRadius, setDither, setGradientCenter, setGradientRadius, setGradientType, setOrientation, setShape, setSize, setStroke, setStroke, setStroke, setStroke, setTintList, setTintMode, setUseLevelclearColorFilter, copyBounds, copyBounds, createFromPath, createFromResourceStream, createFromResourceStream, createFromStream, createFromXml, createFromXml, createFromXmlInner, createFromXmlInner, getBounds, getCallback, getCurrent, getDirtyBounds, getHotspotBounds, getLayoutDirection, getLevel, getMinimumHeight, getMinimumWidth, getState, getTransparentRegion, inflate, invalidateSelf, isAutoMirrored, isFilterBitmap, isVisible, jumpToCurrentState, onLayoutDirectionChanged, resolveOpacity, scheduleSelf, setAutoMirrored, setBounds, setBounds, setCallback, setChangingConfigurations, setColorFilter, setFilterBitmap, setHotspot, setHotspotBounds, setLayoutDirection, setLevel, setState, setTint, setVisible, unscheduleSelfpublic void setBgData(android.content.res.ColorStateList colors)
public void setStrokeData(int width,
android.content.res.ColorStateList colors)
public void setIsRadiusAdjustBounds(boolean isRadiusAdjustBounds)
protected boolean onStateChange(int[] stateSet)
onStateChange 在类中 android.graphics.drawable.GradientDrawablepublic boolean isStateful()
isStateful 在类中 android.graphics.drawable.GradientDrawableprotected void onBoundsChange(android.graphics.Rect r)
onBoundsChange 在类中 android.graphics.drawable.GradientDrawablepublic void fromAttributeSet(android.content.res.ColorStateList colorBg,
android.content.res.ColorStateList colorBorder,
int borderWidth,
int mRadiusTopLeft,
int mRadiusTopRight,
int mRadiusBottomLeft,
int mRadiusBottomRight,
boolean isRadiusAdjustBounds,
int mRadius)