|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectandroid.support.v4.view.accessibility.AccessibilityRecordCompat
public class AccessibilityRecordCompat
Helper for accessing android.view.accessibility.AccessibilityRecord
introduced after API level 4 in a backwards compatible fashion.
Constructor Summary | |
---|---|
AccessibilityRecordCompat(java.lang.Object record)
|
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
int |
getAddedCount()
Gets the number of added characters. |
java.lang.CharSequence |
getBeforeText()
Sets the text before a change. |
java.lang.CharSequence |
getClassName()
Gets the class name of the source. |
java.lang.CharSequence |
getContentDescription()
Gets the description of the source. |
int |
getCurrentItemIndex()
Gets the index of the source in the list of items the can be visited. |
int |
getFromIndex()
Gets the index of the first character of the changed sequence, or the beginning of a text selection or the index of the first visible item when scrolling. |
java.lang.Object |
getImpl()
|
int |
getItemCount()
Gets the number of items that can be visited. |
int |
getMaxScrollX()
Gets the max scroll offset of the source left edge in pixels. |
int |
getMaxScrollY()
Gets the max scroll offset of the source top edge in pixels. |
Parcelable |
getParcelableData()
Gets the Parcelable data. |
int |
getRemovedCount()
Gets the number of removed characters. |
int |
getScrollX()
Gets the scroll offset of the source left edge in pixels. |
int |
getScrollY()
Gets the scroll offset of the source top edge in pixels. |
AccessibilityNodeInfoCompat |
getSource()
Gets the android.view.accessibility.AccessibilityNodeInfo of
the event source. |
java.util.List<java.lang.CharSequence> |
getText()
Gets the text of the event. |
int |
getToIndex()
Gets the index of text selection end or the index of the last visible item when scrolling. |
int |
getWindowId()
Gets the id of the window from which the event comes from. |
int |
hashCode()
|
boolean |
isChecked()
Gets if the source is checked. |
boolean |
isEnabled()
Gets if the source is enabled. |
boolean |
isFullScreen()
Gets if the source is taking the entire screen. |
boolean |
isPassword()
Gets if the source is a password field. |
boolean |
isScrollable()
Gets if the source is scrollable. |
static AccessibilityRecordCompat |
obtain()
Returns a cached instance if such is available or a new one is instantiated. |
static AccessibilityRecordCompat |
obtain(AccessibilityRecordCompat record)
Returns a cached instance if such is available or a new one is instantiated. |
void |
recycle()
Return an instance back to be reused. |
void |
setAddedCount(int addedCount)
Sets the number of added characters. |
void |
setBeforeText(java.lang.CharSequence beforeText)
Sets the text before a change. |
void |
setChecked(boolean isChecked)
Sets if the source is checked. |
void |
setClassName(java.lang.CharSequence className)
Sets the class name of the source. |
void |
setContentDescription(java.lang.CharSequence contentDescription)
Sets the description of the source. |
void |
setCurrentItemIndex(int currentItemIndex)
Sets the index of the source in the list of items that can be visited. |
void |
setEnabled(boolean isEnabled)
Sets if the source is enabled. |
void |
setFromIndex(int fromIndex)
Sets the index of the first character of the changed sequence or the beginning of a text selection or the index of the first visible item when scrolling. |
void |
setFullScreen(boolean isFullScreen)
Sets if the source is taking the entire screen. |
void |
setItemCount(int itemCount)
Sets the number of items that can be visited. |
void |
setMaxScrollX(int maxScrollX)
Sets the max scroll offset of the source left edge in pixels. |
void |
setMaxScrollY(int maxScrollY)
Sets the max scroll offset of the source top edge in pixels. |
void |
setParcelableData(Parcelable parcelableData)
Sets the Parcelable data of the event. |
void |
setPassword(boolean isPassword)
Sets if the source is a password field. |
void |
setRemovedCount(int removedCount)
Sets the number of removed characters. |
void |
setScrollable(boolean scrollable)
Sets if the source is scrollable. |
void |
setScrollX(int scrollX)
Sets the scroll offset of the source left edge in pixels. |
void |
setScrollY(int scrollY)
Sets the scroll offset of the source top edge in pixels. |
void |
setSource(View source)
Sets the event source. |
void |
setSource(View root,
int virtualDescendantId)
Sets the source to be a virtual descendant of the given root . |
void |
setToIndex(int toIndex)
Sets the index of text selection end or the index of the last visible item when scrolling. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public AccessibilityRecordCompat(java.lang.Object record)
Method Detail |
---|
public java.lang.Object getImpl()
public static AccessibilityRecordCompat obtain(AccessibilityRecordCompat record)
public static AccessibilityRecordCompat obtain()
public void setSource(View source)
source
- The source.
java.lang.IllegalStateException
- If called from an AccessibilityService.public void setSource(View root, int virtualDescendantId)
root
.
If virtualDescendantId
equals to View#NO_ID
the root
is set as the source.
A virtual descendant is an imaginary View that is reported as a part of the view hierarchy for accessibility purposes. This enables custom views that draw complex content to report them selves as a tree of virtual views, thus conveying their logical structure.
root
- The root of the virtual subtree.virtualDescendantId
- The id of the virtual descendant.public AccessibilityNodeInfoCompat getSource()
android.view.accessibility.AccessibilityNodeInfo
of
the event source.
Note: It is a client responsibility to recycle the
received info by calling
AccessibilityNodeInfo#recycle()
to avoid creating of multiple instances.
public int getWindowId()
public boolean isChecked()
public void setChecked(boolean isChecked)
isChecked
- True if the view is checked, false otherwise.
java.lang.IllegalStateException
- If called from an AccessibilityService.public boolean isEnabled()
public void setEnabled(boolean isEnabled)
isEnabled
- True if the view is enabled, false otherwise.
java.lang.IllegalStateException
- If called from an AccessibilityService.public boolean isPassword()
public void setPassword(boolean isPassword)
isPassword
- True if the view is a password field, false otherwise.
java.lang.IllegalStateException
- If called from an AccessibilityService.public boolean isFullScreen()
public void setFullScreen(boolean isFullScreen)
isFullScreen
- True if the source is full screen, false otherwise.
java.lang.IllegalStateException
- If called from an AccessibilityService.public boolean isScrollable()
public void setScrollable(boolean scrollable)
scrollable
- True if the source is scrollable, false otherwise.
java.lang.IllegalStateException
- If called from an AccessibilityService.public int getItemCount()
public void setItemCount(int itemCount)
itemCount
- The number of items.
java.lang.IllegalStateException
- If called from an AccessibilityService.public int getCurrentItemIndex()
public void setCurrentItemIndex(int currentItemIndex)
currentItemIndex
- The current item index.
java.lang.IllegalStateException
- If called from an AccessibilityService.public int getFromIndex()
public void setFromIndex(int fromIndex)
fromIndex
- The index of the first character or selection
start or the first visible item.
java.lang.IllegalStateException
- If called from an AccessibilityService.public int getToIndex()
public void setToIndex(int toIndex)
toIndex
- The index of selection end or last item index.public int getScrollX()
public void setScrollX(int scrollX)
scrollX
- The scroll.public int getScrollY()
public void setScrollY(int scrollY)
scrollY
- The scroll.public int getMaxScrollX()
public void setMaxScrollX(int maxScrollX)
maxScrollX
- The max scroll.public int getMaxScrollY()
public void setMaxScrollY(int maxScrollY)
maxScrollY
- The max scroll.public int getAddedCount()
public void setAddedCount(int addedCount)
addedCount
- The number of added characters.
java.lang.IllegalStateException
- If called from an AccessibilityService.public int getRemovedCount()
public void setRemovedCount(int removedCount)
removedCount
- The number of removed characters.
java.lang.IllegalStateException
- If called from an AccessibilityService.public java.lang.CharSequence getClassName()
public void setClassName(java.lang.CharSequence className)
className
- The lass name.
java.lang.IllegalStateException
- If called from an AccessibilityService.public java.util.List<java.lang.CharSequence> getText()
public java.lang.CharSequence getBeforeText()
public void setBeforeText(java.lang.CharSequence beforeText)
beforeText
- The text before the change.
java.lang.IllegalStateException
- If called from an AccessibilityService.public java.lang.CharSequence getContentDescription()
public void setContentDescription(java.lang.CharSequence contentDescription)
contentDescription
- The description.
java.lang.IllegalStateException
- If called from an AccessibilityService.public Parcelable getParcelableData()
Parcelable
data.
public void setParcelableData(Parcelable parcelableData)
Parcelable
data of the event.
parcelableData
- The parcelable data.
java.lang.IllegalStateException
- If called from an AccessibilityService.public void recycle()
Note: You must not touch the object after calling this function.
java.lang.IllegalStateException
- If the record is already recycled.public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |