Skip to content

Commit

Permalink
fix vertical alignment for MentionAutocompleteItem's
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel Hibbe <[email protected]>
  • Loading branch information
mahibi committed Feb 25, 2022
1 parent ec438b0 commit d4f9f99
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,10 @@ private void drawStatus(UserItem.UserItemViewHolder holder) {

if (statusMessage != null) {
holder.statusMessage.setText(statusMessage);
alignUsernameVertical(holder, 0);
} else {
holder.statusMessage.setText("");
alignUsernameVertical(holder);
alignUsernameVertical(holder, 10);
}

if (statusIcon != null && !statusIcon.isEmpty()) {
Expand All @@ -215,10 +216,10 @@ private void drawStatus(UserItem.UserItemViewHolder holder) {
}
}

private void alignUsernameVertical(UserItem.UserItemViewHolder holder) {
private void alignUsernameVertical(UserItem.UserItemViewHolder holder, float densityPixelsFromTop) {
ConstraintLayout.LayoutParams layoutParams =
(ConstraintLayout.LayoutParams) holder.contactDisplayName.getLayoutParams();
layoutParams.topMargin = (int) DisplayUtils.convertDpToPixel(10, context);
layoutParams.topMargin = (int) DisplayUtils.convertDpToPixel(densityPixelsFromTop, context);
holder.contactDisplayName.setLayoutParams(layoutParams);
}

Expand Down

0 comments on commit d4f9f99

Please sign in to comment.