通过单击Recycler View更改片段

时间:2015-05-11 08:53:31

标签: java android android-fragments android-cardview android-recyclerview

我希望使用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);
}

0 个答案:

没有答案