Conversation line visual improved

main
Eugen Rochko 8 years ago
parent 5d1a86d472
commit 7124abd22f
  1. 9
      app/src/main/java/com/keylesspalace/tusky/ConversationLineItemDecoration.java

@ -26,13 +26,14 @@ class ConversationLineItemDecoration extends RecyclerView.ItemDecoration {
int dividerLeft = parent.getPaddingLeft() + mContext.getResources().getDimensionPixelSize(R.dimen.status_left_line_margin); int dividerLeft = parent.getPaddingLeft() + mContext.getResources().getDimensionPixelSize(R.dimen.status_left_line_margin);
int dividerRight = dividerLeft + mDivider.getIntrinsicWidth(); int dividerRight = dividerLeft + mDivider.getIntrinsicWidth();
int childCount = parent.getChildCount(); int childCount = parent.getChildCount();
int avatarMargin = mContext.getResources().getDimensionPixelSize(R.dimen.account_avatar_margin);
for (int i = 0; i < childCount - 1; i++) { for (int i = 0; i < childCount; i++) {
View child = parent.getChildAt(i); View child = parent.getChildAt(i);
int dividerTop = child.getTop() + (i == 0 ? mContext.getResources().getDimensionPixelSize(R.dimen.account_avatar_margin) : 0); int dividerTop = child.getTop() + (i == 0 ? avatarMargin : 0);
int dividerBottom = (i == childCount - 2 ? dividerTop + mContext.getResources().getDimensionPixelSize(R.dimen.account_avatar_margin) : child.getBottom()); int dividerBottom = (i == childCount - 1 ? child.getTop() + avatarMargin : child.getBottom());
mDivider.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom); mDivider.setBounds(dividerLeft, dividerTop, dividerRight, dividerBottom);
mDivider.draw(c); mDivider.draw(c);

Loading…
Cancel
Save