public class CommonViewHolder extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static CommonViewHolder |
get(android.content.Context context,
android.view.View convertView,
android.view.ViewGroup parent,
int layoutId,
int position)
获取ViewHolder
|
android.view.View |
getConvertView()
获取convertView
|
int |
getPosition()
获取当前条目的position
|
Object |
getTag(int viewId)
获取Tag 没有设置时为null
|
Object |
getTag(int viewId,
int key)
获取指定key的Tag 没有设置时为null
|
<T extends android.view.View> |
getView(int viewId)
通过viewId获取控件对象
|
int |
getVisibility(int viewId)
获取可见状态
|
CommonViewHolder |
setBackGround_View(int viewId,
android.graphics.drawable.Drawable background)
设置View背景drawable
|
CommonViewHolder |
setBackGround_View(int viewId,
int backgroundResId)
设置View背景drawable
|
CommonViewHolder |
setBackGroundColor_View(int viewId,
int color)
设置View背景颜色
|
CommonViewHolder |
setBackGroundDrawable_View(int viewId,
android.graphics.drawable.Drawable background)
已过时。
|
CommonViewHolder |
setBackGroundResource_View(int viewId,
int resid)
设置View背景资源
|
CommonViewHolder |
setChecked_CheckBox(int viewId,
boolean b)
设置CheckBox选中与否
|
CommonViewHolder |
setChecked_RadioButton(int viewId,
boolean b)
设置RadioButton选中与否
|
CommonViewHolder |
setClickable(int viewId,
boolean clickable)
设置是否可点击
|
CommonViewHolder |
setEnabled(int viewId,
boolean enabled)
设置是否可用
|
CommonViewHolder |
setImg_ImageView(int viewId,
android.graphics.Bitmap bm)
为ImageView设置资源-Bitmap
|
CommonViewHolder |
setImg_ImageView(int viewId,
android.graphics.drawable.Drawable drawable)
为ImageView设置资源-Drawable
|
CommonViewHolder |
setImg_ImageView(int viewId,
int resId)
为ImageView设置资源-ResourceId
|
CommonViewHolder |
setImg_ImageView(int viewId,
String url)
为ImageView设置资源-Url(网络路径)
|
CommonViewHolder |
setImg_ImageView(int viewId,
android.net.Uri uri)
为ImageView设置资源-Uri
|
CommonViewHolder |
setLongClickable(int viewId,
boolean clickable)
是否可长按
|
CommonViewHolder |
setOnclickListener(int viewId,
android.view.View.OnClickListener l)
设置View 点击事件
|
CommonViewHolder |
setOnclickListener(android.view.View v,
android.view.View.OnClickListener l)
设置View 点击事件
|
CommonViewHolder |
setOnLongclickListener(int viewId,
android.view.View.OnLongClickListener l)
设置View 长按事件
|
CommonViewHolder |
setOnLongclickListener(android.view.View v,
android.view.View.OnLongClickListener l)
设置View 长按事件
|
CommonViewHolder |
setRating_RatingBar(int viewId,
float rating)
设置评星(float)
|
CommonViewHolder |
setSize_RatingBar(int viewId,
int ratingbar_size)
设置评星数
|
CommonViewHolder |
setTag(int viewId,
int key,
Object tag)
设置指定key的Tag
|
CommonViewHolder |
setTag(int viewId,
Object tag)
设置Tag
|
CommonViewHolder |
setText(int viewId,
String content)
给TextView,EditText,Button设置内容
|
CommonViewHolder |
setTextColor(int viewId,
int colorId)
给TextView,EditText,Button设置字体颜色
|
CommonViewHolder |
setVisibility(int viewId,
int visibility)
设置可见状态
|
public static CommonViewHolder get(android.content.Context context, android.view.View convertView, android.view.ViewGroup parent, int layoutId, int position)
context - 上下文对象convertView - the convertViewparent - the ViewGrouplayoutId - the id of the layoutposition - the position of the itempublic <T extends android.view.View> T getView(int viewId)
viewId - 控件IDpublic android.view.View getConvertView()
public int getPosition()
public CommonViewHolder setTag(int viewId, Object tag)
viewId - tag - public CommonViewHolder setTag(int viewId, int key, Object tag)
viewId - key - tag - public Object getTag(int viewId)
viewId - public Object getTag(int viewId, int key)
viewId - key - public CommonViewHolder setVisibility(int viewId, int visibility)
viewId - visibility - View.VISIBLE,View.GONE,View.INVISIBLEpublic int getVisibility(int viewId)
viewId - View.VISIBLE,View.GONE,View.INVISIBLEpublic CommonViewHolder setClickable(int viewId, boolean clickable)
viewId - clickable - public CommonViewHolder setLongClickable(int viewId, boolean clickable)
viewId - clickable - public CommonViewHolder setEnabled(int viewId, boolean enabled)
viewId - enabled - public CommonViewHolder setText(int viewId, String content)
viewId - id of the TextViewcontent - the content to setpublic CommonViewHolder setTextColor(int viewId, int colorId)
viewId - id of the TextViewcolorId - the colorId to setpublic CommonViewHolder setImg_ImageView(int viewId, android.graphics.Bitmap bm)
viewId - id of the ImageViewbm - the Bitmap to setpublic CommonViewHolder setImg_ImageView(int viewId, android.graphics.drawable.Drawable drawable)
viewId - id of the ImageViewdrawable - the Drawable to setpublic CommonViewHolder setImg_ImageView(int viewId, int resId)
viewId - id of the ImageViewresId - the id of resource to setpublic CommonViewHolder setImg_ImageView(int viewId, android.net.Uri uri)
viewId - id of the ImageViewuri - the Uri to setpublic CommonViewHolder setImg_ImageView(int viewId, String url)
viewId - id of the ImageViewurl - the url of resource to setpublic CommonViewHolder setChecked_CheckBox(int viewId, boolean b)
viewId - the id of the CheckBoxb - is checkedpublic CommonViewHolder setChecked_RadioButton(int viewId, boolean b)
viewId - the id of the RadioButtonb - is checkedpublic CommonViewHolder setSize_RatingBar(int viewId, int ratingbar_size)
viewId - ratingbar_size - public CommonViewHolder setRating_RatingBar(int viewId, float rating)
viewId - rating - public CommonViewHolder setBackGround_View(int viewId, android.graphics.drawable.Drawable background)
viewId - background - Drawable资源public CommonViewHolder setBackGround_View(int viewId, int backgroundResId)
viewId - backgroundResId - 背景資源IDpublic CommonViewHolder setBackGroundColor_View(int viewId, int color)
viewId - color - 颜色值@Deprecated public CommonViewHolder setBackGroundDrawable_View(int viewId, android.graphics.drawable.Drawable background)
viewId - background - Drawable资源public CommonViewHolder setBackGroundResource_View(int viewId, int resid)
viewId - resid - 资源IDpublic CommonViewHolder setOnclickListener(int viewId, android.view.View.OnClickListener l)
viewId - the id of the viewl - the OnLongClickListener of viewpublic CommonViewHolder setOnclickListener(android.view.View v, android.view.View.OnClickListener l)
v - the view is clickedl - the OnLongClickListener of viewpublic CommonViewHolder setOnLongclickListener(int viewId, android.view.View.OnLongClickListener l)
viewId - the id of the viewl - the OnLongClickListener of viewpublic CommonViewHolder setOnLongclickListener(android.view.View v, android.view.View.OnLongClickListener l)
v - the view is clickedl - the OnLongClickListener of view