Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9422580f authored by Svetoslav Ganov's avatar Svetoslav Ganov Committed by Android (Google) Code Review
Browse files

Merge "Accounts & Sync - sync status indicators missing contentDescription attributes."

parents 37f326b1 0ceb6ad8
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -3218,6 +3218,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] -->
+15 −0
Original line number Diff line number Diff line
@@ -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)) {