Answer the question
In order to leave comments, you need to log in
How to make the ripple effect work in RecyclerView?
Tell me how to make the ripple effect work in RecyclerView?
When setting the listener setOnClickListener to the ViewHolder , the effect stops working and is it correct to set the listener in general this way?
class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
TextView text;
ViewHolder(View itemView) {
super(itemView);
text= itemView.findViewById(R.id.text);
text.setOnClickListener(this);
}
public void onClick(View v) {
}
}
android:foreground="?android:attr/selectableItemBackground"
android:clickable="true"
Answer the question
In order to leave comments, you need to log in
android:background="?android:attr/selectableItemBackground"
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question