本文整理匯總了Java中android.support.v4.view.accessibility.AccessibilityRecordCompat.setToIndex方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityRecordCompat.setToIndex方法的具體用法?Java AccessibilityRecordCompat.setToIndex怎麽用?Java AccessibilityRecordCompat.setToIndex使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.support.v4.view.accessibility.AccessibilityRecordCompat
的用法示例。
在下文中一共展示了AccessibilityRecordCompat.setToIndex方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(DirectionalViewpager.class.getName());
AccessibilityRecordCompat recordCompat = null;
if (isHorizontal()) {
recordCompat =
AccessibilityEventCompat.asRecord(event);
} else {
recordCompat = AccessibilityRecordCompat.obtain();
}
recordCompat.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例2: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (getChildCount() > 0) {
final AccessibilityRecordCompat record = AccessibilityEventCompat
.asRecord(event);
final View start = findFirstVisibleItemClosestToStart(false, true);
final View end = findFirstVisibleItemClosestToEnd(false, true);
if (start == null || end == null) {
return;
}
final int startPos = getPosition(start);
final int endPos = getPosition(end);
if (startPos < endPos) {
record.setFromIndex(startPos);
record.setToIndex(endPos);
} else {
record.setFromIndex(endPos);
record.setToIndex(startPos);
}
}
}
示例3: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (getChildCount() > 0) {
AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
View start = findFirstVisibleItemClosestToStart(false, true);
View end = findFirstVisibleItemClosestToEnd(false, true);
if (start != null && end != null) {
int startPos = getPosition(start);
int endPos = getPosition(end);
if (startPos < endPos) {
record.setFromIndex(startPos);
record.setToIndex(endPos);
return;
}
record.setFromIndex(endPos);
record.setToIndex(startPos);
}
}
}
示例4: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (getChildCount() > 0) {
final AccessibilityRecordCompat record = AccessibilityEventCompat
.asRecord(event);
final View start = findFirstVisibleItemClosestToStart(false);
final View end = findFirstVisibleItemClosestToEnd(false);
if (start == null || end == null) {
return;
}
final int startPos = getPosition(start);
final int endPos = getPosition(end);
if (startPos < endPos) {
record.setFromIndex(startPos);
record.setToIndex(endPos);
} else {
record.setFromIndex(endPos);
record.setToIndex(startPos);
}
}
}
示例5: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@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() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例6: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@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()));
}
}
示例7: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
// Ensure that we only report the number apps for accessibility not including other
// adapter views
final AccessibilityRecordCompat record = AccessibilityEventCompat
.asRecord(event);
record.setItemCount(mApps.getNumFilteredApps());
record.setFromIndex(Math.max(0,
record.getFromIndex() - getRowsNotForAccessibility(record.getFromIndex())));
record.setToIndex(Math.max(0,
record.getToIndex() - getRowsNotForAccessibility(record.getToIndex())));
}
示例8: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(ViewPager.class.getName());
AccessibilityRecordCompat recordCompat = AccessibilityEventCompat.asRecord(event);
recordCompat.setScrollable(canScroll());
if (event.getEventType() == 4096 && ViewPager.this.mAdapter != null) {
recordCompat.setItemCount(ViewPager.this.mAdapter.getCount());
recordCompat.setFromIndex(ViewPager.this.mCurItem);
recordCompat.setToIndex(ViewPager.this.mCurItem);
}
}
示例9: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(XCCycleViewPager.class.getName());
final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
recordCompat.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例10: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (getChildCount() > 0) {
AccessibilityRecordCompat record = AccessibilityEventCompat.asRecord(event);
record.setFromIndex(findFirstVisibleItemPosition());
record.setToIndex(findLastVisibleItemPosition());
}
}
示例11: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(VelocityViewPager.class.getName());
final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
recordCompat.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例12: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(YViewPagerNew.class.getName());
final AccessibilityRecordCompat recordCompat =
AccessibilityEventCompat.asRecord(event);
recordCompat.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(getAdapterCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例13: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(ViewPager.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);
}
}
示例14: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@Override
public void onInitializeAccessibilityEvent(View host, AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(host, event);
event.setClassName(SmoothViewPager.class.getName());
final AccessibilityRecordCompat recordCompat = AccessibilityRecordCompat.obtain();
recordCompat.setScrollable(canScroll());
if (event.getEventType() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}
示例15: onInitializeAccessibilityEvent
import android.support.v4.view.accessibility.AccessibilityRecordCompat; //導入方法依賴的package包/類
@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() == AccessibilityEventCompat.TYPE_VIEW_SCROLLED
&& mAdapter != null) {
recordCompat.setItemCount(mAdapter.getCount());
recordCompat.setFromIndex(mCurItem);
recordCompat.setToIndex(mCurItem);
}
}