Consolidate now playing menu

This commit is contained in:
Andrew Rabert 2018-07-03 17:55:02 -04:00
parent 115f211e9f
commit e7953958da
2 changed files with 4 additions and 34 deletions

View File

@ -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);
}

View File

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:compat="http://schemas.android.com/apk/res-auto">
<item
android:id="@+id/menu_shuffle"
android:icon="?attr/shuffle"
android:title="@string/download.menu_shuffle"
compat:showAsAction="always|withText" />
<item
android:id="@+id/menu_remove_all"
android:icon="?attr/remove"
android:title="@string/download.menu_remove_all"
compat:showAsAction="ifRoom|withText" />
<item
android:id="@+id/menu_equalizer"
android:checkable="true"
android:title="@string/equalizer.label" />
<item
android:id="@+id/menu_batch_mode"
android:checkable="true"
android:title="@string/download.batch_mode" />
<item
android:id="@+id/menu_remove_played"
android:checkable="true"
android:title="@string/download.menu_remove_played_songs" />
</menu>