From 066cab8da5a3189b77d74732a16ebfe74299725d Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Thu, 15 Jan 2015 12:22:27 +0100 Subject: Moved updateRefreshMenuItem into core package --- .../antennapod/menuhandler/MenuItemUtils.java | 27 +--------------------- 1 file changed, 1 insertion(+), 26 deletions(-) (limited to 'app/src/main/java/de') 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(); - } } -- cgit v1.2.3