From 8dcea48d7193b052b0ed039c0cbfe99f81237daa Mon Sep 17 00:00:00 2001 From: Fabrice Di Meglio Date: Thu, 13 Mar 2014 12:49:01 -0700 Subject: [PATCH] Fix bug #13440372 More option is displayed with Email/Gmail icon after... scrolling through settings options - force the image and background to null when needed in the Adapter Change-Id: If4c1769dcd1651b683a34001dcd922c6554252c0 --- src/com/android/settings/SettingsActivity.java | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java index 4c1d6984040..e49d8277ead 100644 --- a/src/com/android/settings/SettingsActivity.java +++ b/src/com/android/settings/SettingsActivity.java @@ -1580,9 +1580,6 @@ public class SettingsActivity extends Activity view.findViewById(com.android.internal.R.id.summary); break; } - if (holder.mIcon != null) { - holder.mIcon.setBackgroundResource(R.color.background_drawer_icon); - } view.setTag(holder); } else { view = convertView; @@ -1650,7 +1647,18 @@ public class SettingsActivity extends Activity Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType); setHeaderIcon(holder, icon); } else { - holder.mIcon.setImageResource(header.iconRes); + if (header.iconRes > 0) { + holder.mIcon.setImageResource(header.iconRes); + } else { + holder.mIcon.setImageDrawable(null); + } + } + if (holder.mIcon != null) { + if (header.iconRes > 0) { + holder.mIcon.setBackgroundResource(R.color.background_drawer_icon); + } else { + holder.mIcon.setBackground(null); + } } holder.mTitle.setText(header.getTitle(getContext().getResources())); CharSequence summary = header.getSummary(getContext().getResources());