Created
February 24, 2018 12:48
-
-
Save theonlyanil/d60d4a7736956dc7f790fd69b5360347 to your computer and use it in GitHub Desktop.
Endless Scrolling RecyclerView — Easiest Approach
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); | |
progressBar.setLayoutParams(new LinearLayout.LayoutParams(ViewGroup.LayoutParams.WRAP_CONTENT, ViewGroup.LayoutParams.WRAP_CONTENT)); | |
linearLayout.addView(progressBar); | |
// add more | |
// Remove the progressbar. | |
Toast.makeText(getApplicationContext(), "Loading", Toast.LENGTH_SHORT).show(); | |
} | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment