FileDocCategorySizeDatePackage
StandaloneActionMode.javaAPI DocAndroid 5.1 API4502Thu Mar 12 22:22:56 GMT 2015android.support.v7.internal.view

StandaloneActionMode

public class StandaloneActionMode extends android.support.v7.view.ActionMode implements MenuBuilder.Callback
hide

Fields Summary
private android.content.Context
mContext
private android.support.v7.internal.widget.ActionBarContextView
mContextView
private ActionMode.Callback
mCallback
private WeakReference
mCustomView
private boolean
mFinished
private boolean
mFocusable
private android.support.v7.internal.view.menu.MenuBuilder
mMenu
Constructors Summary
public StandaloneActionMode(android.content.Context context, android.support.v7.internal.widget.ActionBarContextView view, ActionMode.Callback callback, boolean isFocusable)

        mContext = context;
        mContextView = view;
        mCallback = callback;

        mMenu = new MenuBuilder(context).setDefaultShowAsAction(MenuItem.SHOW_AS_ACTION_IF_ROOM);
        mMenu.setCallback(this);
        mFocusable = isFocusable;
    
Methods Summary
public voidfinish()

        if (mFinished) {
            return;
        }
        mFinished = true;

        mContextView.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
        mCallback.onDestroyActionMode(this);
    
public android.view.ViewgetCustomView()

        return mCustomView != null ? mCustomView.get() : null;
    
public android.view.MenugetMenu()

        return mMenu;
    
public android.view.MenuInflatergetMenuInflater()

        return new MenuInflater(mContext);
    
public java.lang.CharSequencegetSubtitle()

        return mContextView.getSubtitle();
    
public java.lang.CharSequencegetTitle()

        return mContextView.getTitle();
    
public voidinvalidate()

        mCallback.onPrepareActionMode(this, mMenu);
    
public booleanisTitleOptional()

        return mContextView.isTitleOptional();
    
public booleanisUiFocusable()

        return mFocusable;
    
public voidonCloseMenu(android.support.v7.internal.view.menu.MenuBuilder menu, boolean allMenusAreClosing)

    
public voidonCloseSubMenu(android.support.v7.internal.view.menu.SubMenuBuilder menu)

    
public booleanonMenuItemSelected(android.support.v7.internal.view.menu.MenuBuilder menu, android.view.MenuItem item)

        return mCallback.onActionItemClicked(this, item);
    
public voidonMenuModeChange(android.support.v7.internal.view.menu.MenuBuilder menu)

        invalidate();
        mContextView.showOverflowMenu();
    
public booleanonSubMenuSelected(android.support.v7.internal.view.menu.SubMenuBuilder subMenu)

        if (!subMenu.hasVisibleItems()) {
            return true;
        }

        new MenuPopupHelper(mContext, subMenu).show();
        return true;
    
public voidsetCustomView(android.view.View view)

        mContextView.setCustomView(view);
        mCustomView = view != null ? new WeakReference<View>(view) : null;
    
public voidsetSubtitle(java.lang.CharSequence subtitle)

        mContextView.setSubtitle(subtitle);
    
public voidsetSubtitle(int resId)

        setSubtitle(mContext.getString(resId));
    
public voidsetTitle(java.lang.CharSequence title)

        mContextView.setTitle(title);
    
public voidsetTitle(int resId)

        setTitle(mContext.getString(resId));
    
public voidsetTitleOptionalHint(boolean titleOptional)

        super.setTitleOptionalHint(titleOptional);
        mContextView.setTitleOptional(titleOptional);