public class RTextViewHelper extends RBaseHelper<TextView> implements ITextViewFeature
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
ICON_DIR_BOTTOM |
static int |
ICON_DIR_LEFT |
static int |
ICON_DIR_RIGHT |
static int |
ICON_DIR_TOP |
protected boolean |
mHasPressedTextColor
是否设置对应的属性
|
protected boolean |
mHasSelectedTextColor |
protected boolean |
mHasUnableTextColor |
protected int |
mPaddingBottom |
protected int |
mPaddingLeft |
protected int |
mPaddingRight |
protected int |
mPaddingTop |
protected int |
mTextColorNormal |
protected int |
mTextColorPressed |
protected int |
mTextColorSelected |
protected ColorStateList |
mTextColorStateList |
protected int |
mTextColorUnable |
protected int[][] |
states |
BG_TYPE_COLOR, BG_TYPE_COLOR_ARRAY, BG_TYPE_IMG, mClipHelper, mContext, mView| 构造器和说明 |
|---|
RTextViewHelper(Context context,
TextView view,
AttributeSet attrs) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
drawIconWithText()
ICON 和 文本 一起居中
备注:用于库内确定逻辑的调用,不建议开发者直接调用
|
int |
getIconDirection()
已过时。
|
int |
getIconHeight()
已过时。
|
int |
getIconHeightBottom() |
int |
getIconHeightLeft() |
int |
getIconHeightRight() |
int |
getIconHeightTop() |
Drawable |
getIconNormal()
已过时。
|
Drawable |
getIconNormalBottom() |
Drawable |
getIconNormalLeft() |
Drawable |
getIconNormalRight() |
Drawable |
getIconNormalTop() |
Drawable |
getIconPressed()
已过时。
|
Drawable |
getIconPressedBottom() |
Drawable |
getIconPressedLeft() |
Drawable |
getIconPressedRight() |
Drawable |
getIconPressedTop() |
Drawable |
getIconSelected()
已过时。
|
Drawable |
getIconSelectedBottom() |
Drawable |
getIconSelectedLeft() |
Drawable |
getIconSelectedRight() |
Drawable |
getIconSelectedTop() |
Drawable |
getIconUnable()
已过时。
|
Drawable |
getIconUnableBottom() |
Drawable |
getIconUnableLeft() |
Drawable |
getIconUnableRight() |
Drawable |
getIconUnableTop() |
int |
getIconWidth()
已过时。
|
int |
getIconWidthBottom() |
int |
getIconWidthLeft() |
int |
getIconWidthRight() |
int |
getIconWidthTop() |
int |
getTextColorNormal() |
int |
getTextColorPressed() |
int |
getTextColorSelected() |
int |
getTextColorUnable() |
java.lang.String |
getTypefacePath() |
protected void |
initPressedTextColor(boolean hasCheckedTextColor,
int textColorChecked)
初始化按下状态文本颜色
备注:当存在 Checked 状态并且没有设置 Pressed 时,Pressed = Checked 更符合常规UI
备注:使用子类 RCheckHelper 中的属性,提供方法入口
|
protected boolean |
isSingleDirection()
是否仅支持单一方向ICON
老版本仅支持单一方向icon,版本兼容判断逻辑
|
void |
onGlobalLayout() |
void |
onTouchEvent(MotionEvent event)
触摸事件逻辑
备注:用于库内确定逻辑的调用,不建议开发者直接调用
|
void |
setEnabled(boolean enabled)
设置是否启用
备注:用于库内确定逻辑的调用,不建议开发者直接调用
|
protected void |
setIcon(Drawable icon)
已过时。
|
protected void |
setIconBottom(Drawable icon) |
RTextViewHelper |
setIconDirection(int iconDirection)
已过时。
|
RTextViewHelper |
setIconHeight(int iconHeight)
已过时。
|
protected void |
setIconLeft(Drawable icon)
主要用于子类调用
备注:用于库内确定逻辑的调用,不建议开发者直接调用
备注:添加上下左右之后此处功能默认 drawableLeft
|
RTextViewHelper |
setIconNormal(Drawable icon)
已过时。
|
RTextViewHelper |
setIconNormalBottom(Drawable icon) |
RTextViewHelper |
setIconNormalLeft(Drawable icon)
*******新版本逻辑********
|
RTextViewHelper |
setIconNormalRight(Drawable icon) |
RTextViewHelper |
setIconNormalTop(Drawable icon) |
RTextViewHelper |
setIconPressed(Drawable icon)
已过时。
|
RTextViewHelper |
setIconPressedBottom(Drawable icon) |
RTextViewHelper |
setIconPressedLeft(Drawable icon) |
RTextViewHelper |
setIconPressedRight(Drawable icon) |
RTextViewHelper |
setIconPressedTop(Drawable icon) |
protected void |
setIconRight(Drawable icon) |
RTextViewHelper |
setIconSelected(Drawable icon)
已过时。
|
RTextViewHelper |
setIconSelectedBottom(Drawable icon) |
RTextViewHelper |
setIconSelectedLeft(Drawable icon) |
RTextViewHelper |
setIconSelectedRight(Drawable icon) |
RTextViewHelper |
setIconSelectedTop(Drawable icon) |
RTextViewHelper |
setIconSize(int iconWidth,
int iconHeight)
已过时。
|
RTextViewHelper |
setIconSizeBottom(int iconWidth,
int iconHeight) |
RTextViewHelper |
setIconSizeLeft(int iconWidth,
int iconHeight) |
RTextViewHelper |
setIconSizeRight(int iconWidth,
int iconHeight) |
RTextViewHelper |
setIconSizeTop(int iconWidth,
int iconHeight) |
protected void |
setIconTop(Drawable icon) |
RTextViewHelper |
setIconUnable(Drawable icon)
已过时。
|
RTextViewHelper |
setIconUnableBottom(Drawable icon) |
RTextViewHelper |
setIconUnableLeft(Drawable icon) |
RTextViewHelper |
setIconUnableRight(Drawable icon) |
RTextViewHelper |
setIconUnableTop(Drawable icon) |
RTextViewHelper |
setIconWidth(int iconWidth)
已过时。
|
void |
setSelected(boolean selected)
设置是否选中
备注:用于库内确定逻辑的调用,不建议开发者直接调用
|
protected void |
setTextColor() |
RTextViewHelper |
setTextColor(int normal,
int pressed,
int unable,
int selected) |
RTextViewHelper |
setTextColorNormal(int textColor)
text color
|
RTextViewHelper |
setTextColorPressed(int textColor) |
RTextViewHelper |
setTextColorSelected(int textColor) |
RTextViewHelper |
setTextColorUnable(int textColor) |
RTextViewHelper |
setTypeface(java.lang.String typefacePath)
Typeface
|
dispatchDraw, dp2px, getBackgroundColorChecked, getBackgroundColorCheckedArray, getBackgroundColorNormal, getBackgroundColorNormalArray, getBackgroundColorPressed, getBackgroundColorPressedArray, getBackgroundColorSelected, getBackgroundColorSelectedArray, getBackgroundColorUnable, getBackgroundColorUnableArray, getBackgroundDrawableChecked, getBackgroundDrawableNormal, getBackgroundDrawablePressed, getBackgroundDrawableSelected, getBackgroundDrawableUnable, getBorderColorChecked, getBorderColorNormal, getBorderColorPressed, getBorderColorSelected, getBorderColorUnable, getBorderDashGap, getBorderDashWidth, getBorderWidthChecked, getBorderWidthNormal, getBorderWidthPressed, getBorderWidthSelected, getBorderWidthUnable, getCornerRadius, getCornerRadiusBottomLeft, getCornerRadiusBottomRight, getCornerRadiusTopLeft, getCornerRadiusTopRight, getGradientCenterX, getGradientCenterY, getGradientRadius, getGradientType, getRippleColor, getRippleMaskDrawable, getShadowColor, getShadowDx, getShadowDy, getShadowRadius, isOutsideView, onLayout, setBackgroundColorChecked, setBackgroundColorCheckedArray, setBackgroundColorNormal, setBackgroundColorNormalArray, setBackgroundColorPressed, setBackgroundColorPressedArray, setBackgroundColorSelected, setBackgroundColorSelectedArray, setBackgroundColorUnable, setBackgroundColorUnableArray, setBackgroundDrawableChecked, setBackgroundDrawableNormal, setBackgroundDrawablePressed, setBackgroundDrawableSelected, setBackgroundDrawableUnable, setBorderColor, setBorderColorChecked, setBorderColorNormal, setBorderColorPressed, setBorderColorSelected, setBorderColorUnable, setBorderDash, setBorderDashGap, setBorderDashWidth, setBorderWidth, setBorderWidthChecked, setBorderWidthNormal, setBorderWidthPressed, setBorderWidthSelected, setBorderWidthUnable, setCornerRadius, setCornerRadius, setCornerRadiusBottomLeft, setCornerRadiusBottomRight, setCornerRadiusTopLeft, setCornerRadiusTopRight, setGradientCenterX, setGradientCenterY, setGradientOrientation, setGradientRadius, setGradientType, setRippleColor, setRippleMaskDrawable, setShadowColor, setShadowDx, setShadowDy, setShadowRadius, setStateBackgroundColor, setStateBackgroundColor, setStateBackgroundColorArray, setUseRipple, useRipple, useShadowpublic static final int ICON_DIR_LEFT
public static final int ICON_DIR_TOP
public static final int ICON_DIR_RIGHT
public static final int ICON_DIR_BOTTOM
protected int mTextColorNormal
protected int mTextColorPressed
protected int mTextColorUnable
protected int mTextColorSelected
protected ColorStateList mTextColorStateList
protected int[][] states
protected boolean mHasPressedTextColor
protected boolean mHasUnableTextColor
protected boolean mHasSelectedTextColor
protected int mPaddingLeft
protected int mPaddingRight
protected int mPaddingTop
protected int mPaddingBottom
public RTextViewHelper setTypeface(java.lang.String typefacePath)
public java.lang.String getTypefacePath()
@Deprecated public RTextViewHelper setIconNormal(Drawable icon)
@Deprecated public Drawable getIconNormal()
@Deprecated public RTextViewHelper setIconPressed(Drawable icon)
@Deprecated public Drawable getIconPressed()
@Deprecated public RTextViewHelper setIconUnable(Drawable icon)
@Deprecated public Drawable getIconUnable()
@Deprecated public RTextViewHelper setIconSelected(Drawable icon)
@Deprecated public Drawable getIconSelected()
@Deprecated public RTextViewHelper setIconSize(int iconWidth, int iconHeight)
@Deprecated public RTextViewHelper setIconWidth(int iconWidth)
@Deprecated public int getIconWidth()
@Deprecated public RTextViewHelper setIconHeight(int iconHeight)
@Deprecated public int getIconHeight()
@Deprecated public RTextViewHelper setIconDirection(int iconDirection)
@Deprecated public int getIconDirection()
public RTextViewHelper setIconNormalLeft(Drawable icon)
public RTextViewHelper setIconNormalRight(Drawable icon)
public RTextViewHelper setIconNormalTop(Drawable icon)
public RTextViewHelper setIconNormalBottom(Drawable icon)
public Drawable getIconNormalLeft()
public Drawable getIconNormalRight()
public Drawable getIconNormalTop()
public Drawable getIconNormalBottom()
public RTextViewHelper setIconPressedLeft(Drawable icon)
public RTextViewHelper setIconPressedRight(Drawable icon)
public RTextViewHelper setIconPressedTop(Drawable icon)
public RTextViewHelper setIconPressedBottom(Drawable icon)
public Drawable getIconPressedLeft()
public Drawable getIconPressedRight()
public Drawable getIconPressedTop()
public Drawable getIconPressedBottom()
public RTextViewHelper setIconUnableLeft(Drawable icon)
public RTextViewHelper setIconUnableRight(Drawable icon)
public RTextViewHelper setIconUnableTop(Drawable icon)
public RTextViewHelper setIconUnableBottom(Drawable icon)
public Drawable getIconUnableLeft()
public Drawable getIconUnableRight()
public Drawable getIconUnableTop()
public Drawable getIconUnableBottom()
public RTextViewHelper setIconSelectedLeft(Drawable icon)
public RTextViewHelper setIconSelectedRight(Drawable icon)
public RTextViewHelper setIconSelectedTop(Drawable icon)
public RTextViewHelper setIconSelectedBottom(Drawable icon)
public Drawable getIconSelectedLeft()
public Drawable getIconSelectedRight()
public Drawable getIconSelectedTop()
public Drawable getIconSelectedBottom()
public RTextViewHelper setIconSizeLeft(int iconWidth, int iconHeight)
public RTextViewHelper setIconSizeRight(int iconWidth, int iconHeight)
public RTextViewHelper setIconSizeTop(int iconWidth, int iconHeight)
public RTextViewHelper setIconSizeBottom(int iconWidth, int iconHeight)
public int getIconWidthLeft()
public int getIconHeightLeft()
public int getIconWidthRight()
public int getIconHeightRight()
public int getIconWidthTop()
public int getIconHeightTop()
public int getIconWidthBottom()
public int getIconHeightBottom()
@Deprecated protected void setIcon(Drawable icon)
protected void setIconLeft(Drawable icon)
protected void setIconRight(Drawable icon)
protected void setIconTop(Drawable icon)
protected void setIconBottom(Drawable icon)
public RTextViewHelper setTextColorNormal(int textColor)
public int getTextColorNormal()
public RTextViewHelper setTextColorPressed(int textColor)
public int getTextColorPressed()
public RTextViewHelper setTextColorUnable(int textColor)
public int getTextColorUnable()
public RTextViewHelper setTextColorSelected(int textColor)
public int getTextColorSelected()
public RTextViewHelper setTextColor(int normal, int pressed, int unable, int selected)
protected void setTextColor()
protected boolean isSingleDirection()
protected void initPressedTextColor(boolean hasCheckedTextColor,
int textColorChecked)
public void onGlobalLayout()
onGlobalLayout 在类中 RBaseHelper<TextView>public void setEnabled(boolean enabled)
setEnabled 在接口中 ITextViewFeaturepublic void setSelected(boolean selected)
setSelected 在接口中 ITextViewFeaturepublic void onTouchEvent(MotionEvent event)
onTouchEvent 在接口中 ITextViewFeaturepublic void drawIconWithText()
drawIconWithText 在接口中 ITextViewFeature