當前位置: 首頁>>代碼示例>>Java>>正文


Java MenuItemImpl類代碼示例

本文整理匯總了Java中com.actionbarsherlock.internal.view.menu.MenuItemImpl的典型用法代碼示例。如果您正苦於以下問題:Java MenuItemImpl類的具體用法?Java MenuItemImpl怎麽用?Java MenuItemImpl使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


MenuItemImpl類屬於com.actionbarsherlock.internal.view.menu包,在下文中一共展示了MenuItemImpl類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: expandItemActionView

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean expandItemActionView(MenuBuilder menu, MenuItemImpl item) {
    mExpandedActionView = item.getActionView();
    mExpandedHomeLayout.setIcon(mIcon.getConstantState().newDrawable(/* TODO getResources() */));
    mCurrentExpandedItem = item;
    if (mExpandedActionView.getParent() != ActionBarView.this) {
        addView(mExpandedActionView);
    }
    if (mExpandedHomeLayout.getParent() != ActionBarView.this) {
        addView(mExpandedHomeLayout);
    }
    mHomeLayout.setVisibility(GONE);
    if (mTitleLayout != null) mTitleLayout.setVisibility(GONE);
    if (mTabScrollView != null) mTabScrollView.setVisibility(GONE);
    if (mSpinner != null) mSpinner.setVisibility(GONE);
    if (mCustomNavView != null) mCustomNavView.setVisibility(GONE);
    requestLayout();
    item.setActionViewExpanded(true);

    if (mExpandedActionView instanceof CollapsibleActionView) {
        ((CollapsibleActionView) mExpandedActionView).onActionViewExpanded();
    }

    return true;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:26,代碼來源:ActionBarView.java

示例2: InCallControls

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
public InCallControls(Context context, AttributeSet attrs, int style) {
    super(context, attrs, style);
    
    if(!isInEditMode()) {
        supportMultipleCalls = SipConfigManager.getPreferenceBooleanValue(getContext(), SipConfigManager.SUPPORT_MULTIPLE_CALLS, false);
    }
    
    final LayoutParams layoutParams = new LayoutParams(LayoutParams.MATCH_PARENT,
            (int) getResources().getDimension(R.dimen.incall_bottom_bar_height));
    ActionMenuPresenter mActionMenuPresenter = new ActionMenuPresenter(getContext()) {
        public void bindItemView(MenuItemImpl item, MenuView.ItemView itemView) {
            super.bindItemView(item, itemView);
            View actionItemView = (View) itemView;
            actionItemView.setBackgroundResource(R.drawable.btn_compound_background);
        }
    };
    mActionMenuPresenter.setReserveOverflow(true);
    // Full width
    mActionMenuPresenter.setWidthLimit(
            getContext().getResources().getDisplayMetrics().widthPixels, true);
    // We use width limit, no need to limit items.
    mActionMenuPresenter.setItemLimit(20);
    btnMenuBuilder = new MenuBuilder(getContext());
    btnMenuBuilder.setCallback(this);
    MenuInflater inflater = new MenuInflater(getContext());
    inflater.inflate(R.menu.in_call_controls_menu, btnMenuBuilder);
    btnMenuBuilder.addMenuPresenter(mActionMenuPresenter);
    ActionMenuView menuView = (ActionMenuView) mActionMenuPresenter.getMenuView(this);
    menuView.setBackgroundResource(R.drawable.abs__ab_bottom_transparent_dark_holo);
    
    this.addView(menuView, layoutParams);
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:33,代碼來源:InCallControls.java

示例3: dispatchPrepareOptionsMenu

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu);

    if (mActionMode != null) {
        return false;
    }

    mMenuIsPrepared = false;
    if (!preparePanel()) {
        return false;
    }

    if (isReservingOverflow()) {
        return false;
    }

    if (mNativeItemMap == null) {
        mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>();
    } else {
        mNativeItemMap.clear();
    }

    if (mMenu == null) {
        return false;
    }

    boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap);
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result);
    return result;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:32,代碼來源:ActionBarSherlockCompat.java

