Not able to click on view
jigar1211 opened this issue · 3 comments
jigar1211 commented
Kindly check my code below:
I am not able to find click listener
+++++++++++++++++++
private static class TestHeaderColumnViewHolder extends ViewHolderImpl {
TextView tvTitle, tvAddToCartCompare;
ImageView ivProduct, ivRemove;
private TestHeaderColumnViewHolder(@NonNull View itemView) {
super(itemView);
tvTitle = itemView.findViewById(R.id.tvTitle);
tvAddToCartCompare = itemView.findViewById(R.id.tvAddToCartCompare);
ivProduct = itemView.findViewById(R.id.ivProduct);
ivRemove = itemView.findViewById(R.id.ivRemove);
}
public void bind(TestHeaderColumnViewHolder vh, int column) {
tvTitle.setText(arrayListOfItem.get(column - 1).getProduct_name());
Glide.with(getItemView().getContext()).load(arrayListOfItem.get(column - 1).getProduct_image()).into(ivProduct);
**tvAddToCartCompare.setOnClickListener(view -> {
assert addtocartClickListner != null;
addtocartClickListner.addToCart(view, arrayListOfItem.get(column - 1), arrayListOfItem.get(column - 1).get_id());
});**
**ivRemove.setOnClickListener(view -> {
assert removeCompareClickLisner != null;
removeCompareClickLisner.removeFromCart(view, arrayListOfItem.get(column - 1), arrayListOfItem.get(column - 1).get_id());
});**
}
}
+++++++++++++++++++
Kindly help me with solution
Thanks
dieunguyenantony commented
Same problem
dieunguyenantony commented
in file AdaptiveTableLayout find function onInterceptTouchEvent: return false
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
// intercept event before OnClickListener on item view.
mScrollHelper.onTouch(ev);
return false;
}
jigar1211 commented
Any solution?