Search in sources :

Example 1 with SyncLog

use of de.symeda.sormas.app.backend.synclog.SyncLog in project SORMAS-Project by hzi-braunschweig.

the class SyncLogDialog method buildAndDisplayDialogContent.

private void buildAndDisplayDialogContent() {
    if (logs.size() == 0) {
        contentBinding.setData(Html.fromHtml(getActivity().getResources().getString(R.string.hint_no_sync_errors)));
    } else {
        for (int i = lastDisplayCount; i < displayCount; i++) {
            if (i >= logs.size()) {
                break;
            }
            SyncLog log = logs.get(i);
            if (lastDate != null && DateHelper.isSameDay(lastDate, log.getCreationDate())) {
                content.append("<p><b>").append(log.getEntityName()).append("</b><br/>").append(log.getConflictText()).append("</p>");
            } else {
                if (lastDate != null) {
                    content.append("<br/>");
                }
                content.append("<p><b><u>").append(DateFormatHelper.formatLocalDate(log.getCreationDate())).append("</u></b></p><p><b>").append(log.getEntityName()).append("</b><br/>").append(log.getConflictText()).append("</p>");
            }
            lastDate = log.getCreationDate();
        }
        lastDisplayCount = displayCount;
        displayCount += INITIAL_LOG_LIMIT;
        contentBinding.setData(Html.fromHtml(content.toString()));
    }
}
Also used : SyncLog(de.symeda.sormas.app.backend.synclog.SyncLog)

Aggregations

SyncLog (de.symeda.sormas.app.backend.synclog.SyncLog)1