Java 类android.view.accessibility.AccessibilityRecord 实例源码

项目:NyanpasuTile    文件:RecyclerView.java   
/**
 * 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());
    }
}
项目:truth-android    文件:AccessibilityRecordSubject.java   
public static SubjectFactory<AccessibilityRecordSubject, AccessibilityRecord> type() {
  return new SubjectFactory<AccessibilityRecordSubject, AccessibilityRecord>() {
    @Override
    public AccessibilityRecordSubject getSubject(FailureStrategy fs, AccessibilityRecord that) {
      return new AccessibilityRecordSubject(fs, that);
    }
  };
}
项目:Android-SDK-Demo    文件:SdkCenteredViewPager.java   
@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 );
    }
}
项目:Android-SDK-Demo    文件:SdkCenteredViewPager.java   
@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 );
    }
}
项目:NyanpasuTile    文件:LinearLayoutManager.java   
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
    super.onInitializeAccessibilityEvent(event);
    if (getChildCount() > 0) {
        final AccessibilityRecord record = event.getRecord(0);
        record.setFromIndex(findFirstVisibleItemPosition());
        record.setToIndex(findLastVisibleItemPosition());
    }
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static Object obtain() {
    return AccessibilityRecord.obtain();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static Object obtain(Object record) {
    return AccessibilityRecord.obtain((AccessibilityRecord) record);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getAddedCount(Object record) {
    return ((AccessibilityRecord) record).getAddedCount();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static CharSequence getBeforeText(Object record) {
    return ((AccessibilityRecord) record).getBeforeText();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static CharSequence getClassName(Object record) {
    return ((AccessibilityRecord) record).getClassName();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static CharSequence getContentDescription(Object record) {
    return ((AccessibilityRecord) record).getContentDescription();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getCurrentItemIndex(Object record) {
    return ((AccessibilityRecord) record).getCurrentItemIndex();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getFromIndex(Object record) {
    return ((AccessibilityRecord) record).getFromIndex();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getItemCount(Object record) {
    return ((AccessibilityRecord) record).getItemCount();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static Parcelable getParcelableData(Object record) {
    return ((AccessibilityRecord) record).getParcelableData();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getRemovedCount(Object record) {
    return ((AccessibilityRecord) record).getRemovedCount();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getScrollX(Object record) {
    return ((AccessibilityRecord) record).getScrollX();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getScrollY(Object record) {
    return ((AccessibilityRecord) record).getScrollY();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static Object getSource(Object record) {
    return ((AccessibilityRecord) record).getSource();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static List<CharSequence> getText(Object record) {
    return ((AccessibilityRecord) record).getText();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getToIndex(Object record) {
    return ((AccessibilityRecord) record).getToIndex();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static int getWindowId(Object record) {
    return ((AccessibilityRecord) record).getWindowId();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static boolean isChecked(Object record) {
    return ((AccessibilityRecord) record).isChecked();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static boolean isEnabled(Object record) {
    return ((AccessibilityRecord) record).isEnabled();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static boolean isFullScreen(Object record) {
    return ((AccessibilityRecord) record).isFullScreen();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static boolean isPassword(Object record) {
    return ((AccessibilityRecord) record).isPassword();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static boolean isScrollable(Object record) {
    return ((AccessibilityRecord) record).isScrollable();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void recycle(Object record) {
    ((AccessibilityRecord) record).recycle();
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setAddedCount(Object record, int addedCount) {
    ((AccessibilityRecord) record).setAddedCount(addedCount);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setBeforeText(Object record, CharSequence beforeText) {
    ((AccessibilityRecord) record).setBeforeText(beforeText);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setChecked(Object record, boolean isChecked) {
    ((AccessibilityRecord) record).setChecked(isChecked);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setClassName(Object record, CharSequence className) {
    ((AccessibilityRecord) record).setClassName(className);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setContentDescription(Object record, CharSequence contentDescription) {
    ((AccessibilityRecord) record).setContentDescription(contentDescription);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setCurrentItemIndex(Object record, int currentItemIndex) {
    ((AccessibilityRecord) record).setCurrentItemIndex(currentItemIndex);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setEnabled(Object record, boolean isEnabled) {
    ((AccessibilityRecord) record).setEnabled(isEnabled);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setFromIndex(Object record, int fromIndex) {
    ((AccessibilityRecord) record).setFromIndex(fromIndex);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setFullScreen(Object record, boolean isFullScreen) {
    ((AccessibilityRecord) record).setFullScreen(isFullScreen);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setItemCount(Object record, int itemCount) {
    ((AccessibilityRecord) record).setItemCount(itemCount);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setParcelableData(Object record, Parcelable parcelableData) {
    ((AccessibilityRecord) record).setParcelableData(parcelableData);
}
项目:boohee_v5.6    文件:AccessibilityRecordCompatIcs.java   
public static void setPassword(Object record, boolean isPassword) {
    ((AccessibilityRecord) record).setPassword(isPassword);
}