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