示例4: onMenuItemClick

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean onMenuItemClick(android.view.MenuItem item) {
    if (ActionBarSherlock.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item);

    final MenuItemImpl sherlockItem = mNativeItemMap.get(item);
    if (sherlockItem != null) {
        sherlockItem.invoke();
    } else {
        Log.e(TAG, "Options item \"" + item + "\" not found in mapping");
    }

    return true; //Do not allow continuation of native handling
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:14,代碼來源:ActionBarSherlockCompat.java

示例5: onClick

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public void onClick(View v) {
    final MenuItemImpl item = mExpandedMenuPresenter.mCurrentExpandedItem;
    if (item != null) {
        item.collapseActionView();
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:ActionBarView.java

示例6: collapseActionView

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
public void collapseActionView() {
    final MenuItemImpl item = mExpandedMenuPresenter == null ? null :
            mExpandedMenuPresenter.mCurrentExpandedItem;
    if (item != null) {
        item.collapseActionView();
    }
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:8,代碼來源:ActionBarView.java

示例7: collapseItemActionView

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean collapseItemActionView(MenuBuilder menu, MenuItemImpl item) {
    // Do this before detaching the actionview from the hierarchy, in case
    // it needs to dismiss the soft keyboard, etc.
    if (mExpandedActionView instanceof CollapsibleActionView) {
        ((CollapsibleActionView) mExpandedActionView).onActionViewCollapsed();
    }

    removeView(mExpandedActionView);
    removeView(mExpandedHomeLayout);
    mExpandedActionView = null;
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_HOME) != 0) {
        mHomeLayout.setVisibility(VISIBLE);
    }
    if ((mDisplayOptions & ActionBar.DISPLAY_SHOW_TITLE) != 0) {
        if (mTitleLayout == null) {
            initTitle();
        } else {
            mTitleLayout.setVisibility(VISIBLE);
        }
    }
    if (mTabScrollView != null && mNavigationMode == ActionBar.NAVIGATION_MODE_TABS) {
        mTabScrollView.setVisibility(VISIBLE);
    }
    if (mSpinner != null && mNavigationMode == ActionBar.NAVIGATION_MODE_LIST) {
        mSpinner.setVisibility(VISIBLE);
    }
    if (mCustomNavView != null && (mDisplayOptions & ActionBar.DISPLAY_SHOW_CUSTOM) != 0) {
        mCustomNavView.setVisibility(VISIBLE);
    }
    mExpandedHomeLayout.setIcon(null);
    mCurrentExpandedItem = null;
    requestLayout();
    item.setActionViewExpanded(false);

    return true;
}
 
開發者ID:treasure-lau,項目名稱:CSipSimple,代碼行數:38,代碼來源:ActionBarView.java

示例8: dispatchPrepareOptionsMenu

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean dispatchPrepareOptionsMenu(android.view.Menu menu) {
    if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] android.view.Menu: " + menu);

    if (mActionMode != null) {
        return false;
    }

    mMenuIsPrepared = false;
    if (!preparePanel()) {
        return false;
    }

    if (isReservingOverflow()) {
        return false;
    }

    if (mNativeItemMap == null) {
        mNativeItemMap = new HashMap<android.view.MenuItem, MenuItemImpl>();
    } else {
        mNativeItemMap.clear();
    }

    if (mMenu == null) {
        return false;
    }

    boolean result = mMenu.bindNativeOverflow(menu, this, mNativeItemMap);
    if (BuildConfig.DEBUG) Log.d(TAG, "[dispatchPrepareOptionsMenu] returning " + result);
    return result;
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:32,代碼來源:ActionBarSherlockCompat.java

示例9: onMenuItemClick

import com.actionbarsherlock.internal.view.menu.MenuItemImpl; //導入依賴的package包/類
@Override
public boolean onMenuItemClick(android.view.MenuItem item) {
    if (BuildConfig.DEBUG) Log.d(TAG, "[mNativeItemListener.onMenuItemClick] item: " + item);

    final MenuItemImpl sherlockItem = mNativeItemMap.get(item);
    if (sherlockItem != null) {
        sherlockItem.invoke();
    } else {
        Log.e(TAG, "Options item \"" + item + "\" not found in mapping");
    }

    return true; //Do not allow continuation of native handling
}
 
開發者ID:ivanovpv,項目名稱:darksms,代碼行數:14,代碼來源:ActionBarSherlockCompat.java


注:本文中的com.actionbarsherlock.internal.view.menu.MenuItemImpl類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。