Skip to content

Instantly share code, notes, and snippets.

View imandaliya's full-sized avatar
🐢

Rahul Mandaliya imandaliya

🐢
View GitHub Profile
@rogerhu
rogerhu / EndlessRecyclerViewScrollListener.java
Last active October 6, 2022 04:42
Endless RecyclerView scrolling for different layout managers
public abstract class EndlessRecyclerViewScrollListener extends RecyclerView.OnScrollListener {
// The minimum amount of items to have below your current scroll position
// before loading more.
private int visibleThreshold = 5;
// The current offset index of data you have loaded
private int currentPage = 0;
// The total number of items in the dataset after the last load
private int previousTotalItemCount = 0;
// True if we are still waiting for the last set of data to load.
private boolean loading = true;
@LarsWerkman
LarsWerkman / Main.java
Created February 11, 2013 13:53
A sample application which shows what the HoloColorPicker library can do.
public class Main extends Activity implements OnColorChangedListener {
private ColorPicker picker;
private SVBar svBar;
private OpacityBar opacityBar;
private Button button;
private TextView text;
@Override
protected void onCreate(Bundle savedInstanceState) {