From fe928dc8196b2ec81a949996f1dc8274e0534b76 Mon Sep 17 00:00:00 2001 From: Arne Date: Thu, 19 Dec 2024 23:14:16 +0100 Subject: [PATCH] Add contact name under avatar in contact details --- .../conversations/ui/ContactDetailsActivity.java | 6 +++--- src/main/res/layout/activity_contact_details.xml | 14 +++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java index 1f56f705e..c7eec177b 100644 --- a/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/ContactDetailsActivity.java @@ -459,7 +459,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp } if (binding.editTags.getVisibility() != View.GONE) return; invalidateOptionsMenu(); - setTitle(contact.getDisplayName()); + setTitle(R.string.action_contact_details); if (contact.showInRoster()) { binding.detailsSendPresence.setVisibility(View.VISIBLE); binding.detailsReceivePresence.setVisibility(View.VISIBLE); @@ -468,7 +468,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp binding.detailsReceivePresence.setOnCheckedChangeListener(null); List statusMessages = contact.getPresences().getStatusMessages(); - if (statusMessages.size() == 0) { + if (statusMessages.isEmpty()) { binding.statusMessage.setVisibility(View.GONE); } else if (statusMessages.size() == 1) { final String message = statusMessages.get(0); @@ -537,7 +537,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp binding.detailsLastseen.setVisibility(View.GONE); } } - + binding.detailsContactName.setText(contact.getDisplayName()); binding.detailsContactjid.setText(IrregularUnicodeDetector.style(this, contact.getJid())); final String account = contact.getAccount().getJid().asBareJid().toEscapedString(); binding.detailsAccount.setText(getString(R.string.using_account, account)); diff --git a/src/main/res/layout/activity_contact_details.xml b/src/main/res/layout/activity_contact_details.xml index 11d2e8fda..e02d48792 100644 --- a/src/main/res/layout/activity_contact_details.xml +++ b/src/main/res/layout/activity_contact_details.xml @@ -41,7 +41,6 @@ android:layout_height="wrap_content" android:orientation="vertical"> - + +