BaseViewHolder

public class BaseViewHolder

ViewHolder describes an item view and its position information within the RecyclerView.

Author

shaunak

Since

2023-08-15

Constructors

Link copied to clipboard
public void BaseViewHolder(Context context, View itemView)
Constructor

Functions

Link copied to clipboard
public static BaseViewHolder createViewHolder(Context context, View itemView)
public static BaseViewHolder createViewHolder(Context context, ViewGroup parent, int layoutId)
Creates a BaseViewHolder
Link copied to clipboard
public Context getContext()
Get the current context
Link copied to clipboard
public View getItemView()
Use itemView instead
Link copied to clipboard
public T getView<T extends View>(int viewId)
Get the control by ViewId
Link copied to clipboard
public BaseViewHolder linkify(int viewId)
Adds a link to the TextView.
Link copied to clipboard
public BaseViewHolder setBackgroundColor(int viewId, int color)
Sets the background color of the view.
Link copied to clipboard
public BaseViewHolder setBackgroundDrawable(int viewId, Drawable drawable)
Sets the background of the view.
Link copied to clipboard
public BaseViewHolder setBackgroundRes(int viewId, int backgroundRes)
Sets the background of the view.
Link copied to clipboard
public BaseViewHolder setChecked(int viewId, boolean checked)
Sets the selected state of a selectable control.
Link copied to clipboard
public BaseViewHolder setHoldVisible(int viewId, boolean visible)
Sets the visibility of the view to VISIBLE (true) or INVISIBLE (false).
Link copied to clipboard
public BaseViewHolder setImageDrawable(int viewId, Drawable drawable)
Sets the image of the ImageView using a drawable.
Link copied to clipboard
public BaseViewHolder setImageResource(int viewId, int resId)
Sets the image of the ImageView using the resource ID.
Link copied to clipboard
public BaseViewHolder setMarginStart(int viewId, int start)
Sets the margins of the view.
Link copied to clipboard
public BaseViewHolder setMax(int viewId, int max)
Sets the range of the ProgressBar to 0...max.
Link copied to clipboard
public BaseViewHolder setOnClickListener(int viewId, OnClickListener listener)
Sets the click event for the view.
Link copied to clipboard
public BaseViewHolder setOnLongClickListener(int viewId, OnLongClickListener listener)
Sets the long-click event for the view.
Link copied to clipboard
public BaseViewHolder setOnTouchListener(int viewId, OnTouchListener listener)
Sets the touch event for the view.
Link copied to clipboard
public BaseViewHolder setPadding(int viewId, int left, int top, int right, int bottom)
Sets the padding of the view.
Link copied to clipboard
public BaseViewHolder setProgress(int viewId, int progress)
Sets the progress of the ProgressBar.
public BaseViewHolder setProgress(int viewId, int progress, int max)
Sets the progress and maximum value of the ProgressBar.
Link copied to clipboard
public BaseViewHolder setRating(int viewId, float rating)
Sets the rating of the RatingBar (number of filled stars).
public BaseViewHolder setRating(int viewId, float rating, int max)
Sets the rating and maximum value for the RatingBar.
Link copied to clipboard
public BaseViewHolder setSelected(int viewId, boolean selected)
Sets the selected state of the view.
Link copied to clipboard
public BaseViewHolder setTag(int viewId, Object tag)
public BaseViewHolder setTag(int viewId, int key, Object tag)
Sets the tag for the view.
Link copied to clipboard
public BaseViewHolder setText(int viewId, Spannable text)
public BaseViewHolder setText(int viewId, String text)
Sets the text of the TextView.
Link copied to clipboard
public BaseViewHolder setTextColor(int viewId, int textColor)
Sets the text color of the TextView.
Link copied to clipboard
public BaseViewHolder setTypeface(Typeface typeface, Array<int> viewIds)
Apply the font to the specified viewId and enable subpixel rendering.
Link copied to clipboard
public BaseViewHolder setVisible(int viewId, boolean visible)
Sets the visibility of the view to VISIBLE (true) or GONE (false).