Use the new Preference:icon attribute and placeholder for showing icons on the left.

This commit is contained in:
Amith Yamasani
2010-11-17 15:21:18 -08:00
parent 8ba83bf5ff
commit 43a673053f
11 changed files with 17 additions and 136 deletions

View File

@@ -49,7 +49,7 @@ public class AccountPreference extends Preference {
mAccount = account;
mAuthorities = authorities;
mProviderIcon = icon;
setLayoutResource(R.layout.account_preference);
setWidgetLayoutResource(R.layout.account_preference);
setTitle(mAccount.name);
setSummary("");
// Add account info to the intent for AccountSyncSettings
@@ -72,7 +72,7 @@ public class AccountPreference extends Preference {
protected void onBindView(View view) {
super.onBindView(view);
setSummary(getSyncStatusMessage(mStatus));
mProviderIconView = (ImageView) view.findViewById(R.id.providerIcon);
mProviderIconView = (ImageView) view.findViewById(android.R.id.icon);
mProviderIconView.setImageDrawable(mProviderIcon);
mSyncStatusIcon = (ImageView) view.findViewById(R.id.syncStatusIcon);
mSyncStatusIcon.setImageResource(getSyncStatusIcon(mStatus));