本文整理汇总了Java中android.view.accessibility.AccessibilityEvent.setScrollY方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityEvent.setScrollY方法的具体用法?Java AccessibilityEvent.setScrollY怎么用?Java AccessibilityEvent.setScrollY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.AccessibilityEvent
的用法示例。
在下文中一共展示了AccessibilityEvent.setScrollY方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: sendScrollAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
private void sendScrollAccessibilityEvent() {
AccessibilityManager am =
(AccessibilityManager) getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
if (am.isEnabled()) {
if (mCurrentPage != getNextPage()) {
AccessibilityEvent ev =
AccessibilityEvent.obtain(AccessibilityEvent.TYPE_VIEW_SCROLLED);
ev.setScrollable(true);
ev.setScrollX(getScrollX());
ev.setScrollY(getScrollY());
ev.setMaxScrollX(mMaxScrollX);
ev.setMaxScrollY(0);
sendAccessibilityEventUnchecked(ev);
}
}
}
示例2: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setClassName(NumberPicker.class.getName());
event.setScrollable(true);
event.setScrollY((mMinValue + mValue) * mSelectorElementHeight);
event.setMaxScrollY((mMaxValue - mMinValue) * mSelectorElementHeight);
}
示例3: onInitializeAccessibilityEvent
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
event.setClassName(NumberPicker.class.getName());
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
event.setScrollable(true);
event.setScrollY((mMinValue + mValue) * mSelectorElementHeight);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) {
event.setMaxScrollY((mMaxValue - mMinValue) * mSelectorElementHeight);
}
}
示例4: onInitializeAccessibilityEventInternal
import android.view.accessibility.AccessibilityEvent; //导入方法依赖的package包/类
public void onInitializeAccessibilityEventInternal(AccessibilityEvent event) {
event.setClassName(NumberPicker.class.getName());
event.setScrollable(true);
event.setScrollY((mMinValue + mValue) * mSelectorElementHeight);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH_MR1) { // FIXME what about API 14?
event.setMaxScrollY((mMaxValue - mMinValue) * mSelectorElementHeight);
}
}