I have a RecyclerView in my application that displays a string containing photos and photos downloaded from the Internet. There is a photo and a button on the screen. When the user clicks the button, I want to make another top view on top of the photo on the screen.
I have a CustomViewHolder that contains all the views for a RecyclerView and a CustomRecyclerViewAdapter that displays the viewer's views. The onClick method for the button is overridden in CustomViewHolder, as shown below:
public static class CustomViewHolder extends RecyclerView.ViewHolder
implements OnClickListener {
public Button mButton;
public ImageView mImageView1;
public ImageView mImageView2;
public CustomViewHolder(View v)
{
super(v);
mButton = (Button) ...
mImageView1 = (ImageView) ...
mImageView2 = (ImageView) ...
}
@Override
public void onClick(View v) {
int id = v.getId();
if(id == R.id.buttonid)
{
}
}
mImageView2 , . - , ? .