当前位置: 首页>>代码示例>>Java>>正文


Java AccessibilityNodeInfoCompat.setScrollable方法代码示例

本文整理汇总了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);
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:22,代码来源:DirectionalViewpager.java

示例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);
            }
        }
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:18,代码来源:NestedScrollView.java

示例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);
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:13,代码来源:VerticalViewPager.java

示例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);
    }
}
 
开发者ID:reyanshmishra,项目名称:Rey-MusicPlayer,代码行数:13,代码来源:VelocityViewPager.java

示例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);
    }
}
 
开发者ID:ruiqiao2017,项目名称:Renrentou,代码行数:13,代码来源:XCCycleViewPager.java

示例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);
    }
}
 
开发者ID:smallsilver,项目名称:VerticalWebView,代码行数:13,代码来源:VerticalParentViewPager.java

示例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);
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:12,代码来源:YViewPager.java

示例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);
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:13,代码来源:YViewPagerNew.java

示例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);
    }
}
 
开发者ID:youngkaaa,项目名称:YViewPagerDemo,代码行数:13,代码来源:YViewPagerOrigin.java

示例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)));
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:RecyclerView.java

示例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);
	}
}
 
开发者ID:fengshihao,项目名称:WebPager,代码行数:13,代码来源:CustomViewPager.java

示例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);
          }
      }
 
开发者ID:benniaobuguai,项目名称:android-project-gallery,代码行数:14,代码来源:ViewPagerCompat.java

示例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);
    }
}
 
开发者ID:sega4revenge,项目名称:Sega,代码行数:13,代码来源:ViewPagerEx.java

示例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);
    }
}
 
开发者ID:JackChan1999,项目名称:boohee_v5.6,代码行数:12,代码来源:ViewPager.java

示例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);
}
 
开发者ID:MLNO,项目名称:airgram,代码行数:46,代码来源:RecyclerView.java


注:本文中的android.support.v4.view.accessibility.AccessibilityNodeInfoCompat.setScrollable方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。