Show warning icons in nav menu on errors

This commit is contained in:
M66B
2019-05-05 09:11:58 +02:00
parent 441fa79c46
commit 65dcbc7464
6 changed files with 57 additions and 36 deletions

View File

@@ -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();
}