Example usage for android.view.accessibility AccessibilityNodeInfo setClassName

List of usage examples for android.view.accessibility AccessibilityNodeInfo setClassName

Introduction

In this page you can find the example usage for android.view.accessibility AccessibilityNodeInfo setClassName.

Prototype

public void setClassName(CharSequence className) 

Source Link

Document

Sets the class this node comes from.

Usage

From source file:com.aliasapps.seq.scroller.TwoWayView.java

@Override
@TargetApi(14)//from w  ww  .j  av a  2  s.  co  m
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.setClassName(TwoWayView.class.getName());

    AccessibilityNodeInfoCompat infoCompat = new AccessibilityNodeInfoCompat(info);

    if (isEnabled()) {
        if (getFirstVisiblePosition() > 0) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }

        if (getLastVisiblePosition() < getCount() - 1) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
    }
}

From source file:com.appunite.list.AbsListView.java

@Override
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) {
        info.setClassName(AbsListView.class.getName());
    }/*from  ww  w. j av a  2 s .  co m*/
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
        if (isEnabled()) {
            if (getFirstVisiblePosition() > 0) {
                info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD);
            }
            if (getLastVisiblePosition() < getCount() - 1) {
                info.addAction(AccessibilityNodeInfo.ACTION_SCROLL_FORWARD);
            }
        }
    }
}

From source file:com.artifex.mupdf.view.ThumbnailViews.java

@Override
@TargetApi(14)//from w  w w .  j av a 2s  .  c  om
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.setClassName(ThumbnailViews.class.getName());

    AccessibilityNodeInfoCompat infoCompat = new AccessibilityNodeInfoCompat(info);

    if (isEnabled()) {
        if (getFirstVisiblePosition() > 0) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }

        if (getLastVisiblePosition() < getCount() - 1) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
    }
}

From source file:com.ruyigu.freeart.ui.widget.HorizontalListView.java

@Override
@TargetApi(14)/*from  w  w w.ja  v  a  2 s  .c o m*/
public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) {
    super.onInitializeAccessibilityNodeInfo(info);
    info.setClassName(HorizontalListView.class.getName());

    AccessibilityNodeInfoCompat infoCompat = new AccessibilityNodeInfoCompat(info);

    if (isEnabled()) {
        if (getFirstVisiblePosition() > 0) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_BACKWARD);
        }

        if (getLastVisiblePosition() < getCount() - 1) {
            infoCompat.addAction(AccessibilityNodeInfoCompat.ACTION_SCROLL_FORWARD);
        }
    }
}