使用辅助功能滚动搜寻栏

时间:2018-07-05 07:30:35

标签: android accessibility seekbar android-seekbar

我想滚动搜索栏并执行相应操作。以下是iam从应用程序获取的节点信息。

   className: android.widget.SeekBar; text: null; error: null; maxTextLength: -1; contentDescription: null; viewIdResName: com.sampleApp:id/duty_switch_go_home; checkable: false; checked: false; focusable: true; focused: false; selected: false; clickable: false; longClickable: false; contextClickable: false; enabled: true; password: false; scrollable: false; importantForAccessibility: true; actions: [AccessibilityAction: ACTION_FOCUS - null, AccessibilityAction: ACTION_SELECT - null, AccessibilityAction: ACTION_CLEAR_SELECTION - null, AccessibilityAction: ACTION_ACCESSIBILITY_FOCUS - null, AccessibilityAction: ACTION_SCROLL_FORWARD - null, AccessibilityAction: ACTION_SHOW_ON_SCREEN - null, AccessibilityAction: ACTION_SET_PROGRESS - null]

这是搜索栏的图像。我想从离线切换到在线。

enter image description here

我可以将搜索栏移动到确切的在线位置。但是它没有被激活。如果我在搜索栏上点击一次,那么只有它会进入激活状态。这是我的代码。

 String id =childNode.getViewIdResourceName().toString(); 
 if(id.equals("com.sampleApp:id/duty_switch_go_home")) 
 {
 Bundle arguments = new Bundle();
                                arguments.putFloat(AccessibilityNodeInfo.ACTION_ARGUMENT_PROGRESS_VALUE, (float) 50.0);//
                                childNode.performAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_SET_PROGRESS.getId(), arguments);
 }

我喜欢这样。

enter image description here

请任何人帮助我解决问题。

0 个答案:

没有答案
相关问题