diff --git a/api/res/values/strings.xml b/api/res/values/strings.xml index 63decbc80c..f9afe8555d 100644 --- a/api/res/values/strings.xml +++ b/api/res/values/strings.xml @@ -137,8 +137,10 @@ Sync Ongoing... Last Sync: %s - + Failed On: %s + + Sync w/ Errors: %s Last Successful Sync: %s diff --git a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java index 389b169a24..8937292155 100644 --- a/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java +++ b/api/src/com/todoroo/astrid/sync/SyncProviderPreferences.java @@ -119,17 +119,26 @@ else if(getUtilities().isOngoing()) { status = r.getString(R.string.sync_status_ongoing); statusColor = Color.rgb(0, 0, 100); } - // last sync was error - else if(getUtilities().getLastAttemptedSyncDate() != 0) { - status = r.getString(R.string.sync_status_failed, + // last sync had errors + else if(getUtilities().getLastError() != null || getUtilities().getLastAttemptedSyncDate() != 0) { + // last sync was failure + if(getUtilities().getLastAttemptedSyncDate() != 0) { + status = r.getString(R.string.sync_status_failed, DateUtilities.getDateStringWithTime(SyncProviderPreferences.this, new Date(getUtilities().getLastAttemptedSyncDate()))); - if(getUtilities().getLastSyncDate() > 0) { - subtitle = r.getString(R.string.sync_status_failed_subtitle, + statusColor = Color.rgb(100, 0, 0); + + if(getUtilities().getLastSyncDate() > 0) { + subtitle = r.getString(R.string.sync_status_failed_subtitle, + DateUtilities.getDateStringWithTime(SyncProviderPreferences.this, + new Date(getUtilities().getLastSyncDate()))); + } + } else { + status = r.getString(R.string.sync_status_errors, DateUtilities.getDateStringWithTime(SyncProviderPreferences.this, - new Date(getUtilities().getLastSyncDate()))); + new Date(getUtilities().getLastSyncDate()))); + statusColor = Color.rgb(100, 100, 0); } - statusColor = Color.rgb(100, 0, 0); preference.setOnPreferenceClickListener(new OnPreferenceClickListener() { public boolean onPreferenceClick(Preference p) { String error = getUtilities().getLastError(); @@ -138,7 +147,8 @@ public boolean onPreferenceClick(Preference p) { return true; } }); - } else if(getUtilities().getLastSyncDate() > 0) { + } + else if(getUtilities().getLastSyncDate() > 0) { status = r.getString(R.string.sync_status_success, DateUtilities.getDateStringWithTime(SyncProviderPreferences.this, new Date(getUtilities().getLastSyncDate())));