summaryrefslogtreecommitdiff
path: root/src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2014-07-15 01:00:42 +0200
committerdaniel oeh <daniel.oeh@gmail.com>2014-07-15 01:00:42 +0200
commit99d68b2982516a5bdc88a2aeb57e58267291e05f (patch)
tree6b3171220e9f532144e6a01815320f4679b606da /src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java
parent1b0ee017ce9d4c5f400efc5410d07f27379c1173 (diff)
downloadAntennaPod-99d68b2982516a5bdc88a2aeb57e58267291e05f.zip
Hide local menu items when nav drawer is shown
Diffstat (limited to 'src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java')
-rw-r--r--src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java b/src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java
index e75fa394a..7aa04d24c 100644
--- a/src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java
+++ b/src/de/danoeh/antennapod/util/menuhandler/MenuItemUtils.java
@@ -4,6 +4,7 @@ import android.support.v4.view.MenuItemCompat;
import android.support.v7.widget.SearchView;
import android.view.Menu;
import android.view.MenuItem;
+
import de.danoeh.antennapod.R;
/**
@@ -17,4 +18,14 @@ public class MenuItemUtils {
MenuItemCompat.setActionView(item, searchView);
return item;
}
+
+ /**
+ * Checks if the navigation drawer of the DrawerActivity is opened. This can be useful for Fragments
+ * that hide their menu if the navigation drawer is open.
+ *
+ * @return True if the drawer is open, false otherwise (also if the parameter is null)
+ */
+ public static boolean isActivityDrawerOpen(NavDrawerActivity activity) {
+ return activity != null && activity.isDrawerOpen();
+ }
}