mirror of
https://github.com/nextcloud/talk-android.git
synced 2024-11-26 06:55:42 +03:00
align username etc vertical if no status message is set
Signed-off-by: Marcel Hibbe <dev@mhibbe.de>
This commit is contained in:
parent
c746b95ac2
commit
305ceedc75
3 changed files with 18 additions and 1 deletions
|
@ -41,6 +41,7 @@ import java.util.List;
|
|||
import java.util.Objects;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||
|
@ -193,6 +194,7 @@ public class MentionAutocompleteItem extends AbstractFlexibleItem<UserItem.UserI
|
|||
holder.statusMessage.setText(statusMessage);
|
||||
} else {
|
||||
holder.statusMessage.setText("");
|
||||
alignUsernameVertical(holder);
|
||||
}
|
||||
|
||||
if (statusIcon != null && !statusIcon.isEmpty()) {
|
||||
|
@ -213,6 +215,13 @@ public class MentionAutocompleteItem extends AbstractFlexibleItem<UserItem.UserI
|
|||
}
|
||||
}
|
||||
|
||||
private void alignUsernameVertical(UserItem.UserItemViewHolder holder) {
|
||||
ConstraintLayout.LayoutParams layoutParams =
|
||||
(ConstraintLayout.LayoutParams) holder.contactDisplayName.getLayoutParams();
|
||||
layoutParams.topMargin = (int) DisplayUtils.convertDpToPixel(10, context);
|
||||
holder.contactDisplayName.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filter(String constraint) {
|
||||
return objectId != null &&
|
||||
|
|
|
@ -47,6 +47,7 @@ import java.util.List;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.core.content.res.ResourcesCompat;
|
||||
import androidx.emoji.widget.EmojiTextView;
|
||||
import butterknife.BindView;
|
||||
|
@ -282,6 +283,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||
holder.statusMessage.setText(participant.statusMessage);
|
||||
} else {
|
||||
holder.statusMessage.setText("");
|
||||
alignUsernameVertical(holder);
|
||||
}
|
||||
|
||||
if (participant.statusIcon != null && !participant.statusIcon.isEmpty()) {
|
||||
|
@ -302,6 +304,13 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||
}
|
||||
}
|
||||
|
||||
private void alignUsernameVertical(UserItemViewHolder holder) {
|
||||
ConstraintLayout.LayoutParams layoutParams =
|
||||
(ConstraintLayout.LayoutParams) holder.contactDisplayName.getLayoutParams();
|
||||
layoutParams.topMargin = (int) DisplayUtils.convertDpToPixel(10, context);
|
||||
holder.contactDisplayName.setLayoutParams(layoutParams);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean filter(String constraint) {
|
||||
return participant.getDisplayName() != null &&
|
||||
|
|
|
@ -21,7 +21,6 @@
|
|||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||
xmlns:tools="http://schemas.android.com/tools"
|
||||
android:id="@+id/relativeLayout"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||
|
|
Loading…
Reference in a new issue