Java Code Examples for android.view.accessibility.AccessibilityRecord

The following are top voted examples for showing how to use android.view.accessibility.AccessibilityRecord. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: NyanpasuTile   File: RecyclerView.java   View source code 6 votes vote down vote up
/**
 * Called by the accessibility delegate to initialize an accessibility event.
 * <p>
 * Default implementation adds item count and scroll information to the event.
 *
 * @param recycler The Recycler that can be used to convert view positions into adapter
 *                 positions
 * @param state    The current state of RecyclerView
 * @param event    The event instance to initialize
 * @see View#onInitializeAccessibilityEvent(android.view.accessibility.AccessibilityEvent)
 */
public void onInitializeAccessibilityEvent(Recycler recycler, State state,
                                           AccessibilityEvent event) {
	final AccessibilityRecord record = event.getRecord(0);
	if (mRecyclerView == null || record == null) {
		return;
	}
	record.setScrollable(mRecyclerView.canScrollVertically(1)
			|| mRecyclerView.canScrollVertically(-1)
			|| mRecyclerView.canScrollHorizontally(-1)
			|| mRecyclerView.canScrollHorizontally(1));

	if (mRecyclerView.mAdapter != null) {
		record.setItemCount(mRecyclerView.mAdapter.getItemCount());
	}
}
 
Example 2
Project: truth-android   File: AccessibilityRecordSubject.java   View source code 5 votes vote down vote up
public static SubjectFactory<AccessibilityRecordSubject, AccessibilityRecord> type() {
  return new SubjectFactory<AccessibilityRecordSubject, AccessibilityRecord>() {
    @Override
    public AccessibilityRecordSubject getSubject(FailureStrategy fs, AccessibilityRecord that) {
      return new AccessibilityRecordSubject(fs, that);
    }
  };
}
 
Example 3
Project: Android-SDK-Demo   File: SdkCenteredViewPager.java   View source code 5 votes vote down vote up
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event)
{
    super.onInitializeAccessibilityEvent( host, event );
    event.setClassName( SdkCenteredViewPager.class.getName() );
    final AccessibilityRecord recordCompat = AccessibilityRecord.obtain();
    recordCompat.setScrollable( canScroll() );
    if ( event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED
            && mAdapter != null )
    {
        recordCompat.setItemCount( mAdapter.getCount() );
        recordCompat.setFromIndex( mCurItem );
        recordCompat.setToIndex( mCurItem );
    }
}
 
Example 4
Project: Android-SDK-Demo   File: SdkCenteredViewPager.java   View source code 5 votes vote down vote up
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event)
{
    super.onInitializeAccessibilityEvent( host, event );
    event.setClassName( SdkCenteredViewPager.class.getName() );
    final AccessibilityRecord recordCompat = AccessibilityRecord.obtain();
    recordCompat.setScrollable( canScroll() );
    if ( event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED
            && mAdapter != null )
    {
        recordCompat.setItemCount( mAdapter.getCount() );
        recordCompat.setFromIndex( mCurItem );
        recordCompat.setToIndex( mCurItem );
    }
}
 
Example 5
Project: NyanpasuTile   File: LinearLayoutManager.java   View source code 5 votes vote down vote up
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
	super.onInitializeAccessibilityEvent(event);
	if (getChildCount() > 0) {
		final AccessibilityRecord record = event.getRecord(0);
		record.setFromIndex(findFirstVisibleItemPosition());
		record.setToIndex(findLastVisibleItemPosition());
	}
}
 
Example 6
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static Object obtain() {
    return AccessibilityRecord.obtain();
}
 
Example 7
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static Object obtain(Object record) {
    return AccessibilityRecord.obtain((AccessibilityRecord) record);
}
 
Example 8
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getAddedCount(Object record) {
    return ((AccessibilityRecord) record).getAddedCount();
}
 
Example 9
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static CharSequence getBeforeText(Object record) {
    return ((AccessibilityRecord) record).getBeforeText();
}
 
Example 10
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static CharSequence getClassName(Object record) {
    return ((AccessibilityRecord) record).getClassName();
}
 
