Added the case in sync preferences for a successful sync that had errors, displayed in yellow

pull/14/head
Tim Su 13 years ago
parent 5097d3fac9
commit 200e8fbf9b

@ -137,8 +137,10 @@
<string name="sync_status_ongoing">Sync Ongoing...</string>
<!-- Sync Status: success status (%s -> last sync date). Keep it short!-->
<string name="sync_status_success">Last Sync: %s</string>
<!-- Sync Status: error status (%s -> last attempted sync date) -->
<!-- Sync Status: failure status (%s -> last attempted sync date) -->
<string name="sync_status_failed">Failed On: %s</string>
<!-- Sync Status: error status (%s -> last sync date) -->
<string name="sync_status_errors">Sync w/ Errors: %s</string>
<!-- Sync Status: error subtitle (%s -> last successful sync date) -->
<string name="sync_status_failed_subtitle">Last Successful Sync: %s</string>
<!-- Sync Status: never sync'd -->

@ -119,17 +119,26 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity
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 @@ abstract public class SyncProviderPreferences extends TodorooPreferenceActivity
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())));

Loading…
Cancel
Save