本文整理汇总了Java中android.view.accessibility.AccessibilityEvent.setToIndex方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityEvent.setToIndex方法的具体用法?Java AccessibilityEvent.setToIndex怎么用?Java AccessibilityEvent.setToIndex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.AccessibilityEvent
的用法示例。
在下文中一共展示了AccessibilityEvent.setToIndex方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED) {
event.setFromIndex(0);
event.setToIndex(0);
}
}
示例2: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setScrollable(isScrollableForAccessibility());
View selectedView = getSelectedView();
if (selectedView != null) {
event.setEnabled(selectedView.isEnabled());
}
event.setCurrentItemIndex(getSelectedItemPosition());
event.setFromIndex(getFirstVisiblePosition());
event.setToIndex(getLastVisiblePosition());
event.setItemCount(getCount());
}
示例3: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@TargetApi(14)
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setClassName(AdapterView.class.getName());
event.setScrollable(isScrollableForAccessibility());
View selectedView = getSelectedView();
if (selectedView != null) {
event.setEnabled(selectedView.isEnabled());
}
event.setCurrentItemIndex(getSelectedItemPosition());
event.setFromIndex(getFirstVisiblePosition());
event.setToIndex(getLastVisiblePosition());
event.setItemCount(getCount());
}
示例4: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@TargetApi(14)
@Override
public void onInitializeAccessibilityEvent( AccessibilityEvent event ) {
super.onInitializeAccessibilityEvent( event );
event.setClassName( AdapterView.class.getName() );
event.setScrollable( isScrollableForAccessibility() );
View selectedView = getSelectedView();
if ( selectedView != null ) {
event.setEnabled( selectedView.isEnabled() );
}
event.setCurrentItemIndex( getSelectedItemPosition() );
event.setFromIndex( getFirstVisiblePosition() );
event.setToIndex( getLastVisiblePosition() );
event.setItemCount( getCount() );
}
示例5: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent paramAccessibilityEvent) {
super.onInitializeAccessibilityEvent(paramAccessibilityEvent);
paramAccessibilityEvent.setScrollable(isScrollableForAccessibility());
View localView = getSelectedView();
if (localView != null)
paramAccessibilityEvent.setEnabled(localView.isEnabled());
paramAccessibilityEvent.setCurrentItemIndex(getSelectedItemPosition());
paramAccessibilityEvent.setFromIndex(getFirstVisiblePosition());
paramAccessibilityEvent.setToIndex(getLastVisiblePosition());
paramAccessibilityEvent.setItemCount(getCount());
}
示例6: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (event.getEventType() == 4096) {
event.setFromIndex(0);
event.setToIndex(0);
}
}
示例7: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
// Decoration-only headers should not count as an item for accessibility, adjust the
// accessibility event to account for that.
final int numberOfHeaders = mSticky != null ? 1 : 0;
event.setItemCount(event.getItemCount() - numberOfHeaders);
event.setFromIndex(Math.max(event.getFromIndex() - numberOfHeaders, 0));
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
event.setToIndex(Math.max(event.getToIndex() - numberOfHeaders, 0));
}
}