FileDocCategorySizeDatePackage
AccessibilityRecordCompat.javaAPI DocAndroid 5.1 API30658Thu Mar 12 22:22:56 GMT 2015android.support.v4.view.accessibility

AccessibilityRecordCompat

public class AccessibilityRecordCompat extends Object
Helper for accessing {@link android.view.accessibility.AccessibilityRecord} introduced after API level 4 in a backwards compatible fashion.

Fields Summary
private static final AccessibilityRecordImpl
IMPL
private final Object
mRecord
Constructors Summary
public AccessibilityRecordCompat(Object record)

deprecated
This is not type safe. If you want to modify an {@link AccessibilityEvent}'s properties defined in {@link android.view.accessibility.AccessibilityRecord} use {@link AccessibilityEventCompat#asRecord(AccessibilityEvent)}. This method will be removed in a subsequent release of the support library.

        mRecord = record;
    
Methods Summary
public booleanequals(java.lang.Object obj)

        if (this == obj) {
            return true;
        }
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        AccessibilityRecordCompat other = (AccessibilityRecordCompat) obj;
        if (mRecord == null) {
            if (other.mRecord != null) {
                return false;
            }
        } else if (!mRecord.equals(other.mRecord)) {
            return false;
        }
        return true;
    
public intgetAddedCount()
Gets the number of added characters.

return
The number of added characters.

        return IMPL.getAddedCount(mRecord);
    
public java.lang.CharSequencegetBeforeText()
Sets the text before a change.

return
The text before the change.

        return IMPL.getBeforeText(mRecord);
    
public java.lang.CharSequencegetClassName()
Gets the class name of the source.

return
The class name.

        return IMPL.getClassName(mRecord);
    
public java.lang.CharSequencegetContentDescription()
Gets the description of the source.

return
The description.

        return IMPL.getContentDescription(mRecord);
    
public intgetCurrentItemIndex()
Gets the index of the source in the list of items the can be visited.

return
The current item index.

        return IMPL.getCurrentItemIndex(mRecord);
    
public intgetFromIndex()
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.

return
The index of the first character or selection start or the first visible item.

        return IMPL.getFromIndex(mRecord);
    
public java.lang.ObjectgetImpl()

return
The wrapped implementation.
deprecated
This method will be removed in a subsequent release of the support library.

        return mRecord;
    
public intgetItemCount()
Gets the number of items that can be visited.

return
The number of items.

        return IMPL.getItemCount(mRecord);
    
public intgetMaxScrollX()
Gets the max scroll offset of the source left edge in pixels.

return
The max scroll.

        return IMPL.getMaxScrollX(mRecord);
    
public intgetMaxScrollY()
Gets the max scroll offset of the source top edge in pixels.

return
The max scroll.

        return IMPL.getMaxScrollY(mRecord);
    
public android.os.ParcelablegetParcelableData()
Gets the {@link Parcelable} data.

return
The parcelable data.

        return IMPL.getParcelableData(mRecord);
    
public intgetRemovedCount()
Gets the number of removed characters.

return
The number of removed characters.

        return IMPL.getRemovedCount(mRecord);
    
public intgetScrollX()
Gets the scroll offset of the source left edge in pixels.

return
The scroll.

        return IMPL.getScrollX(mRecord);
    
public intgetScrollY()
Gets the scroll offset of the source top edge in pixels.

return
The scroll.

        return IMPL.getScrollY(mRecord);
    
public AccessibilityNodeInfoCompatgetSource()
Gets the {@link android.view.accessibility.AccessibilityNodeInfo} of the event source.

