Skip to content

Instantly share code, notes, and snippets.

View zahid371919's full-sized avatar

Technical developer ZAHID zahid371919

View GitHub Profile
@zahid371919
zahid371919 / OnScrollListener.java
Created February 27, 2021 04:38 — forked from yasszu/OnScrollListener.java
RecyclerView Auto Scroll Loader
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;
public abstract class OnScrollListener extends RecyclerView.OnScrollListener {
private LinearLayoutManager mLayoutManager;
private int mVisibleThreshold = 2;
private int mPreviousItemCount = 0;
private boolean mLoading = true;
@zahid371919
zahid371919 / SnapTopLinearLayoutManager.java
Created February 27, 2021 04:35 — forked from evant/SnapTopLinearLayoutManager.java
Force item to top instead of just on screen when smooth scrolling with RecyclerView
public class SnapTopLinearLayoutManager extends LinearLayoutManager {
public SnapTopLinearLayoutManager(Context context) {
super(context);
}
public SnapTopLinearLayoutManager(Context context, int orientation, boolean reverseLayout) {
super(context, orientation, reverseLayout);
}