本文整理汇总了Java中com.actionbarsherlock.internal.view.menu.MenuBuilder.setCallback方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBuilder.setCallback方法的具体用法?Java MenuBuilder.setCallback怎么用?Java MenuBuilder.setCallback使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.actionbarsherlock.internal.view.menu.MenuBuilder
的用法示例。
在下文中一共展示了MenuBuilder.setCallback方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializePanelMenu
import com.actionbarsherlock.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
private boolean initializePanelMenu() {
Context context = mActivity;//getContext();
// If we have an action bar, initialize the menu with a context themed for it.
if (wActionBar != null) {
TypedValue outValue = new TypedValue();
Resources.Theme currentTheme = context.getTheme();
currentTheme.resolveAttribute(R.attr.actionBarWidgetTheme,
outValue, true);
final int targetThemeRes = outValue.resourceId;
if (targetThemeRes != 0 /*&& context.getThemeResId() != targetThemeRes*/) {
context = new ContextThemeWrapper(context, targetThemeRes);
}
}
mMenu = new MenuBuilder(context);
mMenu.setCallback(this);
return true;
}
示例2: InCallControls
import com.actionbarsherlock.internal.view.menu.MenuBuilder; //导入方法依赖的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);
}
示例3: initControllerView
import com.actionbarsherlock.internal.view.menu.MenuBuilder; //导入方法依赖的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();
}