Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Code for Medium article 2
...
@Override
public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) {
super.getItemOffsets(outRect, view, parent, state);
int dataSize = state.getItemCount();
int position = parent.getChildAdapterPosition(view);
if (dataSize > 0 && position == dataSize - 1) {
outRect.set(0, 0, mEndOffset, 0);
} else {
outRect.set(0, 0, 0, 0);
}
}
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.