Note: It is a client responsibility to recycle the received info by calling {@link android.view.accessibility.AccessibilityNodeInfo#recycle() AccessibilityNodeInfo#recycle()} to avoid creating of multiple instances.

return
The info of the source.

        return IMPL.getSource(mRecord);
    
public java.util.ListgetText()
Gets the text of the event. The index in the list represents the priority of the text. Specifically, the lower the index the higher the priority.

return
The text.

        return IMPL.getText(mRecord);
    
public intgetToIndex()
Gets the index of text selection end or the index of the last visible item when scrolling.

return
The index of selection end or last item index.

        return IMPL.getToIndex(mRecord);
    
public intgetWindowId()
Gets the id of the window from which the event comes from.

return
The window id.

        return IMPL.getWindowId(mRecord);
    
public inthashCode()

        return (mRecord == null) ? 0 : mRecord.hashCode();
    
public booleanisChecked()
Gets if the source is checked.

return
True if the view is checked, false otherwise.

        return IMPL.isChecked(mRecord);
    
public booleanisEnabled()
Gets if the source is enabled.

return
True if the view is enabled, false otherwise.

        return IMPL.isEnabled(mRecord);
    
public booleanisFullScreen()
Gets if the source is taking the entire screen.

return
True if the source is full screen, false otherwise.

        return IMPL.isFullScreen(mRecord);
    
public booleanisPassword()
Gets if the source is a password field.

return
True if the view is a password field, false otherwise.

        return IMPL.isPassword(mRecord);
    
public booleanisScrollable()
Gets if the source is scrollable.

return
True if the source is scrollable, false otherwise.

        return IMPL.isScrollable(mRecord);
    
public static android.support.v4.view.accessibility.AccessibilityRecordCompatobtain(android.support.v4.view.accessibility.AccessibilityRecordCompat record)
Returns a cached instance if such is available or a new one is instantiated. The instance is initialized with data from the given record.

return
An instance.

       return new AccessibilityRecordCompat(IMPL.obtain(record.mRecord));
    
public static android.support.v4.view.accessibility.AccessibilityRecordCompatobtain()
Returns a cached instance if such is available or a new one is instantiated.

return
An instance.

        return new AccessibilityRecordCompat(IMPL.obtain());
    
public voidrecycle()
Return an instance back to be reused.

Note: You must not touch the object after calling this function.

throws
IllegalStateException If the record is already recycled.

        IMPL.recycle(mRecord);
    
public voidsetAddedCount(int addedCount)
Sets the number of added characters.

param
addedCount The number of added characters.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setAddedCount(mRecord, addedCount);
    
public voidsetBeforeText(java.lang.CharSequence beforeText)
Sets the text before a change.

param
beforeText The text before the change.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setBeforeText(mRecord, beforeText);
    
public voidsetChecked(boolean isChecked)
Sets if the source is checked.

param
isChecked True if the view is checked, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setChecked(mRecord, isChecked);
    
public voidsetClassName(java.lang.CharSequence className)
Sets the class name of the source.

param
className The lass name.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setClassName(mRecord, className);
    
public voidsetContentDescription(java.lang.CharSequence contentDescription)
Sets the description of the source.

param
contentDescription The description.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setContentDescription(mRecord, contentDescription);
    
public voidsetCurrentItemIndex(int currentItemIndex)
Sets the index of the source in the list of items that can be visited.

param
currentItemIndex The current item index.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setCurrentItemIndex(mRecord, currentItemIndex);
    
public voidsetEnabled(boolean isEnabled)
Sets if the source is enabled.

param
isEnabled True if the view is enabled, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setEnabled(mRecord, isEnabled);
    
public voidsetFromIndex(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.

param
fromIndex The index of the first character or selection start or the first visible item.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setFromIndex(mRecord, fromIndex);
    
public voidsetFullScreen(boolean isFullScreen)
Sets if the source is taking the entire screen.

param
isFullScreen True if the source is full screen, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setFullScreen(mRecord, isFullScreen);
    
public voidsetItemCount(int itemCount)
Sets the number of items that can be visited.

param
itemCount The number of items.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setItemCount(mRecord, itemCount);
    
public voidsetMaxScrollX(int maxScrollX)
Sets the max scroll offset of the source left edge in pixels.

param
maxScrollX The max scroll.

        IMPL.setMaxScrollX(mRecord, maxScrollX);
    
public voidsetMaxScrollY(int maxScrollY)
Sets the max scroll offset of the source top edge in pixels.

param
maxScrollY The max scroll.

        IMPL.setMaxScrollY(mRecord, maxScrollY);
    
public voidsetParcelableData(android.os.Parcelable parcelableData)
Sets the {@link Parcelable} data of the event.

param
parcelableData The parcelable data.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setParcelableData(mRecord, parcelableData);
    
public voidsetPassword(boolean isPassword)
Sets if the source is a password field.

param
isPassword True if the view is a password field, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setPassword(mRecord, isPassword);
    
public voidsetRemovedCount(int removedCount)
Sets the number of removed characters.

param
removedCount The number of removed characters.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setRemovedCount(mRecord, removedCount);
    
public voidsetScrollX(int scrollX)
Sets the scroll offset of the source left edge in pixels.

param
scrollX The scroll.

        IMPL.setScrollX(mRecord, scrollX);
    
public voidsetScrollY(int scrollY)
Sets the scroll offset of the source top edge in pixels.

param
scrollY The scroll.

        IMPL.setScrollY(mRecord, scrollY);
    
public voidsetScrollable(boolean scrollable)
Sets if the source is scrollable.

param
scrollable True if the source is scrollable, false otherwise.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setScrollable(mRecord, scrollable);
    
public voidsetSource(android.view.View source)
Sets the event source.

param
source The source.
throws
IllegalStateException If called from an AccessibilityService.

        IMPL.setSource(mRecord, source);
    
public voidsetSource(android.view.View root, int virtualDescendantId)
Sets the source to be a virtual descendant of the given root. If virtualDescendantId equals to {@link 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.

param
root The root of the virtual subtree.
param
virtualDescendantId The id of the virtual descendant.

        IMPL.setSource(mRecord, root, virtualDescendantId);
    
public voidsetToIndex(int toIndex)
Sets the index of text selection end or the index of the last visible item when scrolling.

param
toIndex The index of selection end or last item index.

        IMPL.setToIndex(mRecord, toIndex);