FileDocCategorySizeDatePackage
ExtractEditLayout.javaAPI DocAndroid 5.1 API6014Thu Mar 12 22:22:10 GMT 2015android.inputmethodservice

ExtractEditLayout

public class ExtractEditLayout extends android.widget.LinearLayout
ExtractEditLayout provides an ActionMode presentation for the limited screen real estate in extract mode.
hide

Fields Summary
ExtractActionMode
mActionMode
android.widget.Button
mExtractActionButton
android.widget.Button
mEditButton
Constructors Summary
public ExtractEditLayout(android.content.Context context)

        super(context);
    
public ExtractEditLayout(android.content.Context context, android.util.AttributeSet attrs)

        super(context, attrs);
    
Methods Summary
public voidfinishActionMode()
Finishes a possibly started action mode.

        if (mActionMode != null) {
            mActionMode.finish();
        }
    
public booleanisActionModeStarted()

return
true if an action mode is currently active.

        return mActionMode != null;
    
public voidonFinishInflate()

        super.onFinishInflate();
        mExtractActionButton = (Button) findViewById(com.android.internal.R.id.inputExtractAction);
        mEditButton = (Button) findViewById(com.android.internal.R.id.inputExtractEditButton);
        mEditButton.setOnClickListener(new OnClickListener() {
            public void onClick(View clicked) {
                if (mActionMode != null) {
                    new MenuPopupHelper(getContext(), mActionMode.mMenu, clicked).show();
                }
            }
        });
    
public android.view.ActionModestartActionModeForChild(android.view.View sourceView, ActionMode.Callback cb)

        final ExtractActionMode mode = new ExtractActionMode(cb);
        if (mode.dispatchOnCreate()) {
            mode.invalidate();
            mExtractActionButton.setVisibility(INVISIBLE);
            mEditButton.setVisibility(VISIBLE);
            mActionMode = mode;
            sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
            return mode;
        }
        return null;