本文整理匯總了Java中com.actionbarsherlock.internal.view.menu.ActionMenuPresenter類的典型用法代碼示例。如果您正苦於以下問題:Java ActionMenuPresenter類的具體用法?Java ActionMenuPresenter怎麽用?Java ActionMenuPresenter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ActionMenuPresenter類屬於com.actionbarsherlock.internal.view.menu包,在下文中一共展示了ActionMenuPresenter類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: InCallControls
import com.actionbarsherlock.internal.view.menu.ActionMenuPresenter; //導入依賴的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);
}
示例2: initControllerView
import com.actionbarsherlock.internal.view.menu.ActionMenuPresenter; //導入依賴的package包/類
private void initControllerView() {
photo = (ImageView) findViewById(R.id.contact_photo);
remoteName = (TextView) findViewById(R.id.contact_name_display_name);
remoteSipAddress = (TextView) findViewById(R.id.contact_name_sip_address);
elapsedTime = (Chronometer) findViewById(R.id.elapsedTime);
callStatusText = (TextView) findViewById(R.id.call_status_text);
callSecureBar = (ViewGroup) findViewById(R.id.call_secure_bar);
callSecureText = (TextView) findViewById(R.id.call_secure_text);
endCallBar = (ViewGroup) findViewById(R.id.end_call_bar);
View btn;
btn = findViewById(R.id.endButton);
btn.setOnClickListener(this);
btnMenuBuilder = new MenuBuilder(getContext());
btnMenuBuilder.setCallback(this);
MenuInflater inflater = new MenuInflater(getContext());
inflater.inflate(R.menu.in_call_card_menu, btnMenuBuilder);
mActionMenuPresenter = new ActionMenuPresenter(getContext());
mActionMenuPresenter.setReserveOverflow(true);
btnMenuBuilder.addMenuPresenter(mActionMenuPresenter);
updateMenuView();
}
示例3: isReservingOverflow
import com.actionbarsherlock.internal.view.menu.ActionMenuPresenter; //導入依賴的package包/類
/**
* Determine whether or not the device has a dedicated menu key.
*
* @return {@code true} if native menu key is present.
*/
private boolean isReservingOverflow() {
if (!mReserveOverflowSet) {
mReserveOverflow = ActionMenuPresenter.reserveOverflow(mActivity);
mReserveOverflowSet = true;
}
return mReserveOverflow;
}