Open ghost opened 9 years ago
If you mean that the ripple isn't displayed on a click, I had the same problem. You can fix it by setting mrl_rippleOverlay to true, or removing the background on your child view.
hi add your OnClickListener to your MaterialRippleLayout =>
i describ in this link: http://stackoverflow.com/questions/28217096/no-touch-feedback-on-recyclerview-when-using-ripple-effect-library/33022891#33022891
ex: like this:
public class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener {
private MaterialRippleLayout mRipple;
private Rec_ItemClickListener rec_itemClickListener;
public TextView tvTitle;
public ViewHolder(View v) {
super(v);
tvTitle=(TextView)v.findViewById(R.id.cm_title_cat);
mRipple=(MaterialRippleLayout)v.findViewById(R.id.ripple_custom_cat);
v.setOnClickListener(this);
mRipple.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
Toast.makeText(ac, " clicked in mripple", Toast.LENGTH_LONG).show();
}
});
}
public void setClickListener(Rec_ItemClickListener clickListener){
this.rec_itemClickListener=clickListener;
}
@Override
public void onClick(View v) {
rec_itemClickListener.onClick(v,getAdapterPosition(),false);
}
}
Hello,
I have problem with mateerial-ripple. I used this layout in adapter. Adapter xml look like this:
OnClick on ImageButton in getView dosen't work. I dont why.