We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
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(); } }
The text was updated successfully, but these errors were encountered:
AsymmetricRecyclerView 是支持item点击事件的,不过,需要你自己去自定义一个点击事件的监听, 在AsymmetricRecyclerView 的fireOnItemClick中进行回调 @OverRide public void fireOnItemClick(int index, View v) { if (null != itemOnClickListener) { itemOnClickListener.onItemClick(index,v); } }
Sorry, something went wrong.
No branches or pull requests
Hello everyone, I'm not able to use setOnClickListener, simply nothing happens when clicked.
my code:
The text was updated successfully, but these errors were encountered: