本文整理汇总了Java中android.view.accessibility.AccessibilityNodeInfo.isEnabled方法的典型用法代码示例。如果您正苦于以下问题:Java AccessibilityNodeInfo.isEnabled方法的具体用法?Java AccessibilityNodeInfo.isEnabled怎么用?Java AccessibilityNodeInfo.isEnabled使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.view.accessibility.AccessibilityNodeInfo
的用法示例。
在下文中一共展示了AccessibilityNodeInfo.isEnabled方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isAccessibilityNodeEnable
import android.view.accessibility.AccessibilityNodeInfo; //导入方法依赖的package包/类
public static boolean isAccessibilityNodeEnable(AccessibilityNodeInfo info, String[] texts) {
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.equals(text, textItem) && node.isEnabled()) {
return true;
}
}
}
}
}
return false;
}
示例2: 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);
}
}
}
示例3: 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();
}
示例4: 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);
}
}
}
示例5: 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;
}