@Override public void setTitle(CharSequence title) { if (title != null) { mTitleView.setText(title); if (mTitleView.getVisibility() != View.VISIBLE) { mTitleView.setVisibility(View.VISIBLE); } } else { if (mTitleView.getVisibility() != View.GONE) { mTitleView.setVisibility(View.GONE); } } }
@Override public void setShortcut(boolean showShortcut, char shortcutKey) { final int newVisibility = showShortcut && mItemData.shouldShowShortcut() ? View.VISIBLE : View.GONE; if (newVisibility == View.VISIBLE) { mShortcutView.setText(mItemData.getShortcutLabel()); } if (mShortcutView.getVisibility() != newVisibility) { mShortcutView.setVisibility(newVisibility); } }