コード例 #1
0
 public virtual void initialize([email protected] itemData,
                                int menuType)
 {
     mItemData = itemData;
     mMenuType = menuType;
     setVisibility(itemData.isVisible() ? android.view.View.VISIBLE : android.view.View
                   .GONE);
     setTitle(itemData.getTitleForItemView(this));
     setCheckable(itemData.isCheckable());
     setShortcut(itemData.shouldShowShortcut(), itemData.getShortcut());
     setIcon(itemData.getIcon());
     setEnabled(itemData.isEnabled());
 }
コード例 #2
0
        public virtual void setShortcut(bool showShortcut, char shortcutKey)
        {
            int newVisibility = (showShortcut && mItemData.shouldShowShortcut()) ? VISIBLE :
                                GONE;

            if (newVisibility == VISIBLE)
            {
                mShortcutView.setText(java.lang.CharSequenceProxy.Wrap(mItemData.getShortcutLabel
                                                                           ()));
            }
            if (mShortcutView.getVisibility() != newVisibility)
            {
                mShortcutView.setVisibility(newVisibility);
            }
        }
コード例 #3
0
 internal void setCaptionMode(bool shortcut)
 {
     if (mItemData == null)
     {
         return;
     }
     mShortcutCaptionMode = shortcut && (mItemData.shouldShowShortcut());
     java.lang.CharSequence text = mItemData.getTitleForItemView(this);
     if (mShortcutCaptionMode)
     {
         if (mShortcutCaption == null)
         {
             mShortcutCaption = mItemData.getShortcutLabel();
         }
         text = java.lang.CharSequenceProxy.Wrap(mShortcutCaption);
     }
     setText(text);
 }