本文整理汇总了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 ;
}
示例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 ;
}
示例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 ;
}
示例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);
}
}
}
示例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 ;
}
示例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;
}
示例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) {
}
}
示例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;
}
示例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());
}
}
示例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," 找到一个可以点击的节点");
}
}
}
}
}
示例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);
}
}
}
示例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());
}
}
示例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());
}
}
示例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());
}
}
示例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;
}