1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 19:52:17 -05:00

Center folders without status (e.g. outbox) in folder list again.

This commit is contained in:
Danny Baumann 2013-03-06 10:30:23 +01:00
parent f990e6f032
commit ae28b1aa38

View File

@ -1030,12 +1030,12 @@ public class FolderList extends K9ListActivity {
return view; return view;
} }
holder.folderName.setText(folder.displayName); final String folderStatus;
if (folder.loading) { if (folder.loading) {
holder.folderStatus.setText(R.string.status_loading); folderStatus = getString(R.string.status_loading);
} else if (folder.status != null) { } else if (folder.status != null) {
holder.folderStatus.setText(folder.status); folderStatus = folder.status;
} else if (folder.lastChecked != 0) { } else if (folder.lastChecked != 0) {
long now = System.currentTimeMillis(); long now = System.currentTimeMillis();
int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR; int flags = DateUtils.FORMAT_SHOW_TIME | DateUtils.FORMAT_SHOW_DATE | DateUtils.FORMAT_SHOW_YEAR;
@ -1049,12 +1049,20 @@ public class FolderList extends K9ListActivity {
now, DateUtils.MINUTE_IN_MILLIS, flags); now, DateUtils.MINUTE_IN_MILLIS, flags);
} }
holder.folderStatus.setText(getString(folder.pushActive folderStatus = getString(folder.pushActive
? R.string.last_refresh_time_format_with_push ? R.string.last_refresh_time_format_with_push
: R.string.last_refresh_time_format, : R.string.last_refresh_time_format,
formattedDate)); formattedDate);
} else { } else {
holder.folderStatus.setText(null); folderStatus = null;
}
holder.folderName.setText(folder.displayName);
if (folderStatus != null) {
holder.folderStatus.setText(folderStatus);
holder.folderStatus.setVisibility(View.VISIBLE);
} else {
holder.folderStatus.setVisibility(View.GONE);
} }
if (folder.unreadMessageCount != 0) { if (folder.unreadMessageCount != 0) {