mirror of
https://github.com/nextcloud/talk-android
synced 2025-03-12 02:19:44 +00: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
@ -41,6 +41,7 @@ import java.util.List;
|
|||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
import eu.davidea.flexibleadapter.FlexibleAdapter;
|
||||||
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
import eu.davidea.flexibleadapter.items.AbstractFlexibleItem;
|
||||||
@ -193,6 +194,7 @@ public class MentionAutocompleteItem extends AbstractFlexibleItem<UserItem.UserI
|
|||||||
holder.statusMessage.setText(statusMessage);
|
holder.statusMessage.setText(statusMessage);
|
||||||
} else {
|
} else {
|
||||||
holder.statusMessage.setText("");
|
holder.statusMessage.setText("");
|
||||||
|
alignUsernameVertical(holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (statusIcon != null && !statusIcon.isEmpty()) {
|
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
|
@Override
|
||||||
public boolean filter(String constraint) {
|
public boolean filter(String constraint) {
|
||||||
return objectId != null &&
|
return objectId != null &&
|
||||||
|
@ -47,6 +47,7 @@ import java.util.List;
|
|||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.core.content.res.ResourcesCompat;
|
import androidx.core.content.res.ResourcesCompat;
|
||||||
import androidx.emoji.widget.EmojiTextView;
|
import androidx.emoji.widget.EmojiTextView;
|
||||||
import butterknife.BindView;
|
import butterknife.BindView;
|
||||||
@ -282,6 +283,7 @@ public class UserItem extends AbstractFlexibleItem<UserItem.UserItemViewHolder>
|
|||||||
holder.statusMessage.setText(participant.statusMessage);
|
holder.statusMessage.setText(participant.statusMessage);
|
||||||
} else {
|
} else {
|
||||||
holder.statusMessage.setText("");
|
holder.statusMessage.setText("");
|
||||||
|
alignUsernameVertical(holder);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (participant.statusIcon != null && !participant.statusIcon.isEmpty()) {
|
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
|
@Override
|
||||||
public boolean filter(String constraint) {
|
public boolean filter(String constraint) {
|
||||||
return participant.getDisplayName() != null &&
|
return participant.getDisplayName() != null &&
|
||||||
|
@ -21,7 +21,6 @@
|
|||||||
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
xmlns:app="http://schemas.android.com/apk/res-auto"
|
xmlns:app="http://schemas.android.com/apk/res-auto"
|
||||||
xmlns:tools="http://schemas.android.com/tools"
|
xmlns:tools="http://schemas.android.com/tools"
|
||||||
android:id="@+id/relativeLayout"
|
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginBottom="@dimen/standard_half_margin"
|
android:layout_marginBottom="@dimen/standard_half_margin"
|
||||||
|
Loading…
Reference in New Issue
Block a user