/**
-
use itemView instead
-
@return the ViewHolder root view
*/
@Deprecated
public View getConvertView() {
return convertView;
}
/**
-
Will set the text of a TextView.
-
@param viewId The view id.
-
@param value The text to put in the text view.
-
@return The BaseViewHolder for chaining.
*/
public BaseDelegateViewHolder setText(@IdRes int viewId, CharSequence value) {
TextView view = getView(viewId);
view.setText(value);
return this;
}
public BaseDelegateViewHolder setText(@IdRes int viewId, @StringRes int strId) {
TextView view = getView(viewId);
view.setText(strId);
return this;
}
/**
-
Will set the image of an ImageView from a resource id.
-
@param viewId The view id.
-
@param imageResId The image resource id.
-
@return The BaseViewHolder for chaining.
*/
public BaseDelegateViewHolder setImageResource(@IdRes int viewId, @DrawableRes int imageResId) {
ImageView view = getView(viewId);
view.setImageResource(imageResId);
return this;
}
/**
-
Will set background color of a view.
-
@param viewId The view id.
-
@param color A color, not a resource id.
-
@return The BaseViewHolder for chaining.
*/
public BaseDelegateViewHolder setBackgroundColor(@IdRes int viewId, @ColorInt int color) {
View view = getView(viewId);
view.setBackgroundColor(color);
return this;
}
/**
-
Will set background of a view.
-
@param viewId The view id.
-
@param backgroundRes A resource to use as a background.
-
@return The BaseViewHolder for chaining.
*/
public BaseDelegateViewHolder setBackgroundRes(@IdRes int viewId, @DrawableRes int backgroundRes) {
View view = getView(viewId);
view.setBackgroundResource(backgroundRes);
return this;
}
/**
-
Will set text color of a TextView.
-
@param viewId The view id.
-
@param textColor The text color (not a resource id).
-
@return The BaseViewHolder for chaining.
*/
public BaseDe