CursorAnchorInfo.Builder
public
static
final
class
CursorAnchorInfo.Builder
extends Object
Builder for CursorAnchorInfo
. This class is not designed to be thread-safe.
Summary
Public methods |
CursorAnchorInfo.Builder
|
addCharacterBounds(int index, float left, float top, float right, float bottom, int flags)
Adds the bounding box of the character specified with the index.
|
CursorAnchorInfo
|
build()
|
void
|
reset()
Resets the internal state so that this instance can be reused to build another
instance of CursorAnchorInfo .
|
CursorAnchorInfo.Builder
|
setComposingText(int composingTextStart, CharSequence composingText)
Sets the text range of the composing text.
|
CursorAnchorInfo.Builder
|
setInsertionMarkerLocation(float horizontalPosition, float lineTop, float lineBaseline, float lineBottom, int flags)
Sets the location of the text insertion point (zero width cursor) as a rectangle in
local coordinates.
|
CursorAnchorInfo.Builder
|
setMatrix(Matrix matrix)
Sets the matrix that transforms local coordinates into screen coordinates.
|
CursorAnchorInfo.Builder
|
setSelectionRange(int newStart, int newEnd)
Sets the text range of the selection.
|
Inherited methods |
From
class
java.lang.Object
Object
|
clone()
Creates and returns a copy of this object.
|
boolean
|
equals(Object obj)
Indicates whether some other object is "equal to" this one.
|
void
|
finalize()
Called by the garbage collector on an object when garbage collection
determines that there are no more references to the object.
|
final
Class<?>
|
getClass()
Returns the runtime class of this Object .
|
int
|
hashCode()
Returns a hash code value for the object.
|
final
void
|
notify()
Wakes up a single thread that is waiting on this object's
monitor.
|
final
void
|
notifyAll()
Wakes up all threads that are waiting on this object's monitor.
|
String
|
toString()
Returns a string representation of the object.
|
final
void
|
wait(long millis, int nanos)
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object, or
some other thread interrupts the current thread, or a certain
amount of real time has elapsed.
|
final
void
|
wait(long millis)
Causes the current thread to wait until either another thread invokes the
notify() method or the
notifyAll() method for this object, or a
specified amount of time has elapsed.
|
final
void
|
wait()
Causes the current thread to wait until another thread invokes the
notify() method or the
notifyAll() method for this object.
|
|
Public constructors
CursorAnchorInfo.Builder
CursorAnchorInfo.Builder ()
Public methods
addCharacterBounds
CursorAnchorInfo.Builder addCharacterBounds (int index,
float left,
float top,
float right,
float bottom,
int flags)
Adds the bounding box of the character specified with the index.
Parameters |
index |
int :
index of the character in Java chars units. Must be specified in
ascending order across successive calls. |
left |
float :
x coordinate of the left edge of the character in local coordinates. |
top |
float :
y coordinate of the top edge of the character in local coordinates. |
right |
float :
x coordinate of the right edge of the character in local coordinates. |
bottom |
float :
y coordinate of the bottom edge of the character in local coordinates. |
flags |
int :
flags for this character bounds. See FLAG_HAS_VISIBLE_REGION ,
FLAG_HAS_INVISIBLE_REGION and FLAG_IS_RTL . These flags must be
specified when necessary. |
Throws |
IllegalArgumentException |
If the index is a negative value, or not greater than
all of the previously called indices.
|
reset
void reset ()
Resets the internal state so that this instance can be reused to build another
instance of CursorAnchorInfo
.
setComposingText
CursorAnchorInfo.Builder setComposingText (int composingTextStart,
CharSequence composingText)
Sets the text range of the composing text. Calling this can be skipped if there is
no composing text.
Parameters |
composingTextStart |
int :
index where the composing text starts. |
composingText |
CharSequence :
the entire composing text.
|
setInsertionMarkerLocation
CursorAnchorInfo.Builder setInsertionMarkerLocation (float horizontalPosition,
float lineTop,
float lineBaseline,
float lineBottom,
int flags)
Sets the location of the text insertion point (zero width cursor) as a rectangle in
local coordinates. Calling this can be skipped when there is no text insertion point;
however if there is an insertion point, editors must call this method.
Parameters |
horizontalPosition |
float :
horizontal position of the insertion marker, in the local
coordinates that will be transformed with the transformation matrix when rendered on the
screen. This should be calculated or compatible with
getPrimaryHorizontal(int) . |
lineTop |
float :
vertical position of the insertion marker, in the local coordinates that
will be transformed with the transformation matrix when rendered on the screen. This
should be calculated or compatible with getLineTop(int) . |
lineBaseline |
float :
vertical position of the insertion marker, in the local coordinates
that will be transformed with the transformation matrix when rendered on the screen. This
should be calculated or compatible with getLineBaseline(int) . |
lineBottom |
float :
vertical position of the insertion marker, in the local coordinates
that will be transformed with the transformation matrix when rendered on the screen. This
should be calculated or compatible with getLineBottom(int) . |
flags |
int :
flags of the insertion marker. See FLAG_HAS_VISIBLE_REGION for
example.
|
setMatrix
CursorAnchorInfo.Builder setMatrix (Matrix matrix)
Sets the matrix that transforms local coordinates into screen coordinates.
Parameters |
matrix |
Matrix :
transformation matrix from local coordinates into screen coordinates. null
is interpreted as an identity matrix.
|
setSelectionRange
CursorAnchorInfo.Builder setSelectionRange (int newStart,
int newEnd)
Sets the text range of the selection. Calling this can be skipped if there is no
selection.
Parameters |
newStart |
int
|
newEnd |
int
|