From e7953958dab80aab3fea9f373da1fece19235dde Mon Sep 17 00:00:00 2001 From: Andrew Rabert Date: Tue, 3 Jul 2018 17:55:02 -0400 Subject: [PATCH] Consolidate now playing menu --- .../fragments/NowPlayingFragment.java | 7 +++-- app/src/main/res/menu/nowplaying_offline.xml | 31 ------------------- 2 files changed, 4 insertions(+), 34 deletions(-) delete mode 100644 app/src/main/res/menu/nowplaying_offline.xml diff --git a/app/src/main/java/net/nullsum/audinaut/fragments/NowPlayingFragment.java b/app/src/main/java/net/nullsum/audinaut/fragments/NowPlayingFragment.java index 4fdcfbd..99d4ab5 100644 --- a/app/src/main/java/net/nullsum/audinaut/fragments/NowPlayingFragment.java +++ b/app/src/main/java/net/nullsum/audinaut/fragments/NowPlayingFragment.java @@ -318,11 +318,12 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis @Override public void onCreateOptionsMenu(Menu menu, MenuInflater menuInflater) { DownloadService downloadService = getDownloadService(); + menuInflater.inflate(R.menu.nowplaying, menu); + if (Util.isOffline(context)) { - menuInflater.inflate(R.menu.nowplaying_offline, menu); - } else { - menuInflater.inflate(R.menu.nowplaying, menu); + menu.findItem(R.id.menu_save_playlist).setEnabled(false); } + if (downloadService != null && downloadService.isRemovePlayed()) { menu.findItem(R.id.menu_remove_played).setChecked(true); } diff --git a/app/src/main/res/menu/nowplaying_offline.xml b/app/src/main/res/menu/nowplaying_offline.xml deleted file mode 100644 index dd6e96c..0000000 --- a/app/src/main/res/menu/nowplaying_offline.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - -