Accounts & Sync - sync status indicators missing contentDescription attributes.

1. Added the content descriptions.

bug:5033572

Change-Id: I4d04f4c6e7b79dcc9720b69505aa64e798a02fad
This commit is contained in:
Svetoslav Ganov
2011-07-22 19:34:12 -07:00
parent 554ad399a5
commit 0ceb6ad890
2 changed files with 22 additions and 0 deletions

View File

@@ -71,6 +71,7 @@ public class AccountPreference extends Preference {
setSummary(getSyncStatusMessage(mStatus));
mSyncStatusIcon = (ImageView) view.findViewById(R.id.syncStatusIcon);
mSyncStatusIcon.setImageResource(getSyncStatusIcon(mStatus));
mSyncStatusIcon.setContentDescription(getSyncContentDescription(mStatus));
}
public void setProviderIcon(Drawable icon) {
@@ -126,6 +127,20 @@ public class AccountPreference extends Preference {
return res;
}
private String getSyncContentDescription(int status) {
switch (status) {
case SYNC_ENABLED:
return getContext().getString(R.string.accessibility_sync_enabled);
case SYNC_DISABLED:
return getContext().getString(R.string.accessibility_sync_disabled);
case SYNC_ERROR:
return getContext().getString(R.string.accessibility_sync_error);
default:
Log.e(TAG, "Unknown sync status: " + status);
return getContext().getString(R.string.accessibility_sync_error);
}
}
@Override
public int compareTo(Preference other) {
if (!(other instanceof AccountPreference)) {