Small improvement

This commit is contained in:
M66B 2019-01-14 13:33:16 +00:00
parent 71e83e2c7f
commit b3aaaf0919
2 changed files with 12 additions and 7 deletions

View File

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

View File

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