Accounts & Sync - sync status indicators missing contentDescription attributes.
1. Added the content descriptions. bug:5033572 Change-Id: I4d04f4c6e7b79dcc9720b69505aa64e798a02fad
This commit is contained in:
@@ -3201,6 +3201,13 @@ found in the list of installed applications.</string>
|
||||
<!-- Do not translate. This is a stub which will be removed soon. -->
|
||||
<string name="time_zone_auto_stub" translatable="false">Select Time Zone</string>
|
||||
|
||||
<!-- Content description of the enabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_sync_enabled">Sync enabled</string>
|
||||
<!-- Content description of the disabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_sync_disabled">Sync disabled</string>
|
||||
<!-- Content description of the disabled sync icon for accessibility. [CHAR LIMIT=NONE] -->
|
||||
<string name="accessibility_sync_error">Sync error.</string>
|
||||
|
||||
<!-- Account specific sync settings title [CHAR LIMIT=35] -->
|
||||
<string name="account_sync_settings_title">Sync settings</string>
|
||||
<!-- Message when sync is currently failing [CHAR LIMIT=100] -->
|
||||
|
@@ -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)) {
|
||||
|
Reference in New Issue
Block a user