@Subscribe public void onOverflowButtonClickEvent(OverflowButtonClickEvent event) { if (DDGControlVar.mDuckDuckGoContainer.currentFragmentTag.equals(getTag()) && webMenu != null) { if (overflowMenu != null && overflowMenu.isShowing()) { return; } onPrepareOptionsMenu(webMenu); overflowMenu = new DDGOverflowMenu(getActivity()); overflowMenu.setHeaderMenu(headerMenu); overflowMenu.setMenu(webMenu); overflowMenu.setMenu(mainMenu, true); overflowMenu.show(event.anchor); } }
private void showMenu(View anchor, FeedObject feed) { if (feedMenu == null) { feedMenu = new DDGOverflowMenu(context); } if (!feedMenu.isShowing()) { if (DDGApplication.getDB().isSaved(feed.getId())) { menu.findItem(R.id.action_add_favorite).setVisible(false); menu.findItem(R.id.action_remove_favorite).setVisible(true); } else { menu.findItem(R.id.action_add_favorite).setVisible(true); menu.findItem(R.id.action_remove_favorite).setVisible(false); } feedMenu.setFeed(feed); feedMenu.setMenu(menu); feedMenu.showFeedMenu(anchor); } }
@Subscribe public void onWebViewOpenMenuEvent(WebViewOpenMenuEvent event) { if (webMenu != null) { onPrepareOptionsMenu(webMenu); if (overflowMenu != null && overflowMenu.isShowing()) { return; } overflowMenu = new DDGOverflowMenu(getActivity()); overflowMenu.setHeaderMenu(headerMenu); overflowMenu.setMenu(webMenu); overflowMenu.setMenu(mainMenu, true); overflowMenu.show(event.anchorView); } }
private void dismissMenu() { if (overflowMenu != null && overflowMenu.isShowing()) { overflowMenu.dismiss(); } }