summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2011-07-25 11:45:15 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-07-25 11:45:15 -0700
commit9422580fa720e52f66b6caffa2eb24bf5bbcaea8 (patch)
treeae83428e07b4653557af5413dfbb2f1ccd49ed14 /src/com
parent37f326b10fce91c6955ea5a9617311e226629ad5 (diff)
parent0ceb6ad890a341a9edda7b000aea0725c61380d4 (diff)
downloadpackages_apps_settings-9422580fa720e52f66b6caffa2eb24bf5bbcaea8.zip
packages_apps_settings-9422580fa720e52f66b6caffa2eb24bf5bbcaea8.tar.gz
packages_apps_settings-9422580fa720e52f66b6caffa2eb24bf5bbcaea8.tar.bz2
Merge "Accounts & Sync - sync status indicators missing contentDescription attributes."
Diffstat (limited to 'src/com')
-rw-r--r--src/com/android/settings/AccountPreference.java15
1 files changed, 15 insertions, 0 deletions
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)) {