Java Code Examples for androidx.core.view.accessibility.AccessibilityRecordCompat#setFromIndex()
The following examples show how to use
androidx.core.view.accessibility.AccessibilityRecordCompat#setFromIndex() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VerticalViewPager.java From DKVideoPlayer with Apache License 2.0 | 5 votes |
@Override public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) { super.onInitializeAccessibilityEvent(host, event); event.setClassName(ViewPager.class.getName()); final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain(); recordCompat.setScrollable(canScroll()); if (event.getEventType() == TYPE_VIEW_SCROLLED && mAdapter != null) { recordCompat.setItemCount(mAdapter.getCount()); recordCompat.setFromIndex(mCurItem); recordCompat.setToIndex(mCurItem); } }
Example 2
Source File: ViewPagerLayoutManager.java From OmegaRecyclerView with MIT License | 5 votes |
@Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); if (getChildCount() > 0) { final AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event); record.setFromIndex(getPosition(getFirstChild())); record.setToIndex(getPosition(getLastChild())); } }
Example 3
Source File: CustomViewPager.java From AsteroidOSSync with GNU General Public License v3.0 | 5 votes |
@Override public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) { super.onInitializeAccessibilityEvent(host, event); event.setClassName(CustomViewPager.class.getName()); final AccessibilityRecordCompat recordCompat = AccessibilityEventCompat.asRecord(event); recordCompat.setScrollable(canScroll()); if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED && mAdapter != null) { recordCompat.setItemCount(mAdapter.getCount()); recordCompat.setFromIndex(mCurItem); recordCompat.setToIndex(mCurItem); } }