public void initialize([email protected] itemData, int menuType ) { mItemData = itemData; initialize(itemData.getTitleForItemView(this), itemData.getIcon()); setVisibility(itemData.isVisible() ? android.view.View.VISIBLE : android.view.View .GONE); setEnabled(itemData.isEnabled()); }
protected internal override void drawableStateChanged() { base.drawableStateChanged(); if (mItemData != null && mIcon != null) { // When disabled, the not-focused state and the pressed state should // drop alpha on the icon bool isInAlphaState = !mItemData.isEnabled() && (isPressed() || !isFocused()); mIcon.setAlpha(isInAlphaState ? (int)(mDisabledAlpha * NO_ALPHA) : NO_ALPHA); } }
public virtual void initialize([email protected] itemData, int menuType) { mItemData = itemData; setIcon(itemData.getIcon()); setTitle(itemData.getTitleForItemView(this)); // Title only takes effect if there is no icon setId(itemData.getItemId()); setVisibility(itemData.isVisible() ? android.view.View.VISIBLE : android.view.View .GONE); setEnabled(itemData.isEnabled()); }
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()); }