Only show chip if we have >1 account

bug 3435487

Change-Id: I42668fc9d6f118a83943fbe00edf5eb28b7749d6
This commit is contained in:
Todd Kennedy 2011-02-22 08:06:08 -08:00
parent d096f70ab3
commit 9b1906337a

View File

@ -615,7 +615,8 @@ public class EmailWidget implements RemoteViewsService.RemoteViewsFactory {
} else { } else {
long accountId = mCursor.getLong(WIDGET_COLUMN_ACCOUNT_KEY); long accountId = mCursor.getLong(WIDGET_COLUMN_ACCOUNT_KEY);
int colorId = mResourceHelper.getAccountColorId(accountId); int colorId = mResourceHelper.getAccountColorId(accountId);
if (colorId != ResourceHelper.UNDEFINED_RESOURCE_ID) { // Don't show the chip if we have 1 or fewer accounts
if (mAccountCount > 1 && colorId != ResourceHelper.UNDEFINED_RESOURCE_ID) {
// Color defined by resource ID, so, use it // Color defined by resource ID, so, use it
views.setViewVisibility(R.id.color_chip, View.VISIBLE); views.setViewVisibility(R.id.color_chip, View.VISIBLE);
views.setImageViewResource(R.id.color_chip, colorId); views.setImageViewResource(R.id.color_chip, colorId);