Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit cd4b4d3

Browse files
committed
Add margin to the bottommost message
1 parent 7f36ce5 commit cd4b4d3

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

app/src/main/java/com/zulip/android/viewholders/HeaderSpaceItemDecoration.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,13 @@ public void getItemOffsets(Rect outRect, View view, RecyclerView parent,
2727
RecyclerView.State state) {
2828

2929
int position = parent.getChildAdapterPosition(view);
30-
30+
int size = parent.getAdapter().getItemCount();
3131
int viewType = parent.getAdapter().getItemViewType(position);
3232
if (viewType == RecyclerMessageAdapter.VIEWTYPE_MESSAGE_HEADER && position != 0) {
3333
outRect.top = verticalMargin;
3434
} else if (viewType == RecyclerMessageAdapter.VIEWTYPE_HEADER) {
3535
outRect.top = toolbarHeight;
3636
}
37+
outRect.bottom = (position == size - 2) ? verticalMargin : 0;
3738
}
3839
}

0 commit comments

Comments
 (0)