use of android.view.inputmethod.InputConnection in project android_frameworks_base by DirtyUnicorns.
the class InputMethodService method onExtractedReplaceText.
/**
* @hide
*/
public void onExtractedReplaceText(int start, int end, CharSequence text) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
conn.setComposingRegion(start, end);
conn.commitText(text, 1);
}
}
use of android.view.inputmethod.InputConnection in project android_frameworks_base by DirtyUnicorns.
the class InputMethodService method onExtractedSetSpan.
/**
* @hide
*/
public void onExtractedSetSpan(Object span, int start, int end, int flags) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
if (!conn.setSelection(start, end))
return;
CharSequence text = conn.getSelectedText(InputConnection.GET_TEXT_WITH_STYLES);
if (text instanceof Spannable) {
((Spannable) text).setSpan(span, 0, text.length(), flags);
conn.setComposingRegion(start, end);
conn.commitText(text, 1);
}
}
}
use of android.view.inputmethod.InputConnection in project wifikeyboard by IvanVolosyuk.
the class WiFiInputMethod method getText.
String getText() {
String text = "";
try {
InputConnection conn = getCurrentInputConnection();
ExtractedTextRequest req = new ExtractedTextRequest();
req.hintMaxChars = 1000000;
req.hintMaxLines = 10000;
req.flags = 0;
req.token = 1;
text = conn.getExtractedText(req, 0).text.toString();
} catch (Throwable t) {
}
return text;
}
use of android.view.inputmethod.InputConnection in project android_frameworks_base by ParanoidAndroid.
the class InputMethodService method onExtractedDeleteText.
/**
* @hide
*/
public void onExtractedDeleteText(int start, int end) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
conn.setSelection(start, start);
conn.deleteSurroundingText(0, end - start);
}
}
use of android.view.inputmethod.InputConnection in project android_frameworks_base by ParanoidAndroid.
the class InputMethodService method onExtractedReplaceText.
/**
* @hide
*/
public void onExtractedReplaceText(int start, int end, CharSequence text) {
InputConnection conn = getCurrentInputConnection();
if (conn != null) {
conn.setComposingRegion(start, end);
conn.commitText(text, 1);
}
}
Aggregations