本文整理匯總了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);
}
}