FileDocCategorySizeDatePackage
StandaloneActionMode.javaAPI DocAndroid 5.1 API4440Thu Mar 12 22:22:10 GMT 2015com.android.internal.view

StandaloneActionMode

public class StandaloneActionMode extends android.view.ActionMode implements MenuBuilder.Callback

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

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

        mMenu = new MenuBuilder(view.getContext()).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(mContextView.getContext());
    
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(com.android.internal.view.menu.MenuBuilder menu, boolean allMenusAreClosing)

    
public voidonCloseSubMenu(com.android.internal.view.menu.SubMenuBuilder menu)

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

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

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

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

        new MenuPopupHelper(mContextView.getContext(), 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);