本文整理匯總了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;
}