Show version number in about nav menu

This commit is contained in:
M66B 2021-02-20 14:41:06 +01:00
parent 07b68b66a7
commit d028cc09c9
3 changed files with 13 additions and 2 deletions

View File

@ -555,7 +555,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB
checkUpdate(true); checkUpdate(true);
} }
} }
}).setSeparated()); }).setSeparated().setSubtitle(BuildConfig.VERSION_NAME));
extra.add(new NavMenuItem(R.drawable.twotone_monetization_on_24, R.string.menu_pro, new Runnable() { extra.add(new NavMenuItem(R.drawable.twotone_monetization_on_24, R.string.menu_pro, new Runnable() {
@Override @Override

View File

@ -93,7 +93,8 @@ public class AdapterNavMenu extends RecyclerView.Adapter<AdapterNavMenu.ViewHold
tvItem.setTextColor(menu.getCount() == null ? textColorSecondary : colorUnread); tvItem.setTextColor(menu.getCount() == null ? textColorSecondary : colorUnread);
tvItem.setTypeface(menu.getCount() == null ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD); tvItem.setTypeface(menu.getCount() == null ? Typeface.DEFAULT : Typeface.DEFAULT_BOLD);
tvItemExtra.setVisibility(View.GONE); tvItemExtra.setText(menu.getSubtitle());
tvItemExtra.setVisibility(menu.getSubtitle() == null ? View.GONE : View.VISIBLE);
ivExternal.setVisibility(menu.isExternal() ? View.VISIBLE : View.GONE); ivExternal.setVisibility(menu.isExternal() ? View.VISIBLE : View.GONE);
ivWarning.setVisibility(menu.hasWarning() ? View.VISIBLE : View.GONE); ivWarning.setVisibility(menu.hasWarning() ? View.VISIBLE : View.GONE);

View File

@ -22,6 +22,7 @@ package eu.faircode.email;
public class NavMenuItem { public class NavMenuItem {
private int icon; private int icon;
private int title; private int title;
private String subtitle = null;
private Integer count = null; private Integer count = null;
private boolean external = false; private boolean external = false;
private boolean warning = false; private boolean warning = false;
@ -42,6 +43,11 @@ public class NavMenuItem {
this.longClick = longClick; this.longClick = longClick;
} }
NavMenuItem setSubtitle(String subtitle) {
this.subtitle = subtitle;
return this;
}
void setCount(Integer count) { void setCount(Integer count) {
if (count != null && count == 0) if (count != null && count == 0)
count = null; count = null;
@ -70,6 +76,10 @@ public class NavMenuItem {
return this.title; return this.title;
} }
String getSubtitle() {
return this.subtitle;
}
Integer getCount() { Integer getCount() {
return this.count; return this.count;
} }