mirror of
https://github.com/M66B/FairEmail.git
synced 2025-12-31 10:01:22 +01:00
Show warning icons in nav menu on errors
This commit is contained in:
@@ -23,6 +23,7 @@ public class NavMenuItem {
|
||||
private int icon;
|
||||
private int title;
|
||||
private Integer count = null;
|
||||
private boolean warning = false;
|
||||
private boolean separated = false;
|
||||
private Runnable click;
|
||||
private Runnable longClick;
|
||||
@@ -40,16 +41,16 @@ public class NavMenuItem {
|
||||
this.longClick = longClick;
|
||||
}
|
||||
|
||||
void setIcon(int icon) {
|
||||
this.icon = icon;
|
||||
}
|
||||
|
||||
void setCount(Integer count) {
|
||||
if (count != null && count == 0)
|
||||
count = null;
|
||||
this.count = count;
|
||||
}
|
||||
|
||||
void setWarning(boolean warning) {
|
||||
this.warning = warning;
|
||||
}
|
||||
|
||||
NavMenuItem setSeparated() {
|
||||
this.separated = true;
|
||||
return this;
|
||||
@@ -71,6 +72,10 @@ public class NavMenuItem {
|
||||
return this.separated;
|
||||
}
|
||||
|
||||
boolean hasWarning() {
|
||||
return this.warning;
|
||||
}
|
||||
|
||||
void onClick() {
|
||||
click.run();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user