1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Show warning icon on errors

This commit is contained in:
M66B 2019-05-04 09:02:05 +02:00
parent 7e36de7733
commit bb0b1c6009
3 changed files with 32 additions and 25 deletions

View file

@ -213,14 +213,14 @@ public class AdapterFolder extends RecyclerView.Adapter<AdapterFolder.ViewHolder
else if (folder.state == null) else if (folder.state == null)
ivState.setImageResource(R.drawable.baseline_cloud_off_24); ivState.setImageResource(R.drawable.baseline_cloud_off_24);
else else
ivState.setImageResource(android.R.drawable.stat_sys_warning); ivState.setImageResource(R.drawable.baseline_warning_24);
} else { } else {
if ("syncing".equals(folder.sync_state)) if ("syncing".equals(folder.sync_state))
ivState.setImageResource(R.drawable.baseline_compare_arrows_24); ivState.setImageResource(R.drawable.baseline_compare_arrows_24);
else if ("downloading".equals(folder.sync_state)) else if ("downloading".equals(folder.sync_state))
ivState.setImageResource(R.drawable.baseline_cloud_download_24); ivState.setImageResource(R.drawable.baseline_cloud_download_24);
else else
ivState.setImageResource(android.R.drawable.stat_sys_warning); ivState.setImageResource(R.drawable.baseline_warning_24);
} }
ivState.setVisibility( ivState.setVisibility(
folder.synchronize || folder.state != null || folder.sync_state != null folder.synchronize || folder.state != null || folder.sync_state != null

View file

@ -70,9 +70,13 @@ public class AdapterNavAccount extends RecyclerView.Adapter<AdapterNavAccount.Vi
} }
private void bindTo(TupleAccountEx account) { private void bindTo(TupleAccountEx account) {
ivItem.setImageResource("connected".equals(account.state) if (account.error == null)
? account.primary ? R.drawable.baseline_folder_special_24 : R.drawable.baseline_folder_24 ivItem.setImageResource("connected".equals(account.state)
: R.drawable.baseline_folder_open_24); ? account.primary ? R.drawable.baseline_folder_special_24 : R.drawable.baseline_folder_24
: R.drawable.baseline_folder_open_24);
else
ivItem.setImageResource(R.drawable.baseline_warning_24);
if (account.color == null) if (account.color == null)
ivItem.clearColorFilter(); ivItem.clearColorFilter();
else else

View file

@ -74,28 +74,31 @@ public class AdapterNavFolder extends RecyclerView.Adapter<AdapterNavFolder.View
} }
private void bindTo(TupleFolderNav folder) { private void bindTo(TupleFolderNav folder) {
if (EntityFolder.OUTBOX.equals(folder.type)) { if (folder.error == null)
if ("syncing".equals(folder.sync_state)) if (EntityFolder.OUTBOX.equals(folder.type)) {
ivItem.setImageResource(R.drawable.baseline_compare_arrows_24); if ("syncing".equals(folder.sync_state))
else ivItem.setImageResource(R.drawable.baseline_compare_arrows_24);
ivItem.setImageResource(R.drawable.baseline_send_24); else
ivItem.setImageResource(R.drawable.baseline_send_24);
ivItem.clearColorFilter();
} else {
if ("syncing".equals(folder.sync_state))
ivItem.setImageResource(R.drawable.baseline_compare_arrows_24);
else if ("downloading".equals(folder.sync_state))
ivItem.setImageResource(R.drawable.baseline_cloud_download_24);
else
ivItem.setImageResource("connected".equals(folder.state)
? R.drawable.baseline_folder_24
: R.drawable.baseline_folder_open_24);
if (folder.color == null)
ivItem.clearColorFilter(); ivItem.clearColorFilter();
else } else {
ivItem.setColorFilter(folder.color); if ("syncing".equals(folder.sync_state))
} ivItem.setImageResource(R.drawable.baseline_compare_arrows_24);
else if ("downloading".equals(folder.sync_state))
ivItem.setImageResource(R.drawable.baseline_cloud_download_24);
else
ivItem.setImageResource("connected".equals(folder.state)
? R.drawable.baseline_folder_24
: R.drawable.baseline_folder_open_24);
if (folder.color == null)
ivItem.clearColorFilter();
else
ivItem.setColorFilter(folder.color);
}
else
ivItem.setImageResource(R.drawable.baseline_warning_24);
int count = (EntityFolder.OUTBOX.equals(folder.type) ? folder.operations : folder.unseen); int count = (EntityFolder.OUTBOX.equals(folder.type) ? folder.operations : folder.unseen);