SpannableStringBuilder.GetTextRunCursor Method

Definition

Caution

deprecated

Returns the next cursor position in the run.

[Android.Runtime.Register("getTextRunCursor", "(IIIIILandroid/graphics/Paint;)I", "GetGetTextRunCursor_IIIIILandroid_graphics_Paint_Handler")]
[System.Obsolete("deprecated")]
public virtual int GetTextRunCursor (int contextStart, int contextEnd, int dir, int offset, int cursorOpt, Android.Graphics.Paint? p);
[<Android.Runtime.Register("getTextRunCursor", "(IIIIILandroid/graphics/Paint;)I", "GetGetTextRunCursor_IIIIILandroid_graphics_Paint_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member GetTextRunCursor : int * int * int * int * int * Android.Graphics.Paint -> int
override this.GetTextRunCursor : int * int * int * int * int * Android.Graphics.Paint -> int

Parameters

contextStart
Int32

the start index of the context

contextEnd
Int32

the (non-inclusive) end index of the context

dir
Int32

1 if the run is RTL, otherwise 0

offset
Int32

the cursor position to move from

cursorOpt
Int32

how to move the cursor, one of CURSOR_AFTER, CURSOR_AT_OR_AFTER, CURSOR_BEFORE, CURSOR_AT_OR_BEFORE, or CURSOR_AT

p
Paint

the Paint object that is requesting this information

Returns

the offset of the next position, or -1

Attributes

Remarks

Returns the next cursor position in the run. This avoids placing the cursor between surrogates, between characters that form conjuncts, between base characters and combining marks, or within a reordering cluster.

The context is the shaping context for cursor movement, generally the bounds of the metric span enclosing the cursor in the direction of movement. contextStart, contextEnd and offset are relative to the start of the string.

If cursorOpt is CURSOR_AT and the offset is not a valid cursor position, this returns -1. Otherwise this will never return a value before contextStart or after contextEnd.

This member is deprecated. This is an internal method, refrain from using it in your code

Java documentation for android.text.SpannableStringBuilder.getTextRunCursor(int, int, int, int, int, android.graphics.Paint).

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.

Applies to