public class BadgeItem extends Object
| 构造器和说明 |
|---|
BadgeItem() |
| 限定符和类型 | 方法和说明 |
|---|---|
protected int |
getBackgroundColor(android.content.Context context) |
protected int |
getBorderColor(android.content.Context context) |
protected int |
getBorderWidth() |
protected int |
getGravity() |
int |
getOvalRadius() |
protected CharSequence |
getText() |
protected int |
getTextColor(android.content.Context context) |
protected WeakReference<android.widget.TextView> |
getTextView() |
BadgeItem |
hide() |
BadgeItem |
hide(boolean animate) |
BadgeItem |
hideBadgeItemPoint()
hide point
|
boolean |
isHidden() |
protected boolean |
isHideOnSelect() |
BadgeItem |
setAnimationDuration(int animationDuration) |
BadgeItem |
setBackgroundColor(int color) |
BadgeItem |
setBackgroundColor(String colorCode) |
BadgeItem |
setBackgroundColorResource(int colorResource) |
BadgeItem |
setBackgroundResource() |
BadgeItem |
setBorderColor(int color) |
BadgeItem |
setBorderColor(String colorCode) |
BadgeItem |
setBorderColorResource(int colorResource) |
BadgeItem |
setBorderWidth(int borderWidth) |
BadgeItem |
setGravity(int gravity) |
BadgeItem |
setHideOnSelect(boolean hideOnSelect) |
void |
setOvalRadius(int ovalRadius)
设置圆径
|
BadgeItem |
setText(CharSequence text) |
BadgeItem |
setTextColor(int color) |
BadgeItem |
setTextColor(String colorCode) |
BadgeItem |
setTextColorResource(int colorResource) |
protected BadgeItem |
setTextView(android.widget.TextView mTextView)
Internal method used to update view when ever changes are made
|
BadgeItem |
show() |
BadgeItem |
show(boolean animate) |
BadgeItem |
showBadgeItemPoint()
show point
|
BadgeItem |
toggle() |
BadgeItem |
toggle(boolean animate) |
public BadgeItem setBackgroundColorResource(@ColorRes int colorResource)
colorResource - resource for background colorpublic BadgeItem setBackgroundColor(@Nullable String colorCode)
colorCode - color code for background colorpublic BadgeItem setBackgroundColor(int color)
color - background colorpublic BadgeItem setBackgroundResource()
public BadgeItem setTextColorResource(@ColorRes int colorResource)
colorResource - resource for text colorpublic BadgeItem setTextColor(@Nullable String colorCode)
colorCode - color code for text colorpublic BadgeItem setTextColor(int color)
color - text colorpublic BadgeItem setText(@Nullable CharSequence text)
text - text to be set in badge (this shouldn't be empty text)public BadgeItem setBorderColorResource(@ColorRes int colorResource)
colorResource - resource for border colorpublic BadgeItem setBorderColor(@Nullable String colorCode)
colorCode - color code for border colorpublic BadgeItem setBorderColor(int color)
color - border colorpublic BadgeItem setBorderWidth(int borderWidth)
borderWidth - border width in pixelspublic BadgeItem setGravity(int gravity)
gravity - gravity of badge (TOP|LEFT ..etc)public BadgeItem setHideOnSelect(boolean hideOnSelect)
hideOnSelect - if true hides badge on tab selectionpublic BadgeItem setAnimationDuration(int animationDuration)
animationDuration - hide and show animation timepublic BadgeItem showBadgeItemPoint()
public BadgeItem hideBadgeItemPoint()
protected BadgeItem setTextView(android.widget.TextView mTextView)
mTextView - badge textViewprotected int getBackgroundColor(android.content.Context context)
context - to fetch colorprotected int getTextColor(android.content.Context context)
context - to fetch colorprotected CharSequence getText()
protected int getBorderColor(android.content.Context context)
context - to fetch colorprotected int getBorderWidth()
protected int getGravity()
protected boolean isHideOnSelect()
protected WeakReference<android.widget.TextView> getTextView()
public BadgeItem toggle()
public BadgeItem toggle(boolean animate)
animate - whether to animate the changepublic void setOvalRadius(int ovalRadius)
ovalRadius - public int getOvalRadius()
public BadgeItem show()
public BadgeItem show(boolean animate)
animate - whether to animate the changepublic BadgeItem hide()
public BadgeItem hide(boolean animate)
animate - whether to animate the changepublic boolean isHidden()