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


Java AccessibilityNodeInfo.isVisibleToUser方法代码示例

本文整理汇总了Java中android.view.accessibility.AccessibilityNodeInfo.isVisibleToUser方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityNodeInfo.isVisibleToUser方法的具体用法?Java AccessibilityNodeInfo.isVisibleToUser怎么用?Java AccessibilityNodeInfo.isVisibleToUser使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在android.view.accessibility.AccessibilityNodeInfo的用法示例。


在下文中一共展示了AccessibilityNodeInfo.isVisibleToUser方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: buildChildren

import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
private List<UiAutomationElement> buildChildren(AccessibilityNodeInfo node) {
    List<UiAutomationElement> children;
    int childCount = node.getChildCount();
    if (childCount == 0) {
        children = null;
    } else {
        children = new ArrayList<UiAutomationElement>(childCount);
        for (int i = 0; i < childCount; i++) {
            AccessibilityNodeInfo child = node.getChild(i);
            if (child != null && child.isVisibleToUser()) {
                children.add(this.getElement(child, this, i));
            }
        }
    }
    return children;
}
 
开发者ID:macacajs,项目名称:UIAutomatorWD,代码行数:17,代码来源:UiAutomationElement.java

示例2: isVisibleToUser

import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/***
* Check the node whether it is visible.
* @param accessibilityNodeInfo
* @return
*/
  public static boolean isVisibleToUser(AccessibilityNodeInfo accessibilityNodeInfo) {
  	if (accessibilityNodeInfo == null) {
  		return false;
  	}
    return accessibilityNodeInfo.isEnabled() && accessibilityNodeInfo.isVisibleToUser();
  }
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:12,代码来源:AppDetailsAutomatorUtil.java

示例3: UiAutomationElement

import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
/**
 * A snapshot of all attributes is taken at construction. The attributes of a
 * {@code UiAutomationElement} instance are immutable. If the underlying
 * {@link AccessibilityNodeInfo} is updated, a new {@code UiAutomationElement}
 * instance will be created in
 */
protected UiAutomationElement( AccessibilityNodeInfo node,
                               UiAutomationElement parent, int index) {
    this.node = node;
    this.parent = parent;

    Map<Attribute, Object> attribs = new EnumMap<Attribute, Object>(Attribute.class);

    put(attribs, Attribute.INDEX, index);
    put(attribs, Attribute.PACKAGE, charSequenceToString(node.getPackageName()));
    put(attribs, Attribute.CLASS, charSequenceToString(node.getClassName()));
    put(attribs, Attribute.TEXT, charSequenceToString(node.getText()));
    put(attribs, Attribute.CONTENT_DESC, charSequenceToString(node.getContentDescription()));
    put(attribs, Attribute.RESOURCE_ID, charSequenceToString(node.getViewIdResourceName()));
    put(attribs, Attribute.CHECKABLE, node.isCheckable());
    put(attribs, Attribute.CHECKED, node.isChecked());
    put(attribs, Attribute.CLICKABLE, node.isClickable());
    put(attribs, Attribute.ENABLED, node.isEnabled());
    put(attribs, Attribute.FOCUSABLE, node.isFocusable());
    put(attribs, Attribute.FOCUSED, node.isFocused());
    put(attribs, Attribute.LONG_CLICKABLE, node.isLongClickable());
    put(attribs, Attribute.PASSWORD, node.isPassword());
    put(attribs, Attribute.SCROLLABLE, node.isScrollable());
    if (node.getTextSelectionStart() >= 0
            && node.getTextSelectionStart() != node.getTextSelectionEnd()) {
        attribs.put(Attribute.SELECTION_START, node.getTextSelectionStart());
        attribs.put(Attribute.SELECTION_END, node.getTextSelectionEnd());
    }
    put(attribs, Attribute.SELECTED, node.isSelected());
    put(attribs, Attribute.BOUNDS, getBounds(node));
    attributes = Collections.unmodifiableMap(attribs);

    // Order matters as getVisibleBounds depends on visible
    visible = node.isVisibleToUser();
    visibleBounds = getVisibleBounds(node);
    List<UiAutomationElement> mutableChildren = buildChildren(node);
    this.children = mutableChildren == null ? null : Collections.unmodifiableList(mutableChildren);
}
 
开发者ID:macacajs,项目名称:UIAutomatorWD,代码行数:44,代码来源:UiAutomationElement.java


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