本文整理汇总了Java中android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setScrollable方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityNodeInfoCompat.setScrollable方法的具体用法?Java AccessibilityNodeInfoCompat.setScrollable怎么用?Java AccessibilityNodeInfoCompat.setScrollable使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.support.v4.view.accessibility.AccessibilityNodeInfoCompat
的用法示例。
在下文中一共展示了AccessibilityNodeInfoCompat.setScrollable方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(DirectionalViewpager.class.getName());
info.setScrollable(canScroll());
if (isHorizontal()) {
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
} else {
if (internalCanScrollVertically(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (internalCanScrollVertically(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
}
示例2: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
NestedScrollView nsvHost = (NestedScrollView) host;
info.setClassName(ScrollView.class.getName());
if (nsvHost.isEnabled()) {
int scrollRange = nsvHost.getScrollRange();
if (scrollRange > 0) {
info.setScrollable(true);
if (nsvHost.getScrollY() > 0) {
info.addAction(8192);
}
if (nsvHost.getScrollY() < scrollRange) {
info.addAction(4096);
}
}
}
}
示例3: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(ViewPager.class.getName());
info.setScrollable(canScroll());
if (internalCanScrollVertically(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (internalCanScrollVertically(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例4: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(VelocityViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例5: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(XCCycleViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例6: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(ViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例7: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(YViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例8: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(YViewPagerNew.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例9: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(YViewPagerOrigin.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例10: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityNodeInfo(Recycler recycler, State state, AccessibilityNodeInfoCompat info) {
if (ViewCompat.canScrollVertically(this.mRecyclerView, -1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, -1)) {
info.addAction(8192);
info.setScrollable(true);
}
if (ViewCompat.canScrollVertically(this.mRecyclerView, 1) || ViewCompat.canScrollHorizontally(this.mRecyclerView, 1)) {
info.addAction(4096);
info.setScrollable(true);
}
info.setCollectionInfo(CollectionInfoCompat.obtain(getRowCountForAccessibility(recycler, state), getColumnCountForAccessibility(recycler, state), isLayoutHierarchical(recycler, state), getSelectionModeForAccessibility(recycler, state)));
}
示例11: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(CustomViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例12: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@SuppressLint("NewApi")
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(ViewPager.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例13: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
@Override
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(ViewPagerEx.class.getName());
info.setScrollable(canScroll());
if (canScrollHorizontally(1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
}
if (canScrollHorizontally(-1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
}
}
示例14: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfoCompat info) {
super.onInitializeAccessibilityNodeInfo(host, info);
info.setClassName(ViewPager.class.getName());
info.setScrollable(canScroll());
if (ViewPager.this.canScrollHorizontally(1)) {
info.addAction(4096);
}
if (ViewPager.this.canScrollHorizontally(-1)) {
info.addAction(8192);
}
}
示例15: onInitializeAccessibilityNodeInfo
import android.support.v4.view.accessibility.AccessibilityNodeInfoCompat; //导入方法依赖的package包/类
/**
* Called by the AccessibilityDelegate when the information about the current layout should
* be populated.
* <p>
* Default implementation adds a {@link
* android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.CollectionInfoCompat}.
* <p>
* You should override
* {@link #getRowCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)},
* {@link #getColumnCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)},
* {@link #isLayoutHierarchical(RecyclerView.Recycler, RecyclerView.State)} and
* {@link #getSelectionModeForAccessibility(RecyclerView.Recycler, RecyclerView.State)} for
* more accurate accessibility information.
*
* @param recycler The Recycler that can be used to convert view positions into adapter
* positions
* @param state The current state of RecyclerView
* @param info The info that should be filled by the LayoutManager
* @see View#onInitializeAccessibilityNodeInfo(
*android.view.accessibility.AccessibilityNodeInfo)
* @see #getRowCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)
* @see #getColumnCountForAccessibility(RecyclerView.Recycler, RecyclerView.State)
* @see #isLayoutHierarchical(RecyclerView.Recycler, RecyclerView.State)
* @see #getSelectionModeForAccessibility(RecyclerView.Recycler, RecyclerView.State)
*/
public void onInitializeAccessibilityNodeInfo(Recycler recycler, State state,
AccessibilityNodeInfoCompat info) {
if (ViewCompat.canScrollVertically(mRecyclerView, -1) ||
ViewCompat.canScrollHorizontally(mRecyclerView, -1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
info.setScrollable(true);
}
if (ViewCompat.canScrollVertically(mRecyclerView, 1) ||
ViewCompat.canScrollHorizontally(mRecyclerView, 1)) {
info.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
info.setScrollable(true);
}
final AccessibilityNodeInfoCompat.CollectionInfoCompat collectionInfo
= AccessibilityNodeInfoCompat.CollectionInfoCompat
.obtain(getRowCountForAccessibility(recycler, state),
getColumnCountForAccessibility(recycler, state),
isLayoutHierarchical(recycler, state),
getSelectionModeForAccessibility(recycler, state));
info.setCollectionInfo(collectionInfo);
}