Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setOnClickListener don't work! #77

Open
joaoarmando opened this issue May 8, 2018 · 1 comment
Open

setOnClickListener don't work! #77

joaoarmando opened this issue May 8, 2018 · 1 comment

Comments

@joaoarmando
Copy link

Hello everyone, I'm not able to use setOnClickListener, simply nothing happens when clicked.

my code:

public  class ViewHolder extends RecyclerView.ViewHolder implements AsymmetricRecyclerView.OnClickListener{

        //CAST ITEMS
        ImageView imgPost,imgPlay;
        RelativeLayout layoutImage;

        public ViewHolder(View itemView){
            super(itemView);
            imgPost= itemView.findViewById(R.id.imgPost);
            imgPlay = itemView.findViewById(R.id.imgPlay);
            layoutImage = itemView.findViewById(R.id.layoutImage);
            layoutImage.setOnClickListener(this);

        }

        @Override
        public void onClick(View v) {

            Toast.makeText(context, "Clicked!!!", Toast.LENGTH_SHORT).show();
        }


    }
@Mubly
Copy link

Mubly commented Mar 20, 2019

AsymmetricRecyclerView 是支持item点击事件的,不过,需要你自己去自定义一个点击事件的监听,
在AsymmetricRecyclerView 的fireOnItemClick中进行回调
@OverRide
public void fireOnItemClick(int index, View v) {
if (null != itemOnClickListener) {
itemOnClickListener.onItemClick(index,v);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants