Allow collapsing part of main navigation menu

This commit is contained in:
M66B
2019-04-28 11:32:00 +02:00
parent 27af5265f0
commit b0cfb2f1e7
5 changed files with 79 additions and 24 deletions

View File

@@ -11,12 +11,19 @@ public class DrawerItem {
private int resid;
private String title;
private boolean highlight;
private boolean collapsible = false;
DrawerItem(long id) {
this.id = id;
this.layout = R.layout.item_drawer_separator;
}
DrawerItem(long id, int resid) {
this.id = id;
this.menu = resid;
this.layout = R.layout.item_drawer_expander;
}
DrawerItem(long id, int icon, int resid) {
this.id = id;
this.menu = resid;
@@ -43,6 +50,11 @@ public class DrawerItem {
this.highlight = highlight;
}
DrawerItem setCollapsible() {
this.collapsible = true;
return this;
}
int getLayout() {
return this.layout;
}
@@ -76,4 +88,8 @@ public class DrawerItem {
boolean getHighlight() {
return this.highlight;
}
boolean isCollapsible() {
return this.collapsible;
}
}