move MENU_GO_HOME control to onPrepareOptionsMenu.
This is a special-snowflake menu entry which is only visible in one specific adapter. Let onPrepareOptionsMenu fully manage it to avoid clashes with SlidingPlaybackView's menu entry hider.
This commit is contained in:
1 parent
5a170ebfbd
commit
9ec67e28bf
2 files changed
+4
-2
No files matched your search
@@ -775,7 +775,9 @@ public class LibraryActivity
|
||||
{
|
||||
LibraryAdapter adapter = mCurrentAdapter;
|
||||
menu.findItem(MENU_GO_HOME).setVisible(
|
||||
adapter != null && adapter.getMediaType() == MediaUtils.TYPE_FILE);
|
||||
adapter != null &&
|
||||
adapter.getMediaType() == MediaUtils.TYPE_FILE &&
|
||||
!mSlidingView.isExpanded());
|
||||
return super.onPrepareOptionsMenu(menu);
|
||||
}
|
||||
|
||||
|
||||
@@ -332,7 +332,7 @@ public class SlidingPlaybackActivity extends PlaybackActivity
|
||||
|
||||
final int[] slide_visible = {MENU_HIDE_QUEUE, MENU_CLEAR_QUEUE, MENU_EMPTY_QUEUE, MENU_SAVE_QUEUE};
|
||||
final int[] slide_hidden = {MENU_SHOW_QUEUE, MENU_SORT, MENU_DELETE, MENU_ENQUEUE, MENU_MORE,
|
||||
MENU_ADD_TO_PLAYLIST, MENU_SHARE, MENU_GO_HOME};
|
||||
MENU_ADD_TO_PLAYLIST, MENU_SHARE};
|
||||
|
||||
for (int id : slide_visible) {
|
||||
MenuItem item = mMenu.findItem(id);
|
||||
|
||||
Reference in new issue
Block a user