mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-03 11:28:41 +01:00
Stable navigation menu, refactoring
This commit is contained in:
@@ -3,44 +3,49 @@ package eu.faircode.email;
|
||||
import android.content.Context;
|
||||
|
||||
public class DrawerItem {
|
||||
private long id;
|
||||
private int menu;
|
||||
private int layout;
|
||||
private int id;
|
||||
private int icon;
|
||||
private Integer color;
|
||||
private int resid;
|
||||
private String title;
|
||||
private boolean highlight;
|
||||
private Object data;
|
||||
|
||||
DrawerItem(int layout) {
|
||||
this.id = 0;
|
||||
this.layout = layout;
|
||||
}
|
||||
|
||||
DrawerItem(Context context, int layout, int icon, int title) {
|
||||
this.layout = layout;
|
||||
this.id = title;
|
||||
this.icon = icon;
|
||||
this.title = context.getString(title);
|
||||
}
|
||||
|
||||
DrawerItem(int layout, int id, int icon, Integer color, String title, boolean highlight, Object data) {
|
||||
this.layout = layout;
|
||||
DrawerItem(long id) {
|
||||
this.id = id;
|
||||
this.layout = R.layout.item_drawer_separator;
|
||||
}
|
||||
|
||||
DrawerItem(long id, int resid, int icon) {
|
||||
this.id = id;
|
||||
this.menu = resid;
|
||||
this.layout = R.layout.item_drawer;
|
||||
this.icon = icon;
|
||||
this.resid = resid;
|
||||
}
|
||||
|
||||
DrawerItem(long id, int icon, Integer color, String title, boolean highlight) {
|
||||
this.id = id;
|
||||
this.layout = R.layout.item_drawer;
|
||||
this.icon = icon;
|
||||
this.color = color;
|
||||
this.title = title;
|
||||
this.highlight = highlight;
|
||||
this.data = data;
|
||||
}
|
||||
|
||||
int getLayout() {
|
||||
return this.layout;
|
||||
}
|
||||
|
||||
int getId() {
|
||||
long getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
int getMenuId() {
|
||||
return this.menu;
|
||||
}
|
||||
|
||||
int getIcon() {
|
||||
return this.icon;
|
||||
}
|
||||
@@ -49,15 +54,13 @@ public class DrawerItem {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
String getTitle() {
|
||||
String getTitle(Context context) {
|
||||
if (this.title == null && resid > 0)
|
||||
this.title = context.getString(resid);
|
||||
return this.title;
|
||||
}
|
||||
|
||||
boolean getHighlight() {
|
||||
return this.highlight;
|
||||
}
|
||||
|
||||
Object getData() {
|
||||
return this.data;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user