Code cleanup

This commit is contained in:
Arne 2024-06-18 12:25:43 +02:00
parent e269138a45
commit c0e7b91774

View file

@ -720,7 +720,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
}); });
List<String> statusMessages = contact.getPresences().getStatusMessages(); List<String> statusMessages = contact.getPresences().getStatusMessages();
if (getPreferences().getBoolean("send_link_previews", true)) { if (getPreferences().getBoolean("send_link_previews", true)) {
if (statusMessages.size() == 0) { if (statusMessages.isEmpty()) {
binding.statusMessage.setVisibility(View.GONE); binding.statusMessage.setVisibility(View.GONE);
binding.statusBox.setVisibility(View.GONE); binding.statusBox.setVisibility(View.GONE);
} else if (statusMessages.size() == 1) { } else if (statusMessages.size() == 1) {
@ -801,7 +801,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} }
} else { } else {
if (statusMessages.size() == 0) { if (statusMessages.isEmpty()) {
binding.statusBox.setVisibility(View.GONE); binding.statusBox.setVisibility(View.GONE);
binding.statusMessage.setVisibility(View.GONE); binding.statusMessage.setVisibility(View.GONE);
} else if (statusMessages.size() == 1) { } else if (statusMessages.size() == 1) {
@ -828,7 +828,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
} }
} }
String resources = contact.getPresences().getMostAvailableResource(); String resources = contact.getPresences().getMostAvailableResource();
if (resources.length() == 0) { if (resources.isEmpty()) {
binding.resource.setVisibility(View.GONE); binding.resource.setVisibility(View.GONE);
} else { } else {
binding.resource.setVisibility(View.VISIBLE); binding.resource.setVisibility(View.VISIBLE);
@ -991,7 +991,7 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
binding.keysWrapper.setVisibility(hasKeys ? View.VISIBLE : View.GONE); binding.keysWrapper.setVisibility(hasKeys ? View.VISIBLE : View.GONE);
List<ListItem.Tag> tagList = contact.getTags(this); List<ListItem.Tag> tagList = contact.getTags(this);
if (tagList.size() == 0 || !this.showDynamicTags) { if (tagList.isEmpty() || !this.showDynamicTags) {
binding.tags.setVisibility(View.GONE); binding.tags.setVisibility(View.GONE);
} else { } else {
binding.tags.setVisibility(View.VISIBLE); binding.tags.setVisibility(View.VISIBLE);