If you need to change Specific Item Color On RecyclerView
.... Then You Need To Follow The Code:
Main File Here Click Here To Go
and just you need to change
override fun onBindViewHolder(holder: ViewHolder, position: Int) {
holder.textTitle.text = itemTitle [position]
holder.textDes.text = itemDetails [position]
if (position == 0) {
//GradientDrawable.Orientation.BOTTOM_TOP
holder.itemView.setBackgroundColor(getColor(getContext(), R.color.colorAccent));
/** jodi apni parse color use korte chan .. tahole obosssoi .. eta bebohar korte paren .
holder.itemView.setBackgroundColor(Color.parseColor("#ED0101")) */
//View.setBackgroundColor(Color.parseColor("#e7eecc"));
/*COLOR2 = Color.parseColor("#FF"+getColor());
PorterDuff.Mode mMode = Mode.SRC_ATOP;
Drawable d = mCtx.getResources().getDrawable(R.drawable.background);
d.setColorFilter(COLOR2,mMode)*/
}
0 Comments