本文整理汇总了Java中android.support.v7.internal.view.menu.MenuBuilder.addMenuPresenter方法的典型用法代码示例。如果您正苦于以下问题:Java MenuBuilder.addMenuPresenter方法的具体用法?Java MenuBuilder.addMenuPresenter怎么用?Java MenuBuilder.addMenuPresenter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v7.internal.view.menu.MenuBuilder
的用法示例。
在下文中一共展示了MenuBuilder.addMenuPresenter方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
void setMenu(MenuBuilder menubuilder)
{
if (menubuilder != menu)
{
if (menu != null)
{
menu.removeMenuPresenter(listMenuPresenter);
}
menu = menubuilder;
if (menubuilder != null && listMenuPresenter != null)
{
menubuilder.addMenuPresenter(listMenuPresenter);
return;
}
}
}
示例2: setMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
final void setMenu(MenuBuilder paramMenuBuilder)
{
if (paramMenuBuilder == this.menu) {}
do
{
return;
if (this.menu != null) {
this.menu.removeMenuPresenter(this.listMenuPresenter);
}
this.menu = paramMenuBuilder;
} while ((paramMenuBuilder == null) || (this.listMenuPresenter == null));
paramMenuBuilder.addMenuPresenter(this.listMenuPresenter);
}
示例3: initForMode
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
public final void initForMode(final ActionMode paramActionMode)
{
if (this.mClose == null)
{
this.mClose = LayoutInflater.from(getContext()).inflate(this.mCloseItemLayout, this, false);
addView(this.mClose);
}
for (;;)
{
this.mClose.findViewById(R.id.action_mode_close_button).setOnClickListener(new View.OnClickListener()
{
public final void onClick(View paramAnonymousView)
{
paramActionMode.finish();
}
});
MenuBuilder localMenuBuilder = (MenuBuilder)paramActionMode.getMenu();
if (this.mActionMenuPresenter != null) {
this.mActionMenuPresenter.dismissPopupMenus();
}
this.mActionMenuPresenter = new ActionMenuPresenter(getContext());
this.mActionMenuPresenter.setReserveOverflow$1385ff();
ViewGroup.LayoutParams localLayoutParams = new ViewGroup.LayoutParams(-2, -1);
localMenuBuilder.addMenuPresenter(this.mActionMenuPresenter, this.mPopupContext);
this.mMenuView = ((ActionMenuView)this.mActionMenuPresenter.getMenuView(this));
this.mMenuView.setBackgroundDrawable(null);
addView(this.mMenuView, localLayoutParams);
return;
if (this.mClose.getParent() == null) {
addView(this.mClose);
}
}
}
示例4: ensureMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
private void ensureMenu()
{
ensureMenuView();
if (this.mMenuView.mMenu == null)
{
MenuBuilder localMenuBuilder = (MenuBuilder)this.mMenuView.getMenu();
if (this.mExpandedMenuPresenter == null) {
this.mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter((byte)0);
}
this.mMenuView.setExpandedActionViewsExclusive(true);
localMenuBuilder.addMenuPresenter(this.mExpandedMenuPresenter, this.mPopupContext);
}
}
示例5: ensureMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
private void ensureMenu()
{
ensureMenuView();
if (mMenuView.peekMenu() == null)
{
MenuBuilder menubuilder = (MenuBuilder)mMenuView.getMenu();
if (mExpandedMenuPresenter == null)
{
mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter();
}
mMenuView.setExpandedActionViewsExclusive(true);
menubuilder.addMenuPresenter(mExpandedMenuPresenter, mPopupContext);
}
}
示例6: setMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
public void setMenu(MenuBuilder menubuilder, ActionMenuPresenter actionmenupresenter)
{
if (menubuilder != null || mMenuView != null)
{
ensureMenuView();
MenuBuilder menubuilder1 = mMenuView.peekMenu();
if (menubuilder1 != menubuilder)
{
if (menubuilder1 != null)
{
menubuilder1.removeMenuPresenter(mOuterActionMenuPresenter);
menubuilder1.removeMenuPresenter(mExpandedMenuPresenter);
}
if (mExpandedMenuPresenter == null)
{
mExpandedMenuPresenter = new ExpandedActionViewMenuPresenter();
}
actionmenupresenter.setExpandedActionViewsExclusive(true);
if (menubuilder != null)
{
menubuilder.addMenuPresenter(actionmenupresenter, mPopupContext);
menubuilder.addMenuPresenter(mExpandedMenuPresenter, mPopupContext);
} else
{
actionmenupresenter.initForMenu(mPopupContext, null);
mExpandedMenuPresenter.initForMenu(mPopupContext, null);
actionmenupresenter.updateMenuView(true);
mExpandedMenuPresenter.updateMenuView(true);
}
mMenuView.setPopupTheme(mPopupTheme);
mMenuView.setPresenter(actionmenupresenter);
mOuterActionMenuPresenter = actionmenupresenter;
return;
}
}
}
示例7: setMenu
import android.support.v7.internal.view.menu.MenuBuilder; //导入方法依赖的package包/类
public final void setMenu(Menu paramMenu, MenuPresenter.Callback paramCallback)
{
if (this.mActionMenuPresenter == null)
{
this.mActionMenuPresenter = new ActionMenuPresenter(this.mToolbar.getContext());
this.mActionMenuPresenter.mId = R.id.action_menu_presenter;
}
this.mActionMenuPresenter.mCallback = paramCallback;
Toolbar localToolbar = this.mToolbar;
MenuBuilder localMenuBuilder1 = (MenuBuilder)paramMenu;
ActionMenuPresenter localActionMenuPresenter = this.mActionMenuPresenter;
if ((localMenuBuilder1 != null) || (localToolbar.mMenuView != null))
{
localToolbar.ensureMenuView();
MenuBuilder localMenuBuilder2 = localToolbar.mMenuView.mMenu;
if (localMenuBuilder2 != localMenuBuilder1)
{
if (localMenuBuilder2 != null)
{
localMenuBuilder2.removeMenuPresenter(localToolbar.mOuterActionMenuPresenter);
localMenuBuilder2.removeMenuPresenter(localToolbar.mExpandedMenuPresenter);
}
if (localToolbar.mExpandedMenuPresenter == null) {
localToolbar.mExpandedMenuPresenter = new Toolbar.ExpandedActionViewMenuPresenter(localToolbar, (byte)0);
}
localActionMenuPresenter.mExpandedActionViewsExclusive = true;
if (localMenuBuilder1 == null) {
break label197;
}
localMenuBuilder1.addMenuPresenter(localActionMenuPresenter, localToolbar.mPopupContext);
localMenuBuilder1.addMenuPresenter(localToolbar.mExpandedMenuPresenter, localToolbar.mPopupContext);
}
}
for (;;)
{
localToolbar.mMenuView.setPopupTheme(localToolbar.mPopupTheme);
localToolbar.mMenuView.setPresenter(localActionMenuPresenter);
localToolbar.mOuterActionMenuPresenter = localActionMenuPresenter;
return;
label197:
localActionMenuPresenter.initForMenu(localToolbar.mPopupContext, null);
localToolbar.mExpandedMenuPresenter.initForMenu(localToolbar.mPopupContext, null);
localActionMenuPresenter.updateMenuView(true);
localToolbar.mExpandedMenuPresenter.updateMenuView(true);
}
}