Example 11
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static CharSequence getContentDescription(Object record) {
    return ((AccessibilityRecord) record).getContentDescription();
}
 
Example 12
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getCurrentItemIndex(Object record) {
    return ((AccessibilityRecord) record).getCurrentItemIndex();
}
 
Example 13
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getFromIndex(Object record) {
    return ((AccessibilityRecord) record).getFromIndex();
}
 
Example 14
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getItemCount(Object record) {
    return ((AccessibilityRecord) record).getItemCount();
}
 
Example 15
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static Parcelable getParcelableData(Object record) {
    return ((AccessibilityRecord) record).getParcelableData();
}
 
Example 16
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getRemovedCount(Object record) {
    return ((AccessibilityRecord) record).getRemovedCount();
}
 
Example 17
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getScrollX(Object record) {
    return ((AccessibilityRecord) record).getScrollX();
}
 
Example 18
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getScrollY(Object record) {
    return ((AccessibilityRecord) record).getScrollY();
}
 
Example 19
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static Object getSource(Object record) {
    return ((AccessibilityRecord) record).getSource();
}
 
Example 20
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static List<CharSequence> getText(Object record) {
    return ((AccessibilityRecord) record).getText();
}
 
Example 21
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getToIndex(Object record) {
    return ((AccessibilityRecord) record).getToIndex();
}
 
Example 22
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static int getWindowId(Object record) {
    return ((AccessibilityRecord) record).getWindowId();
}
 
Example 23
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static boolean isChecked(Object record) {
    return ((AccessibilityRecord) record).isChecked();
}
 
Example 24
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static boolean isEnabled(Object record) {
    return ((AccessibilityRecord) record).isEnabled();
}
 
Example 25
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static boolean isFullScreen(Object record) {
    return ((AccessibilityRecord) record).isFullScreen();
}
 
Example 26
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static boolean isPassword(Object record) {
    return ((AccessibilityRecord) record).isPassword();
}
 
Example 27
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static boolean isScrollable(Object record) {
    return ((AccessibilityRecord) record).isScrollable();
}
 
Example 28
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void recycle(Object record) {
    ((AccessibilityRecord) record).recycle();
}
 
Example 29
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setAddedCount(Object record, int addedCount) {
    ((AccessibilityRecord) record).setAddedCount(addedCount);
}
 
Example 30
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setBeforeText(Object record, CharSequence beforeText) {
    ((AccessibilityRecord) record).setBeforeText(beforeText);
}
 
Example 31
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setChecked(Object record, boolean isChecked) {
    ((AccessibilityRecord) record).setChecked(isChecked);
}
 
Example 32
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setClassName(Object record, CharSequence className) {
    ((AccessibilityRecord) record).setClassName(className);
}
 
Example 33
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setContentDescription(Object record, CharSequence contentDescription) {
    ((AccessibilityRecord) record).setContentDescription(contentDescription);
}
 
Example 34
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setCurrentItemIndex(Object record, int currentItemIndex) {
    ((AccessibilityRecord) record).setCurrentItemIndex(currentItemIndex);
}
 
Example 35
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setEnabled(Object record, boolean isEnabled) {
    ((AccessibilityRecord) record).setEnabled(isEnabled);
}
 
Example 36
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setFromIndex(Object record, int fromIndex) {
    ((AccessibilityRecord) record).setFromIndex(fromIndex);
}
 
Example 37
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setFullScreen(Object record, boolean isFullScreen) {
    ((AccessibilityRecord) record).setFullScreen(isFullScreen);
}
 
Example 38
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setItemCount(Object record, int itemCount) {
    ((AccessibilityRecord) record).setItemCount(itemCount);
}
 
Example 39
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setParcelableData(Object record, Parcelable parcelableData) {
    ((AccessibilityRecord) record).setParcelableData(parcelableData);
}
 
Example 40
Project: boohee_v5.6   File: AccessibilityRecordCompatIcs.java   View source code 4 votes vote down vote up
public static void setPassword(Object record, boolean isPassword) {
    ((AccessibilityRecord) record).setPassword(isPassword);
}