我希望使用Fragment
更改Fragment
内的RecyclerView
(使用CardView
时)。
这是我的ViewHolder
:
public class MyViewHolder extends RecyclerView.ViewHolder{
private TextView textViewView;
private ImageView imageView;
public MyViewHolder(View itemView) {
super(itemView);
textViewView = (TextView) itemView.findViewById(R.id.text);
imageView = (ImageView) itemView.findViewById(R.id.image);
}
public void bind(MyObject myObject){
textViewView.setText(myObject.getText());
Picasso.with(imageView.getContext())
.load(myObject.getImageUrl())
.centerCrop()
.fit()
.into(imageView);
}