BaseInputConnection.SetComposingRegion(Int32, Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Mark a certain region of text as composing text.
[Android.Runtime.Register("setComposingRegion", "(II)Z", "GetSetComposingRegion_IIHandler")]
public virtual bool SetComposingRegion(int start, int end);
[<Android.Runtime.Register("setComposingRegion", "(II)Z", "GetSetComposingRegion_IIHandler")>]
abstract member SetComposingRegion : int * int -> bool
override this.SetComposingRegion : int * int -> bool
Parameters
- start
- Int32
the position in the text at which the composing region begins
- end
- Int32
the position in the text at which the composing region ends
Returns
The default implementation returns true, even when no editable buffer is available.
Implements
- Attributes
Remarks
Mark a certain region of text as composing text. If there was a composing region, the composing span is removed, as if finishComposingText() has been called. Outside fallback mode, the characters are left as they were. The default style for composing text is used.
The passed indices are clipped to the contents bounds. If the resulting region is zero-sized, no region is marked and the effect is the same as that of calling finishComposingText(). The order of start and end is not important. In effect, the region from start to end and the region from end to start is the same. Editor authors, be ready to accept a start that is greater than end.
Outside fallback mode, this does not change the contents of the text, so editors should not call InputMethodManager.updateSelection(android.view.View,int,int,int,int) and IMEs should not receive InputMethodService.onUpdateSelection(int, int, int, int, int, int).
Outside fallback mode, this has no impact on the cursor/selection position. It may result in the cursor being anywhere inside or outside the composing region, including cases where the selection and the composing region overlap partially or entirely. In fallback mode, the default implementation may send the current text as key events and clear the editable buffer.
Android reference for android.view.inputmethod.BaseInputConnection.setComposingRegion.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.