本文整理匯總了Java中android.support.v7.view.ActionMode.getMenu方法的典型用法代碼示例。如果您正苦於以下問題:Java ActionMode.getMenu方法的具體用法?Java ActionMode.getMenu怎麽用?Java ActionMode.getMenu使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v7.view.ActionMode
的用法示例。
在下文中一共展示了ActionMode.getMenu方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: initForMode
import android.support.v7.view.ActionMode; //導入方法依賴的package包/類
public void initForMode(final ActionMode mode) {
if (this.mClose == null) {
this.mClose = LayoutInflater.from(getContext()).inflate(this.mCloseItemLayout, this, false);
addView(this.mClose);
} else if (this.mClose.getParent() == null) {
addView(this.mClose);
}
this.mClose.findViewById(R.id.action_mode_close_button).setOnClickListener(new OnClickListener() {
public void onClick(View v) {
mode.finish();
}
});
MenuBuilder menu = (MenuBuilder) mode.getMenu();
if (this.mActionMenuPresenter != null) {
this.mActionMenuPresenter.dismissPopupMenus();
}
this.mActionMenuPresenter = new ActionMenuPresenter(getContext());
this.mActionMenuPresenter.setReserveOverflow(true);
LayoutParams layoutParams = new LayoutParams(-2, -1);
menu.addMenuPresenter(this.mActionMenuPresenter, this.mPopupContext);
this.mMenuView = (ActionMenuView) this.mActionMenuPresenter.getMenuView(this);
this.mMenuView.setBackgroundDrawable(null);
addView(this.mMenuView, layoutParams);
}