From b3aaaf0919a90160162f336658121492b4b4abb1 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 14 Jan 2019 13:33:16 +0000 Subject: [PATCH] Small improvement --- .../main/java/eu/faircode/email/ActivitySetup.java | 6 +++--- .../main/java/eu/faircode/email/ActivityView.java | 13 +++++++++---- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 1c47bc5751..3887e4a4a2 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -170,10 +170,10 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On PackageManager pm = getPackageManager(); DrawerAdapter drawerArray = new DrawerAdapter(this); - if (getIntentHelp().resolveActivity(pm) != null) + if (getIntentHelp().resolveActivity(pm) != null) { drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_live_help_24, R.string.title_setup_help)); - - drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); + drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); + } if (getIntentExport().resolveActivity(pm) != null) drawerArray.add(new DrawerItem(this, R.layout.item_drawer, R.drawable.baseline_archive_24, R.string.title_setup_export)); diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index d51f4b2357..692990aa40 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -316,15 +316,20 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_info_24, R.string.menu_about)); - drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); + boolean invite = (getIntentInvite().resolveActivity(getPackageManager()) != null); + boolean rate = (getIntentRate().resolveActivity(getPackageManager()) != null); + boolean other = (getIntentOtherApps().resolveActivity(getPackageManager()) != null); - if (getIntentInvite().resolveActivity(getPackageManager()) != null) + if (invite || rate || other) + drawerArray.add(new DrawerItem(R.layout.item_drawer_separator)); + + if (invite) drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_people_24, R.string.menu_invite)); - if (getIntentRate().resolveActivity(getPackageManager()) != null) + if (rate) drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_star_24, R.string.menu_rate)); - if (getIntentOtherApps().resolveActivity(getPackageManager()) != null) + if (other) drawerArray.add(new DrawerItem(ActivityView.this, R.layout.item_drawer, R.drawable.baseline_get_app_24, R.string.menu_other)); drawerList.setAdapter(drawerArray);