Created
December 11, 2014 15:29
-
-
Save alorma/81abef4c1ca7ad995403 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private class FakeAdapter extends RecyclerView.Adapter<FakeAdapter.VH> { | |
private final LayoutInflater inflater; | |
public FakeAdapter(Context context) { | |
this.inflater = LayoutInflater.from(context); | |
} | |
@Override | |
public VH onCreateViewHolder(ViewGroup parent, int viewType) { | |
return new VH(inflater.inflate(android.R.layout.simple_list_item_1, parent, false)); | |
} | |
@Override | |
public void onBindViewHolder(VH holder, int position) { | |
holder.text.setText("Pos: " + position); | |
} | |
@Override | |
public int getItemCount() { | |
return 100; | |
} | |
public class VH extends RecyclerView.ViewHolder { | |
public TextView text; | |
public VH(View itemView) { | |
super(itemView); | |
text = (TextView) itemView.findViewById(android.R.id.text1); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment