diff options
author | ByteHamster <info@bytehamster.com> | 2022-08-28 15:55:37 +0200 |
---|---|---|
committer | ByteHamster <info@bytehamster.com> | 2022-08-28 16:02:21 +0200 |
commit | 4c88a1aa69b698284ab0f70e55f059bcd514e654 (patch) | |
tree | 79332816b5c70eab82ae76eb42976aec57408563 /core/src | |
parent | 0bf6f2f1fdeb5dc8eac20f5d12136e3fbbc9f044 (diff) | |
parent | 2f6fb3ffd5335e326689a34e5bf3b57dd19d8f1c (diff) | |
download | AntennaPod-4c88a1aa69b698284ab0f70e55f059bcd514e654.zip |
Merge branch 'master' into develop
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/main/java/de/danoeh/antennapod/core/menuhandler/MenuItemUtils.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/core/src/main/java/de/danoeh/antennapod/core/menuhandler/MenuItemUtils.java b/core/src/main/java/de/danoeh/antennapod/core/menuhandler/MenuItemUtils.java index cfa35ea29..3b9d6a08d 100644 --- a/core/src/main/java/de/danoeh/antennapod/core/menuhandler/MenuItemUtils.java +++ b/core/src/main/java/de/danoeh/antennapod/core/menuhandler/MenuItemUtils.java @@ -11,31 +11,21 @@ import de.danoeh.antennapod.core.R; public class MenuItemUtils { /** - * 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 the progress bar will be hidden. - * * @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) { + public static void updateRefreshMenuItem(Menu menu, int resId, boolean isRefreshing) { // expand actionview if feeds are being downloaded, collapse otherwise MenuItem refreshItem = menu.findItem(resId); - if (checker.isRefreshing()) { - refreshItem.setActionView(R.layout.refresh_action_view); - return true; + if (isRefreshing) { + if (refreshItem.getActionView() == null) { + refreshItem.setActionView(R.layout.refresh_action_view); + } } else { refreshItem.setActionView(null); - return false; } } - public interface UpdateRefreshMenuItemChecker { - boolean isRefreshing(); - } - /** * When pressing a context menu item, Android calls onContextItemSelected * for ALL fragments in arbitrary order, not just for the fragment that the |