1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-29 11:15:51 +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)
ivState.setImageResource(R.drawable.baseline_cloud_off_24);
else
ivState.setImageResource(android.R.drawable.stat_sys_warning);
ivState.setImageResource(R.drawable.baseline_warning_24);
} else {
if ("syncing".equals(folder.sync_state))
ivState.setImageResource(R.drawable.baseline_compare_arrows_24);
else if ("downloading".equals(folder.sync_state))
ivState.setImageResource(R.drawable.baseline_cloud_download_24);
else
ivState.setImageResource(android.R.drawable.stat_sys_warning);
ivState.setImageResource(R.drawable.baseline_warning_24);
}
ivState.setVisibility(
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) {
ivItem.setImageResource("connected".equals(account.state)
? account.primary ? R.drawable.baseline_folder_special_24 : R.drawable.baseline_folder_24
: R.drawable.baseline_folder_open_24);
if (account.error == null)
ivItem.setImageResource("connected".equals(account.state)
? 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)
ivItem.clearColorFilter();
else

View file

@ -74,28 +74,31 @@ public class AdapterNavFolder extends RecyclerView.Adapter<AdapterNavFolder.View
}
private void bindTo(TupleFolderNav folder) {
if (EntityFolder.OUTBOX.equals(folder.type)) {
if ("syncing".equals(folder.sync_state))
ivItem.setImageResource(R.drawable.baseline_compare_arrows_24);
else
ivItem.setImageResource(R.drawable.baseline_send_24);
if (folder.error == null)
if (EntityFolder.OUTBOX.equals(folder.type)) {
if ("syncing".equals(folder.sync_state))
ivItem.setImageResource(R.drawable.baseline_compare_arrows_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();
else
ivItem.setColorFilter(folder.color);
}
} 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();
else
ivItem.setColorFilter(folder.color);
}
else
ivItem.setImageResource(R.drawable.baseline_warning_24);
int count = (EntityFolder.OUTBOX.equals(folder.type) ? folder.operations : folder.unseen);