From 0ceb6ad890a341a9edda7b000aea0725c61380d4 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Fri, 22 Jul 2011 19:34:12 -0700 Subject: Accounts & Sync - sync status indicators missing contentDescription attributes. 1. Added the content descriptions. bug:5033572 Change-Id: I4d04f4c6e7b79dcc9720b69505aa64e798a02fad --- src/com/android/settings/AccountPreference.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/com') diff --git a/src/com/android/settings/AccountPreference.java b/src/com/android/settings/AccountPreference.java index f3d7d51..f76d5cb 100644 --- a/src/com/android/settings/AccountPreference.java +++ b/src/com/android/settings/AccountPreference.java @@ -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)) { -- cgit v1.1