/** * Set the viewswitcher of cover/playlist view to the requested state. * * @param view the view which should be displayed. */ public void setViewSwitcherStatus(NowPlayingDragStatusReceiver.VIEW_SWITCHER_STATUS view) { int color = 0; switch (view) { case COVER_VIEW: // change the view only if the requested view is not displayed if (mViewSwitcher.getCurrentView() != mCoverImage) { mViewSwitcher.showNext(); } color = ThemeUtils.getThemeColor(getContext(), R.attr.odyssey_color_text_accent); TooltipCompat.setTooltipText(mTopPlaylistButton, getResources().getString(R.string.action_npv_show_playlist)); break; case PLAYLIST_VIEW: // change the view only if the requested view is not displayed if (mViewSwitcher.getCurrentView() != mPlaylistView) { mViewSwitcher.showNext(); } color = ThemeUtils.getThemeColor(getContext(), R.attr.colorAccent); TooltipCompat.setTooltipText(mTopPlaylistButton, getResources().getString(R.string.action_npv_show_cover)); break; } // tint the button according to the requested view mTopPlaylistButton.setImageTintList(ColorStateList.valueOf(color)); }
TooltipCompat.setTooltipText(mTopPlaylistButton, getResources().getString(R.string.action_npv_show_playlist)); TooltipCompat.setTooltipText(topMenuButton, getResources().getString(R.string.action_npv_more_options));
@Override public void initialize(MenuItemImpl itemData, int menuType) { mItemData = itemData; setVisibility(itemData.isVisible() ? VISIBLE : GONE); if (getBackground() == null) { ViewCompat.setBackground(this, createDefaultBackground()); } setCheckable(itemData.isCheckable()); setChecked(itemData.isChecked()); setEnabled(itemData.isEnabled()); setTitle(itemData.getTitle()); setIcon(itemData.getIcon()); setActionView(itemData.getActionView()); setContentDescription(itemData.getContentDescription()); TooltipCompat.setTooltipText(this, itemData.getTooltipText()); adjustAppearance(); }