From 3b72434f4a121488cba607df620d3d75b3b1ac25 Mon Sep 17 00:00:00 2001 From: Jorge Ruesga Date: Thu, 5 Mar 2015 02:00:45 +0100 Subject: unified email: prefer account display name to sender name When users have multiple email account defines, it makes more sense to have the account name rather than the sender name, which is in most is the case the user itself. The vast majority of the user known its name, so the account name becomes a more useful information to display. Change-Id: I866c55acc3b3b666d677b4243044c91abd0d7124 Signed-off-by: Jorge Ruesga --- src/com/android/mail/ui/AccountItemView.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/com/android/mail/ui/AccountItemView.java b/src/com/android/mail/ui/AccountItemView.java index 5b87f7edf..69a9457f6 100644 --- a/src/com/android/mail/ui/AccountItemView.java +++ b/src/com/android/mail/ui/AccountItemView.java @@ -70,15 +70,15 @@ public class AccountItemView extends LinearLayout { */ public void bind(final Context context, final Account account, final boolean isCurrentAccount, final BitmapCache imagesCache, final ContactResolver contactResolver) { - if (!TextUtils.isEmpty(account.getSenderName())) { - mAccountDisplayName.setText(account.getSenderName()); - mAccountAddress.setText(account.getEmailAddress()); - mAccountAddress.setVisibility(View.VISIBLE); - } else if (!TextUtils.isEmpty(account.getDisplayName()) && + if (!TextUtils.isEmpty(account.getDisplayName()) && !TextUtils.equals(account.getDisplayName(), account.getEmailAddress())) { mAccountDisplayName.setText(account.getDisplayName()); mAccountAddress.setText(account.getEmailAddress()); mAccountAddress.setVisibility(View.VISIBLE); + } else if (!TextUtils.isEmpty(account.getSenderName())) { + mAccountDisplayName.setText(account.getSenderName()); + mAccountAddress.setText(account.getEmailAddress()); + mAccountAddress.setVisibility(View.VISIBLE); } else { mAccountDisplayName.setText(account.getEmailAddress()); mAccountAddress.setVisibility(View.GONE); -- cgit v1.2.3