1

I can't find a screenshot anywhere - but essentially, when I select text from an EditText on Android (4.0+, I think), a small white bubble saying REPLACE pops up, to allow me to replace the text with other predictions. The same kind of bubble pops up saying PASTE when I long press a field. What class is this? I can't seem to find any reference to it in the developer docs; could somebody help me out?

If it's just a custom view, where is it instantiated? I'd like to write an Xposed module that requires this method, but I'm damned if I can find it.

Thanks!

vinit_ivar
  • 610
  • 6
  • 16

1 Answers1

0

You want to get rid of this one?

Text selection handle with paste menu

The PASTE/REPLACE menu code is in the show() method of the (non-documented) android.widget.Editor class:

    public void show() {
        boolean canPaste = mTextView.canPaste();
        boolean canSuggest = mTextView.isSuggestionsEnabled() && isCursorInsideSuggestionSpan();
        mPasteTextView.setVisibility(canPaste ? View.VISIBLE : View.GONE);
        mReplaceTextView.setVisibility(canSuggest ? View.VISIBLE : View.GONE);

        if (!canPaste && !canSuggest) return;

        super.show();
    }

Related: https://stackoverflow.com/a/28893714/3063884

Community
  • 1
  • 1
CJBS
  • 15,147
  • 6
  • 86
  • 135