Skip to content

Not able to click on view #49

Description

@jigar1211

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

Activity

  1. dieunguyenantony commented on Nov 13, 2020

    @dieunguyenantony

    Same problem

  2. dieunguyenantony commented on Nov 17, 2020

    @dieunguyenantony

    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;
        }
    
    
  3. jigar1211 commented on Nov 17, 2020

    @jigar1211
    Author

    Any solution?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions