SelectionPosition
class SelectionPosition : Parcelable
kotlin.Any | |
↳ | android.view.accessibility.AccessibilityNodeInfo.SelectionPosition |
A class which defines either the start or end of a selection that can span across multiple AccessibilityNodeInfo objects.
Summary
Inherited constants | |
---|---|
Public constructors | |
---|---|
SelectionPosition(node: AccessibilityNodeInfo, offset: Int) Instantiates a new SelectionPosition. |
|
SelectionPosition(view: View, offset: Int) Instantiates a new SelectionPosition. |
|
SelectionPosition(view: View, virtualDescendantId: Int, offset: Int) Instantiates a new |
Public methods | |
---|---|
Int |
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. |
Boolean | |
AccessibilityNodeInfo? |
getNode() Gets the node for |
Int |
Gets the offset for |
Int |
hashCode() |
Unit |
writeToParcel(dest: Parcel, flags: Int) Flatten this object in to a Parcel. |
Properties | |
---|---|
static Parcelable.Creator<AccessibilityNodeInfo.SelectionPosition!> |
Public constructors
SelectionPosition
SelectionPosition(
node: AccessibilityNodeInfo,
offset: Int)
Instantiates a new SelectionPosition.
Parameters | |
---|---|
node |
AccessibilityNodeInfo: The AccessibilityNodeInfo for the node of this selection. This value cannot be null . |
offset |
Int: The offset for a SelectionPosition within view 's text content, which should be a value between 0 and the length of view 's text. |
SelectionPosition
SelectionPosition(
view: View,
offset: Int)
Instantiates a new SelectionPosition.
Parameters | |
---|---|
view |
View: The View containing the text associated with this selection position. This value cannot be null . |
offset |
Int: The offset for a selection position within view 's text content, which should be a value between 0 and the length of view 's text. |
SelectionPosition
SelectionPosition(
view: View,
virtualDescendantId: Int,
offset: Int)
Instantiates a new SelectionPosition
.
Parameters | |
---|---|
view |
View: The view whose virtual descendant is associated with the selection position. This value cannot be null . |
virtualDescendantId |
Int: The ID of the virtual descendant within view 's virtual subtree that contains the selection position. |
offset |
Int: The offset for a selection position within the virtual descendant's text content, which should be a value between 0 and the length of the descendant's text. |
Public methods
describeContents
fun describeContents(): Int
Describe the kinds of special objects contained in this Parcelable instance's marshaled representation. For example, if the object will include a file descriptor in the output of writeToParcel(android.os.Parcel,int)
, the return value of this method must include the CONTENTS_FILE_DESCRIPTOR
bit.
Return | |
---|---|
Int |
a bitmask indicating the set of special object types marshaled by this Parcelable object instance. Value is either 0 or android.os.Parcelable#CONTENTS_FILE_DESCRIPTOR |
equals
fun equals(other: Any?): Boolean
Parameters | |
---|---|
obj |
the reference object with which to compare. |
Return | |
---|---|
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getNode
fun getNode(): AccessibilityNodeInfo?
Gets the node for this
SelectionPosition
Note: This api can only be called from AccessibilityService
.
Return | |
---|---|
AccessibilityNodeInfo? |
The node associated with this SelectionPosition This value may be null . |
getOffset
fun getOffset(): Int
Gets the offset for this
SelectionPosition
.
Return | |
---|---|
Int |
A value from 0 to the length of getNode() 's content representing the offset of the SelectionPosition |
hashCode
fun hashCode(): Int
Return | |
---|---|
Int |
a hash code value for this object. |
writeToParcel
fun writeToParcel(
dest: Parcel,
flags: Int
): Unit
Flatten this object in to a Parcel.
Parameters | |
---|---|
dest |
Parcel: This value cannot be null . |
flags |
Int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE . Value is either 0 or a combination of android.os.Parcelable#PARCELABLE_WRITE_RETURN_VALUE , and android.os.Parcelable.PARCELABLE_ELIDE_DUPLICATES |
Properties
CREATOR
static val CREATOR: Parcelable.Creator<AccessibilityNodeInfo.SelectionPosition!>
See Also