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


Java AccessibilityNodeInfo.isClickable方法代碼示例

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


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

示例1: iteratorSMZDM

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private void iteratorSMZDM(AccessibilityNodeInfo info) {
    if (info.getChildCount() == 0 && info.getText() != null) {
        if (info.getText().equals("簽到")) {
            AccessibilityNodeInfo parent = info.getParent();
            if ("android.widget.RelativeLayout".equals(parent.getClassName())
                    && parent.isClickable()) {
                parent.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                found = true;
                return;
            }
        }
    } else {
        for (int i = 0; i < info.getChildCount(); i++) {
            if(info.getChild(i)!=null){
                if (found) {
                    found = false;
                    break;
                }
                iteratorSMZDM(info.getChild(i));
            }
        }
    }
    return ;
}
 
開發者ID:Sl0v3C,項目名稱:Android_AutoSignInTool,代碼行數:25,代碼來源:autoSignInSMZDM.java

示例2: iterator

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private void iterator(AccessibilityNodeInfo info, AccessibilityService service) {
    if (info.getText() != null) {
        if (info.getText().equals("簽到") && info.isClickable()) {
            info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            delay(3000);
            iterator(service.getRootInActiveWindow(), service);
            found = true;
            return;
        }
    } else {
        for (int i = 0; i < info.getChildCount(); i++) {
            if(info.getChild(i)!=null){
                if (found) {
                    found = false;
                    break;
                }
                iterator(info.getChild(i), service);
            }
        }
    }
    return ;
}
 
開發者ID:Sl0v3C,項目名稱:Android_AutoSignInTool,代碼行數:23,代碼來源:autoSignInTXDM.java

示例3: iteratorTXDM

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private void iteratorTXDM(AccessibilityNodeInfo info, AccessibilityService service) {
    List<AccessibilityNodeInfo> node  = info.findAccessibilityNodeInfosByViewId("com.qq.ac.android:id/tab_layout_center");
    if (node != null) {
        AccessibilityNodeInfo find = node.get(0);
        if ("android.widget.RelativeLayout".equals(find.getClassName())
                && find.isClickable()) {
            find.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            delay(3000);
            iterator(service.getRootInActiveWindow(), service);
            found = true;
            return;
        }

    } else {
        for (int i = 0; i < info.getChildCount(); i++) {
            if(info.getChild(i)!=null){
                if (found) {
                    found = false;
                    break;
                }
                iteratorTXDM(info.getChild(i), service);
            }
        }
    }
    return ;
}
 
開發者ID:Sl0v3C,項目名稱:Android_AutoSignInTool,代碼行數:27,代碼來源:autoSignInTXDM.java

示例4: simulationClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.JELLY_BEAN) private void simulationClick(AccessibilityEvent event, String text){
    List<AccessibilityNodeInfo> nodeInfoList = event.getSource().findAccessibilityNodeInfosByText(text);
    Log.d(TAG,"simulationClick "+nodeInfoList.size());
    for (AccessibilityNodeInfo node : nodeInfoList) {

        if (node.isClickable() && node.isEnabled()) {
            node.performAction(AccessibilityNodeInfo.ACTION_CLICK);

        }
    }
}
 
開發者ID:yippeesoft,項目名稱:NotifyTools,代碼行數:12,代碼來源:RobService.java

示例5: iteratorJD

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private void iteratorJD(AccessibilityNodeInfo info) {
    if (info.getText() != null) {
        if (info.getText().toString().contains("會員") && !info.getText().equals("PLUS會員")) {
            AccessibilityNodeInfo parent = info.getParent();
            if ("android.widget.RelativeLayout".equals(parent.getClassName())
                    && parent.isClickable()) {
                parent.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                found = true;
                return ;
            }
        }
        if (info.getText().equals("簽到")
                && info.findAccessibilityNodeInfosByViewId("com.jd.lib.coupon:id/sign_get_button") != null
                && info.isClickable()) {
            info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            found = true;
            return;
        }
    } else {
        for (int i = 0; i < info.getChildCount(); i++) {
            if(info.getChild(i)!=null){
                if (found) {
                    found  = false;
                    break;
                }
                iteratorJD(info.getChild(i));
            }
        }
    }
    return ;
}
 
開發者ID:Sl0v3C,項目名稱:Android_AutoSignInTool,代碼行數:32,代碼來源:autoSignInJD.java

示例6: getClickableNode

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * 獲取一個可以點擊的節點
 */
private AccessibilityNodeInfo getClickableNode(AccessibilityNodeInfo node){
	AccessibilityNodeInfo parent=node;
	while(parent!=null){
		if(parent.isClickable()){
			break;
		}
		parent=parent.getParent();
	}
	return parent;
}
 
開發者ID:qq1198,項目名稱:mtoolbox,代碼行數:14,代碼來源:HongBaoService.java

示例7: recycle

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public void recycle(AccessibilityNodeInfo info) {
    try {
        if (info.getChildCount() == 0) {
            if (info.getText() != null) {
                if ("領取紅包".equals(info.getText().toString())) {
                    if (info.isClickable()) {
                        info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                    }
                    AccessibilityNodeInfo parent = info.getParent();
                    while (parent != null) {
                        if (parent.isClickable()) {
                            parents.add(parent);
                            break;
                        }
                        parent = parent.getParent();
                    }
                }
            }
        } else {
            for (int i = 0; i < info.getChildCount(); i++) {
                if (info.getChild(i) != null) {
                    recycle(info.getChild(i));
                }
            }
        }
    } catch (Exception e) {


    }
}
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:31,代碼來源:Air.java

