public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
public ImageView img_FurnishIamge;
public FontTextView tv_FurnishText;
public ViewHolder(View itemView) {
super(itemView);
img_FurnishIamge=(ImageView)itemView.findViewById(R.id.img_furnishessImage);
tv_FurnishText=(FontTextView)itemView.findViewById(R.id.tv_furnishesText);
itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
int pos=getAdapterPosition();
switch (pos){
case 0:
Toast.makeText(v.getContext(), "00000", Toast.LENGTH_SHORT).show();
break;
case 1:
Toast.makeText(v.getContext(), "11111", Toast.LENGTH_SHORT).show();
break;
case 2:
Toast.makeText(v.getContext(), "22222", Toast.LENGTH_SHORT).show();
break;
case 3:
Toast.makeText(v.getContext(), "33333", Toast.LENGTH_SHORT).show();
break;
case 4:
Toast.makeText(v.getContext(), "44444", Toast.LENGTH_SHORT).show();
break;
case 5:
Toast.makeText(v.getContext(), "55555", Toast.LENGTH_SHORT).show();
break;
case 6:
Toast.makeText(v.getContext(), "66666", Toast.LENGTH_SHORT).show();
break;
}
}
}); //applying clickListner to the Item.
}
Asked
Active
Viewed 37 times
0

Faysal Ahmed
- 7,501
- 5
- 28
- 50

Ajit Singh
- 3
- 2
-
Have u check this https://stackoverflow.com/questions/1309629/how-to-change-colors-of-a-drawable-in-android – AskNilesh Sep 11 '18 at 05:49
1 Answers
0
You could change the color of a image in an ImageView like this
ColorFilter filter = new LightingColorFilter(Color.BLACK, Color.parseColor("yourcolorcode"));
imageView.setColorFilter(filter );

Yasiru Nayanajith
- 1,647
- 17
- 20