當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityNodeInfo.getViewIdResourceName方法代碼示例

本文整理匯總了Java中android.view.accessibility.AccessibilityNodeInfo.getViewIdResourceName方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityNodeInfo.getViewIdResourceName方法的具體用法?Java AccessibilityNodeInfo.getViewIdResourceName怎麽用?Java AccessibilityNodeInfo.getViewIdResourceName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.view.accessibility.AccessibilityNodeInfo的用法示例。


在下文中一共展示了AccessibilityNodeInfo.getViewIdResourceName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: alreadyExists

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * Checks if a node has already been added to the valid node list
 * @param node the node to check
 * @return true = node already in the list, false = node not yet in the list
 */
private boolean alreadyExists(AccessibilityNodeInfo node) {
    if (node.getViewIdResourceName() != null) {
        int i = 0;
        while (i < validNodes.size()) {
            // Iterate through each valid node in the list
            AccessibilityNodeInfo compareNode = validNodes.get(i).getAccessibilityNode();
            if (compareNode.getViewIdResourceName() != null) {
                if (compareNode.getViewIdResourceName().equals(node.getViewIdResourceName())) {
                    // If there is a node in the list with a matching ID, it already exists in
                    // the lists
                    return true;
                }
            }
            i++;
        }
    }
    return false;
}
 
開發者ID:jthomperoo,項目名稱:Forge,代碼行數:24,代碼來源:AccessibilityAutofillService.java

示例2: serialize

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public static SerializedAccessibilityNodeInfo serialize(AccessibilityNodeInfo node){
    SerializedAccessibilityNodeInfo serializedNode = new SerializedAccessibilityNodeInfo();
    Rect boundsInScreen = new Rect(), boundsInParent = new Rect();
    if(node == null){
        return null;
    }
    if(node.getClassName() != null)
        serializedNode.className = node.getClassName().toString();
    node.getBoundsInScreen(boundsInScreen);
    node.getBoundsInParent(boundsInParent);

    serializedNode.boundsInScreen = boundsInScreen.flattenToString();
    serializedNode.boundsInParent = boundsInParent.flattenToString();

    if(node.getContentDescription() != null)
        serializedNode.contentDescription = node.getContentDescription().toString();

    if(node.getText() != null){
        serializedNode.text = node.getText().toString();
    }

    if(node.getViewIdResourceName() != null)
        serializedNode.viewId = node.getViewIdResourceName();

    int childCount = node.getChildCount();
    for(int i = 0; i < childCount; i ++){
        if(node.getChild(i) != null){
            serializedNode.children.add(serialize(node.getChild(i)));
        }
    }

    return serializedNode;
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:34,代碼來源:AccessibilityUtils.java

示例3: findNodeInfosById

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public static  List<AccessibilityNodeInfo>  findNodeInfosById(AccessibilityNodeInfo nodeInfo, String id) {
        if (TextUtils.isEmpty(id)) {
            L.e("name is null" + id);
            return nodeInfoList;
        }
        if (nodeInfo == null) {
            L.e("nodeInfo is null " + nodeInfo);
            return nodeInfoList;
        }
//        L.d("findNodeInfosByName "+nodeInfo.getText());
        String viewIdResourceName = nodeInfo.getViewIdResourceName();
        L.d("viewIdResourceName " + viewIdResourceName + " child Count " + nodeInfo.getChildCount());
        if (id.equals(viewIdResourceName)) {
            nodeInfoList.add(nodeInfo);
            return nodeInfoList;
        }
        for (int i = 0; i < nodeInfo.getChildCount(); i++) {
            findNodeInfosByName(nodeInfo.getChild(i), id);
        }
        return nodeInfoList;
    }
 
開發者ID:kaixuanluo,項目名稱:pc-android-controller-android,代碼行數:22,代碼來源:AccessUtil.java

示例4: check

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@Override
public boolean check(AccessibilityNodeInfo n) {
    return (n.getViewIdResourceName() != null) && (
            (n.getViewIdResourceName().startsWith("com.android.systemui")) || (n.getViewIdResourceName().startsWith("com.android.launcher3")));
}
 
開發者ID:PhilippC,項目名稱:keepass2android,代碼行數:6,代碼來源:AutoFillService.java


注:本文中的android.view.accessibility.AccessibilityNodeInfo.getViewIdResourceName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。