示例8: getClickableNode

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
    * 獲取一個可以點擊的節點
    */
   private AccessibilityNodeInfo getClickableNode(AccessibilityNodeInfo node)
   {
AccessibilityNodeInfo parent=node;
while (parent != null)
{
    if (parent.isClickable())
    {
	break;
    }
    parent = parent.getParent();
}
return parent;
   }
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:17,代碼來源:dex_smali.java

示例9: performClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * 點擊事件
 */
public static void performClick(AccessibilityNodeInfo nodeInfo) {
    if (nodeInfo == null) {
        return;
    }
    if (nodeInfo.isClickable()) {
        nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
    } else {
        performClick(nodeInfo.getParent());
    }
}
 
開發者ID:kaixuanluo,項目名稱:pc-android-controller-android,代碼行數:14,代碼來源:AccessUtil.java

示例10: parseNodeInfoAndOpenGetPacketDialog

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
private void parseNodeInfoAndOpenGetPacketDialog(AccessibilityNodeInfo accessibilityNodeInfo){
    if(accessibilityNodeInfo != null && accessibilityNodeInfo.getChildCount() >0){
        for(int i = 0;i<accessibilityNodeInfo.getChildCount();i++){
            AccessibilityNodeInfo child = accessibilityNodeInfo.getChild(i);
            parseNodeInfoAndOpenGetPacketDialog(child);
        }
    }else{
        if(accessibilityNodeInfo != null && !TextUtils.isEmpty(accessibilityNodeInfo.getText())&&accessibilityNodeInfo.getText().toString().contains("領取紅包")){
            Log.i(TAG,"領取紅包");
            if(accessibilityNodeInfo.isClickable()){
                accessibilityNodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            }else{
                AccessibilityNodeInfo parent  = accessibilityNodeInfo.getParent();
                while(parent != null ){
                    if(parent.isClickable()){
                        parent.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                        break;
                    }

                    parent = parent.getParent();
                    Log.i(TAG," 找到一個可以點擊的節點");
                }



            }

        }
    }

}
 
開發者ID:WanAndroid,項目名稱:GetRedPackets,代碼行數:32,代碼來源:GetRedPacketService.java

示例11: doClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * 執行點擊
 *
 * @param infos
 */
private void doClick(List<AccessibilityNodeInfo> infos) {
    if (infos != null)
        for (AccessibilityNodeInfo info : infos) {
            if (info.isEnabled() && info.isClickable()) {
                Log.i(TAG, "> doClick: " + info.getText());
                info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            }

        }
}
 
開發者ID:qoli,項目名稱:MiHomePlus,代碼行數:16,代碼來源:MyAccessibility.java

示例12: performClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/** 點擊事件 */
public static void performClick(AccessibilityNodeInfo nodeInfo) {
    if(nodeInfo == null) {
        return;
    }
    if(nodeInfo.isClickable()) {
        nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
    } else {
        performClick(nodeInfo.getParent());
    }
}
 
開發者ID:A-Miracle,項目名稱:QiangHongBao,代碼行數:12,代碼來源:AccessibilityUtils.java

示例13: performClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public static void performClick(AccessibilityNodeInfo nodeInfo) {
    if (nodeInfo == null) {
        return;
    }
    if (nodeInfo.isClickable()) {
        nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
    } else {
        performClick(nodeInfo.getParent());
    }
}
 
開發者ID:xmlxin,項目名稱:ReplyMessage,代碼行數:11,代碼來源:PerformClickUtils.java

示例14: performClick

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
/**
 * 模擬點擊(如果該節點不可點擊,事件分發原理,嘗試遞歸其所有parent節點)
 * @param nodeInfo
 */
public static void performClick(AccessibilityNodeInfo nodeInfo){
    if(nodeInfo == null) {
        return;
    }
    if(nodeInfo.isClickable()) {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
            nodeInfo.performAction(AccessibilityNodeInfo.ACTION_CLICK);
        }
    } else {
        performClick(nodeInfo.getParent());
    }
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:17,代碼來源:AceHelper.java

示例15: findAndAccessAccessibilityNode

import android.view.accessibility.AccessibilityNodeInfo; //導入方法依賴的package包/類
public static boolean findAndAccessAccessibilityNode(AccessibilityNodeInfo info, String[] texts, boolean fuzzy) {
    if (texts != null) {
        for (String textItem : texts) {
            List<AccessibilityNodeInfo> nodes = info.findAccessibilityNodeInfosByText(textItem);
            if (nodes != null && !nodes.isEmpty()) {
                AccessibilityNodeInfo node;
                for (int i = 0; i < nodes.size(); i++) {
                    node = nodes.get(i);
                    BaseAccessibility.logPrint("find text=" + textItem + "  enable=" + node.isEnabled());
                    CharSequence text = node.getText();

                    if (!TextUtils.isEmpty(text)) {
                        if (textItem.equals(text.toString()) || (fuzzy && text.toString().contains(textItem))) {
                            if (node.isEnabled() && node.isClickable()) {
                                if (node.getClassName().equals("android.widget.Button")
                                        || node.getClassName().equals("android.widget.TextView")
                                        || node.getClassName().equals("android.widget.CheckBox")) {
                                    autoClickNumber++;
                                    return node.performAction(AccessibilityNodeInfo.ACTION_CLICK);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    return false;
}
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:30,代碼來源:BaseAccessibility.java


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