summaryrefslogtreecommitdiff
path: root/app/src/main/java/de
diff options
context:
space:
mode:
authordaniel oeh <daniel.oeh@gmail.com>2015-01-15 12:22:27 +0100
committerdaniel oeh <daniel.oeh@gmail.com>2015-01-15 12:22:27 +0100
commit066cab8da5a3189b77d74732a16ebfe74299725d (patch)
tree48a2aa9ca6f30f2a3331f16cb0eb27e6b7bc63f8 /app/src/main/java/de
parent18bc827ed2d38ad996106c954d43339b2d3136d2 (diff)
downloadAntennaPod-066cab8da5a3189b77d74732a16ebfe74299725d.zip
Moved updateRefreshMenuItem into core package
Diffstat (limited to 'app/src/main/java/de')
-rw-r--r--app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java27
1 files changed, 1 insertions, 26 deletions
diff --git a/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
index a1e666df0..05d6ded4d 100644
--- a/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
+++ b/app/src/main/java/de/danoeh/antennapod/menuhandler/MenuItemUtils.java
@@ -10,7 +10,7 @@ import de.danoeh.antennapod.core.R;
/**
* Utilities for menu items
*/
-public class MenuItemUtils {
+public class MenuItemUtils extends de.danoeh.antennapod.core.menuhandler.MenuItemUtils {
public static MenuItem addSearchItem(Menu menu, SearchView searchView) {
MenuItem item = menu.add(Menu.NONE, R.id.search_item, Menu.NONE, R.string.search_label);
@@ -28,29 +28,4 @@ public class MenuItemUtils {
public static boolean isActivityDrawerOpen(NavDrawerActivity activity) {
return activity != null && activity.isDrawerOpen();
}
-
- /**
- * Changes the appearance of a MenuItem depending on whether the given UpdateRefreshMenuItemChecker
- * is refreshing or not. If it returns true, the menu item will be replaced by an indeterminate progress
- * bar, otherwise nothing will happen.
- *
- * @param menu The menu that the MenuItem belongs to
- * @param resId The id of the MenuItem
- * @param checker Is used for checking whether to show the progress indicator or not.
- * @return The returned value of the UpdateRefreshMenuItemChecker's isRefreshing() method.
- */
- public static boolean updateRefreshMenuItem(Menu menu, int resId, UpdateRefreshMenuItemChecker checker) {
- // expand actionview if feeds are being downloaded, collapse otherwise
- if (checker.isRefreshing()) {
- MenuItem refreshItem = menu.findItem(resId);
- MenuItemCompat.setActionView(refreshItem, de.danoeh.antennapod.R.layout.refresh_action_view);
- return true;
- } else {
- return false;
- }
- }
-
- public static interface UpdateRefreshMenuItemChecker {
- public boolean isRefreshing();
- }
}