Change menu visibility

This commit is contained in:
Jeremy committed 2017-11-12 23:49:37 +01:00
1 parent bcc1008037
commit 9783c84798
8 files changed
+45 -107

No files matched your search

@@ -20,16 +20,20 @@ public class MenuUtil {
inflater.inflate(R.menu.default_menu, menu);
}
public static boolean onDonationItemSelected(StylishActivity activity) {
try {
Util.gotoUrl(activity, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
}
public static boolean onDefaultMenuOptionsItemSelected(StylishActivity activity, MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_donate:
try {
Util.gotoUrl(activity, R.string.donate_url);
} catch (ActivityNotFoundException e) {
Toast.makeText(activity, R.string.error_failed_to_launch_link, Toast.LENGTH_LONG).show();
return false;
}
return true;
return onDonationItemSelected(activity);
case R.id.menu_app_settings:
SettingsActivity.Launch(activity);