This file contains 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
// OnCreate | |
{ | |
... | |
ItemTouchHelper.SimpleCallback simpleCallback = new ItemTouchHelper.SimpleCallback(0, ItemTouchHelper.LEFT | ItemTouchHelper.RIGHT) { | |
@Override | |
public boolean onMove(RecyclerView recyclerView, RecyclerView.ViewHolder viewHolder, RecyclerView.ViewHolder target) { | |
return false; | |
} | |
@Override |
This file contains 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 final static int NUM_GRIDS = 2; | |
... | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
// set the layout manager. | |
GridLayoutManager layoutManager; | |
layoutManager = new GridLayoutManager(this, NUM_GRIDS); |
This file contains 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
@Override | |
public void onBindViewHolder(final ViewHolder holder, final int position) { | |
... | |
// Load more - Endless Scrolling | |
if(position == this.getItemCount() - 1) | |
{ | |
// Add a progress bar. | |
ProgressBar progressBar = new ProgressBar(context); |
This file contains 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
/* Changes start from here... */ | |
public static class ViewHolder extends RecyclerView.ViewHolder implements View.OnClickListener | |
{ | |
// each data item is just a string in this case | |
public TextView mTextView; | |
public ViewHolder(View itemView) { | |
super(itemView); | |
itemView.setOnClickListener(this); | |
mTextView = itemView.findViewById(R.id.textView); | |
} |