android api21 以下怎么实现accessibilityf2fs get node infoinfo的settext怎么用

android api21下载_android api21下载相关的所有信息-学网-提供健康,养生,留学,移民,创业,汽车等信息
android api21下载
当前创建的Application,TeachCourse可以确定支持Android API版本为21,无法运行在当期API版本19的模拟器上 3.解决办法:打开manifest文件,修改如下:android:minSdkVersion...基本上没有区别,主要是一些bug修复。 2表示比1版本更高一些,但既不是主要版本变更,也不是次要版本变更。 所以更新基本不会涉及功能及api变化。 View缺省为可见的,在应用可以通过setVisibility 修改View的可见性,View可用性可以有如下三种状态: View.VISIBLE View可见 View.INVISIBLE View不可以见,但仍然占据可见时...嗯,你可以选着的,19应该是Android4.2吧,你可以去官网下载,API从15到23,API 23就到6.0了。 在布局文件中手写ListView标签试试,或者关闭布局文件页面重新打开可能是下载的服务器地址被墙了/reference/packages.html 这个是最全的,就是英文看起来有点儿麻烦。 有中文的,不过翻译不全而且翻译的不好。建议看英文文档不需要下载, 你下载android的SDK里面就有api文档 例如 解压android的sdk即 android-sdk-windows-2.1 后,就可以在android-sdk-windows-2.1的文件夹下看到一个documenta...你的程序使用的API版本为12 但是你的模拟器的API版本却是0 换一e个d模拟器,将API版本换成8 就可以8了p。。。 zi颉oЗlЕ┓ek萤j困vrXЁoЗ hprof-conv.exe如果不存在的话,从别的地方copy过来一个就行。如果存在的还报这个错误,考虑是不是adb.exe的问题。
您可能还关注:&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&Android实现QQ抢红包插件
作者:janking
字体:[ ] 类型:转载 时间:
这篇文章主要介绍了Android实现QQ抢红包插件,可以支持抢QQ拼手气红包,普通红包,口令红包,感兴趣的小伙伴们可以参考一下
又想到快要过年了,到时候还不知道群里要发好多红包,所以我将之前在网上宕的一份微信抢红包的代码修改了一下,实现了QQ抢红包!可以支持抢QQ拼手气红包,普通红包,口令红包,现在再也不怕20年单身手速的人跟我抢红包了!
先看测试效果图:
1.抢QQ口令红包&
&&&&&&&&&&&&&&&&&&&&&&&&&&&&
&可以看见,只要红包一发出,自动填写口令并发出,帮你将红包抢到手!
2.抢QQ拼手气红包&&&&&&&&&&&&&&&&&
拼手气红包也是一样,只要红包一发出,自动帮你把红包抢到手,是不是很爽的感觉?
3.抢QQ好友发送的红包
只要好友或者群里的人把红包一发出,就会第一时间让你抢到红包!所以只要在群里面开启插件,抢红包从来都是百发百中!好了废话不多说了,也不吹嘘有多牛多好了,下面直接给大家上代码:
MainActivity:
/*MainActivity中的代码基本没改变:*/
public class MainActivity extends AppCompatActivity {
private final Intent mAccessibleIntent = new Intent(Settings.ACTION_ACCESSIBILITY_SETTINGS);
private Button switchP
@Overrideprotected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
switchPlugin = (Button) findViewById(R.id.button_accessible);
updateServiceStatus();
/*开启插件的按钮*/
public void onButtonClicked(View view) {startActivity(mAccessibleIntent);}
@Overrideprotected void onResume() {
super.onResume();
updateServiceStatus();
private void updateServiceStatus() {
boolean serviceEnabled =
AccessibilityManager accessibilityManager = (AccessibilityManager) getSystemService(Context.ACCESSIBILITY_SERVICE);
List&AccessibilityServiceInfo& accessibilityServices = accessibilityManager.getEnabledAccessibilityServiceList(AccessibilityServiceInfo.FEEDBACK_GENERIC);
for (AccessibilityServiceInfo info : accessibilityServices) {
if (info.getId().equals(getPackageName() + "/.QQHongbaoService")) {
serviceEnabled =
if (serviceEnabled) {
switchPlugin.setText("关闭插件");
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
switchPlugin.setText("开启插件");
getWindow().clearFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);}
这里是MainActivity中的全部代码,是不是很少的样子,主要是实现了一个按钮去开启ACCESSIBILITY_SERVICE。这个插件主要就是借助AccessibilityService这个服务来实现。所以剩下的代码就都在这个服务中了!
QQHongbaoService:
public class QQHongbaoService extends AccessibilityService {
private static final String WECHAT_OPEN_EN = "Open";
private static final String WECHAT_OPENED_EN = "You've opened";
private final static String QQ_DEFAULT_CLICK_OPEN = "点击拆开";
private final static String QQ_HONG_BAO_PASSWORD = "口令红包";
private final static String QQ_CLICK_TO_PASTE_PASSWORD = "点击输入口令";
private boolean mLuckyMoneyR
private String lastFetchedHongbaoId =
private long lastFetchedTime = 0;
private static final int MAX_CACHE_TOLERANCE = 5000;
private AccessibilityNodeInfo rootNodeI
private List&AccessibilityNodeInfo& mReceiveN
@TargetApi(Build.VERSION_CODES.KITKAT)
public void recycle(AccessibilityNodeInfo info) {
if (info.getChildCount() == 0) {
/*这个if代码的作用是:匹配“点击输入口令的节点,并点击这个节点”*/
if(info.getText()!=null&&info.getText().toString().equals(QQ_CLICK_TO_PASTE_PASSWORD)) {
info.getParent().performAction(AccessibilityNodeInfo.ACTION_CLICK);
/*这个if代码的作用是:匹配文本编辑框后面的发送按钮,并点击发送口令*/
if (info.getClassName().toString().equals("android.widget.Button") && info.getText().toString().equals("发送")) {
info.performAction(AccessibilityNodeInfo.ACTION_CLICK);
for (int i = 0; i & info.getChildCount(); i++) {
if (info.getChild(i) != null) {
recycle(info.getChild(i));
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
public void onAccessibilityEvent(AccessibilityEvent event) {
this.rootNodeInfo = event.getSource();
if (rootNodeInfo == null) {
mReceiveNode =
checkNodeInfo();
/* 如果已经接收到红包并且还没有戳开 */
if (mLuckyMoneyReceived && (mReceiveNode != null)) {
int size = mReceiveNode.size();
if (size & 0) {
String id = getHongbaoText(mReceiveNode.get(size - 1));
long now = System.currentTimeMillis();
if (this.shouldReturn(id, now - lastFetchedTime))
lastFetchedHongbaoId =
lastFetchedTime =
AccessibilityNodeInfo cellNode = mReceiveNode.get(size - 1);
if (cellNode.getText().toString().equals("口令红包已拆开")) {
cellNode.getParent().performAction(AccessibilityNodeInfo.ACTION_CLICK);
if (cellNode.getText().toString().equals(QQ_HONG_BAO_PASSWORD)) {
AccessibilityNodeInfo rowNode = getRootInActiveWindow();
if (rowNode == null) {
Log.e(TAG, "noteInfo is null");
recycle(rowNode);
mLuckyMoneyReceived =
private void checkNodeInfo() {
if (rootNodeInfo == null) {
/* 聊天会话窗口,遍历节点匹配“点击拆开”,“口令红包”,“点击输入口令” */
List&AccessibilityNodeInfo& nodes1 = this.findAccessibilityNodeInfosByTexts(this.rootNodeInfo, new String[]{QQ_DEFAULT_CLICK_OPEN, QQ_HONG_BAO_PASSWORD, QQ_CLICK_TO_PASTE_PASSWORD, "发送"});
if (!nodes1.isEmpty()) {
String nodeId = Integer.toHexString(System.identityHashCode(this.rootNodeInfo));
if (!nodeId.equals(lastFetchedHongbaoId)) {
mLuckyMoneyReceived =
mReceiveNode = nodes1;
private String getHongbaoText(AccessibilityNodeInfo node) {
/* 获取红包上的文本 */
AccessibilityNodeInfo i = node.getParent().getChild(0);
content = i.getText().toString();
} catch (NullPointerException npe) {
private boolean shouldReturn(String id, long duration) {
if (id == null)
// 名称和缓存不一致
if (duration & MAX_CACHE_TOLERANCE && id.equals(lastFetchedHongbaoId)) {
private List&AccessibilityNodeInfo& findAccessibilityNodeInfosByTexts(AccessibilityNodeInfo nodeInfo, String[] texts) {
for (String text : texts) {
if (text == null)
List&AccessibilityNodeInfo& nodes = nodeInfo.findAccessibilityNodeInfosByText(text);
if (!nodes.isEmpty()) {
if (text.equals(WECHAT_OPEN_EN) && !nodeInfo.findAccessibilityNodeInfosByText(WECHAT_OPENED_EN).isEmpty()) {
return new ArrayList&&();
public void onInterrupt() {}
QQHongbaoService的全部代码也在这里,代码不多。首先,在这个服务中主要是通过findAccessibilityNodeInfosByText这个方法去获我们需要的节点;然后用performAction(AccessibilityNodeInfo.ACTION_CLICK)这个方法去点击红包节点,关键思路大概就是这样!另外如果是口令红包,我们需要先按照上面的步骤将红包戳开,然后通过performAction(AccessibilityNodeInfo.ACTION_CLICK)去点击输入口令,最后再通过点击去发送即可实现!QQHongbaoService需要在AndroidManifest.xml文件中注册,
注册的&application&节点如下图:
总体来看,只是将微信抢红包的代码做了少量的修改,在这里要感谢各位大神对微信抢红包源码的贡献!最后也希望这篇文章能给大家有所帮助,在抢红包大战中虐死单身狗,再也不怕你20年的单身手速了!!!
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具android 模拟抢微信红包例子源码下载(AccessibilityService实现)
Android平台开发
开发语言:Java
实例大小:1.45M
下载次数:
浏览次数:
发布时间:
实例类别:Android平台开发
发 布 人:
所需积分:2
&相关标签:
同类人气实例
实例下载地址
android 模拟抢微信红包例子源码下载(AccessibilityService实现)
不能下载?内容有错? 点击这里报错
好例子网口号:伸出你的我的手 & 分享!
1 楼 小白菜的北京 发表于:
我为什么运行不了呢? public class NotificationService extends NotificationListenerService
没有这个NotificationListenerService
2 楼 xiaoha 发表于:
下载下来看看,还不知道好不好用
3 楼 xiaoha 发表于:
下载下来看看,还不知道好不好用
4 楼 ZHOU 发表于:
我一直在想是怎么启动这个服务的 。
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
Copyright &
好例子网(www.haolizi.net).All Rights Reserved备案编号:冀ICP备号 石公备号(10)AccessibilityNodeInfoCompat (support-v4-animator r13 API)
android.support.v4.view.accessibility
Class AccessibilityNodeInfoCompat
android.support.v4.view.accessibility.AccessibilityNodeInfoCompat
public class AccessibilityNodeInfoCompatextends
Helper for accessing AccessibilityNodeInfo
introduced after API level 4 in a backwards compatible fashion.
static&int
&&&&&&&&&&Action that gives accessibility focus to the node.
&&&&&&&&&&Argument for which HTML element to get moving to the next/previous HTML element.
&&&&&&&&&&Argument for which movement granularity to be used when traversing the node text.
static&int
&&&&&&&&&&Action that clears accessibility focus of the node.
static&int
&&&&&&&&&&Action that unfocuses the node.
static&int
&&&&&&&&&&Action that unselects the node.
static&int
&&&&&&&&&&Action that clicks on the node info.
static&int
&&&&&&&&&&Action that focuses the node.
static&int
&&&&&&&&&&Action that long clicks on the node.
static&int
&&&&&&&&&&Action that requests to go to the next entity in this node's text
at a given movement granularity.
static&int
&&&&&&&&&&Action to move to the next HTML element of a given type.
static&int
&&&&&&&&&&Action that requests to go to the previous entity in this node's text
at a given movement granularity.
static&int
&&&&&&&&&&Action to move to the previous HTML element of a given type.
static&int
&&&&&&&&&&Action to scroll the node content backward.
static&int
&&&&&&&&&&Action to scroll the node content forward.
static&int
&&&&&&&&&&Action that selects the node.
static&int
&&&&&&&&&&The accessibility focus.
static&int
&&&&&&&&&&The input focus.
static&int
&&&&&&&&&&Movement granularity bit for traversing the text of a node by character.
static&int
&&&&&&&&&&Movement granularity bit for traversing the text of a node by line.
static&int
&&&&&&&&&&Movement granularity bit for traversing the text of a node by page.
static&int
&&&&&&&&&&Movement granularity bit for traversing the text of a node by paragraph.
static&int
&&&&&&&&&&Movement granularity bit for traversing the text of a node by word.
&&&&&&&&&&Creates a new instance wrapping an
AccessibilityNodeInfo.
(int&action)
&&&&&&&&&&Adds an action that can be performed on the node.
(android.view.View&child)
&&&&&&&&&&Adds a child.
(android.view.View&root,
int&virtualDescendantId)
&&&&&&&&&&Adds a virtual child which is a descendant of the given root.
&&&&&&&&&&&
&&&&&&&&&&Finds AccessibilityNodeInfos by text.
(int&focus)
&&&&&&&&&&Find the view that has the specified focus type.
(int&direction)
&&&&&&&&&&Searches for the nearest view in the specified direction that can take
input focus.
&&&&&&&&&&Gets the actions that can be performed on the node.
(android.graphics.Rect&outBounds)
&&&&&&&&&&Gets the node bounds in parent coordinates.
(android.graphics.Rect&outBounds)
&&&&&&&&&&Gets the node bounds in screen coordinates.
(int&index)
&&&&&&&&&&Get the child at given index.
&&&&&&&&&&Gets the number of children.
&&&&&&&&&&Gets the class this node comes from.
&&&&&&&&&&Gets the content description of this node.
&&&&&&&&&&&
&&&&&&&&&&Gets the movement granularities for traversing the text of this node.
&&&&&&&&&&Gets the package this node comes from.
&&&&&&&&&&Gets the parent.
&&&&&&&&&&Gets the text of this node.
&&&&&&&&&&Gets the id of the window from which the info comes from.
&&&&&&&&&&&
&&&&&&&&&&Gets whether this node is accessibility focused.
&&&&&&&&&&Gets whether this node is checkable.
&&&&&&&&&&Gets whether this node is checked.
&&&&&&&&&&Gets whether this node is clickable.
&&&&&&&&&&Gets whether this node is enabled.
&&&&&&&&&&Gets whether this node is focusable.
&&&&&&&&&&Gets whether this node is focused.
&&&&&&&&&&Gets whether this node is long clickable.
&&&&&&&&&&Gets whether this node is a password.
&&&&&&&&&&Gets if the node is scrollable.
&&&&&&&&&&Gets whether this node is selected.
&&&&&&&&&&Sets whether this node is visible to the user.
&&&&&&&&&&Returns a cached instance if such is available otherwise a new one.
&&&&&&&&&&Returns a cached instance if such is available or a new one is create.
(android.view.View&source)
&&&&&&&&&&Returns a cached instance if such is available otherwise a new one and
sets the source.
(android.view.View&root,
int&virtualDescendantId)
&&&&&&&&&&Returns a cached instance if such is available otherwise a new one
and sets the source.
(int&action)
&&&&&&&&&&Performs an action on the node.
(int&action,
android.os.Bundle&arguments)
&&&&&&&&&&Performs an action on the node.
&&&&&&&&&&Return an instance back to be reused.
(boolean&focused)
&&&&&&&&&&Sets whether this node is accessibility focused.
(android.graphics.Rect&bounds)
&&&&&&&&&&Sets the node bounds in parent coordinates.
(android.graphics.Rect&bounds)
&&&&&&&&&&Sets the node bounds in screen coordinates.
(boolean&checkable)
&&&&&&&&&&Sets whether this node is checkable.
(boolean&checked)
&&&&&&&&&&Sets whether this node is checked.
(&className)
&&&&&&&&&&Sets the class this node comes from.
(boolean&clickable)
&&&&&&&&&&Sets whether this node is clickable.
(&contentDescription)
&&&&&&&&&&Sets the content description of this node.
(boolean&enabled)
&&&&&&&&&&Sets whether this node is enabled.
(boolean&focusable)
&&&&&&&&&&Sets whether this node is focusable.
(boolean&focused)
&&&&&&&&&&Sets whether this node is focused.
(boolean&longClickable)
&&&&&&&&&&Sets whether this node is long clickable.
(int&granularities)
&&&&&&&&&&Sets the movement granularities for traversing the text of this node.
(&packageName)
&&&&&&&&&&Sets the package this node comes from.
(android.view.View&parent)
&&&&&&&&&&Sets the parent.
(android.view.View&root,
int&virtualDescendantId)
&&&&&&&&&&Sets the parent to be a virtual descendant of the given root.
(boolean&password)
&&&&&&&&&&Sets whether this node is a password.
(boolean&scrollable)
&&&&&&&&&&Sets if the node is scrollable.
(boolean&selected)
&&&&&&&&&&Sets whether this node is selected.
(android.view.View&source)
&&&&&&&&&&Sets the source.
(android.view.View&root,
int&virtualDescendantId)
&&&&&&&&&&Sets the source to be a virtual descendant of the given root.
&&&&&&&&&&Sets the text of this node.
(boolean&visibleToUser)
&&&&&&&&&&Sets whether this node is visible to the user.
, , , , , , , ,
ACTION_FOCUS
public static final int ACTION_FOCUS
Action that focuses the node.
ACTION_CLEAR_FOCUS
public static final int ACTION_CLEAR_FOCUS
Action that unfocuses the node.
ACTION_SELECT
public static final int ACTION_SELECT
Action that selects the node.
ACTION_CLEAR_SELECTION
public static final int ACTION_CLEAR_SELECTION
Action that unselects the node.
ACTION_CLICK
public static final int ACTION_CLICK
Action that clicks on the node info.
ACTION_LONG_CLICK
public static final int ACTION_LONG_CLICK
Action that long clicks on the node.
ACTION_ACCESSIBILITY_FOCUS
public static final int ACTION_ACCESSIBILITY_FOCUS
Action that gives accessibility focus to the node.
ACTION_CLEAR_ACCESSIBILITY_FOCUS
public static final int ACTION_CLEAR_ACCESSIBILITY_FOCUS
Action that clears accessibility focus of the node.
ACTION_NEXT_AT_MOVEMENT_GRANULARITY
public static final int ACTION_NEXT_AT_MOVEMENT_GRANULARITY
Action that requests to go to the next entity in this node's text
at a given movement granularity. For example, move to the next character,
word, etc.
Arguments:
Bundle arguments = new Bundle();
arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER);
info.performAction(AccessibilityNodeInfo.ACTION_NEXT_AT_MOVEMENT_GRANULARITY, arguments);
See Also:,
ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
public static final int ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY
Action that requests to go to the previous entity in this node's text
at a given movement granularity. For example, move to the next character,
word, etc.
Arguments:
Bundle arguments = new Bundle();
arguments.putInt(AccessibilityNodeInfo.ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT,
AccessibilityNodeInfo.MOVEMENT_GRANULARITY_CHARACTER);
info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY,
arguments);
See Also:,
ACTION_NEXT_HTML_ELEMENT
public static final int ACTION_NEXT_HTML_ELEMENT
Action to move to the next HTML element of a given type. For example, move
to the BUTTON, INPUT, TABLE, etc.
Arguments:
Bundle arguments = new Bundle();
arguments.putString(AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON");
info.performAction(AccessibilityNodeInfo.ACTION_NEXT_HTML_ELEMENT, arguments);
ACTION_PREVIOUS_HTML_ELEMENT
public static final int ACTION_PREVIOUS_HTML_ELEMENT
Action to move to the previous HTML element of a given type. For example, move
to the BUTTON, INPUT, TABLE, etc.
Arguments:
Bundle arguments = new Bundle();
arguments.putString(AccessibilityNodeInfo.ACTION_ARGUMENT_HTML_ELEMENT_STRING, "BUTTON");
info.performAction(AccessibilityNodeInfo.ACTION_PREVIOUS_HTML_ELEMENT, arguments);
ACTION_SCROLL_FORWARD
public static final int ACTION_SCROLL_FORWARD
Action to scroll the node content forward.
ACTION_SCROLL_BACKWARD
public static final int ACTION_SCROLL_BACKWARD
Action to scroll the node content backward.
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
public static final
ACTION_ARGUMENT_MOVEMENT_GRANULARITY_INT
Argument for which movement granularity to be used when traversing the node text.
Actions: ,
ACTION_ARGUMENT_HTML_ELEMENT_STRING
public static final
ACTION_ARGUMENT_HTML_ELEMENT_STRING
Argument for which HTML element to get moving to the next/previous HTML element.
Type: String
Actions: ,
FOCUS_INPUT
public static final int FOCUS_INPUT
The input focus.
FOCUS_ACCESSIBILITY
public static final int FOCUS_ACCESSIBILITY
The accessibility focus.
MOVEMENT_GRANULARITY_CHARACTER
public static final int MOVEMENT_GRANULARITY_CHARACTER
Movement granularity bit for traversing the text of a node by character.
MOVEMENT_GRANULARITY_WORD
public static final int MOVEMENT_GRANULARITY_WORD
Movement granularity bit for traversing the text of a node by word.
MOVEMENT_GRANULARITY_LINE
public static final int MOVEMENT_GRANULARITY_LINE
Movement granularity bit for traversing the text of a node by line.
MOVEMENT_GRANULARITY_PARAGRAPH
public static final int MOVEMENT_GRANULARITY_PARAGRAPH
Movement granularity bit for traversing the text of a node by paragraph.
MOVEMENT_GRANULARITY_PAGE
public static final int MOVEMENT_GRANULARITY_PAGE
Movement granularity bit for traversing the text of a node by page.
AccessibilityNodeInfoCompat
public AccessibilityNodeInfoCompat(&info)
Creates a new instance wrapping an
AccessibilityNodeInfo.
Parameters:info - The info.
Returns:The wrapped AccessibilityNodeInfo.
public static
obtain(android.view.View&source)
Returns a cached instance if such is available otherwise a new one and
sets the source.
Returns:An instance.See Also:
public static
obtain(android.view.View&root,
int&virtualDescendantId)
Returns a cached instance if such is available otherwise a new one
and sets the source.
Parameters:root - The root of the virtual subtree.virtualDescendantId - The id of the virtual descendant.
Returns:An instance.See Also:
public static
Returns a cached instance if such is available otherwise a new one.
Returns:An instance.
public static
obtain(&info)
Returns a cached instance if such is available or a new one is create.
The returned instance is initialized from the given info.
Parameters:info - The other info.
Returns:An instance.
public void setSource(android.view.View&source)
Sets the source.
Parameters:source - The info source.
public void setSource(android.view.View&root,
int&virtualDescendantId)
Sets the source to be a virtual descendant of the given root.
If virtualDescendantId is View.NO_ID the root
is set as the source.
A virtual descendant is an imaginary View that is reported as a part of the view
hierarchy for accessibility purposes. This enables custom views that draw complex
content to report themselves as a tree of virtual views, thus conveying their
logical structure.
Note: Cannot be called from an
AccessibilityService.
This class is made immutable before being delivered to an AccessibilityService.
Parameters:root - The root of the virtual subtree.virtualDescendantId - The id of the virtual descendant.
findFocus(int&focus)
Find the view that has the specified focus type. The search starts from
the view represented by this node info.
Parameters:focus - The focus to find. One of
Returns:The node info of the focused view or null.See Also:,
focusSearch
focusSearch(int&direction)
Searches for the nearest view in the specified direction that can take
input focus.
Parameters:direction - The direction. Can be one of:
View.FOCUS_DOWN,
View.FOCUS_UP,
View.FOCUS_LEFT,
View.FOCUS_RIGHT,
View.FOCUS_FORWARD,
View.FOCUS_BACKWARD.
Returns:The node info for the view that can take accessibility focus.
getWindowId
public int getWindowId()
Gets the id of the window from which the info comes from.
Returns:The window id.
getChildCount
public int getChildCount()
Gets the number of children.
Returns:The child count.
getChild(int&index)
Get the child at given index.
Note: It is a client responsibility to recycle the
received info by calling
avoid creating of multiple instances.
Parameters:index - The child index.
Returns:The child node.
- If called outside of an
AccessibilityService.
public void addChild(android.view.View&child)
Adds a child.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:child - The child.
- If called from an AccessibilityService.
public void addChild(android.view.View&root,
int&virtualDescendantId)
Adds a virtual child which is a descendant of the given root.
If virtualDescendantId is View.NO_ID the root
is added as a child.
A virtual descendant is an imaginary View that is reported as a part of the view
hierarchy for accessibility purposes. This enables custom views that draw complex
content to report them selves as a tree of virtual views, thus conveying their
logical structure.
Parameters:root - The root of the virtual subtree.virtualDescendantId - The id of the virtual child.
getActions
public int getActions()
Gets the actions that can be performed on the node.
Returns:The bit mask of with actions.See Also:AccessibilityNodeInfo.ACTION_FOCUS,
AccessibilityNodeInfo.ACTION_CLEAR_FOCUS,
AccessibilityNodeInfo.ACTION_SELECT,
AccessibilityNodeInfo.ACTION_CLEAR_SELECTION
public void addAction(int&action)
Adds an action that can be performed on the node.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:action - The action.
- If called from an AccessibilityService.
performAction
public boolean performAction(int&action)
Performs an action on the node.
Note: An action can be performed only if the request is
made from an AccessibilityService.
Parameters:action - The action to perform.
Returns:True if the action was performed.
- If called outside of an
AccessibilityService.
performAction
public boolean performAction(int&action,
android.os.Bundle&arguments)
Performs an action on the node.
Note: An action can be performed only if the request is made
from an AccessibilityService.
Parameters:action - The action to perform.arguments - A bundle with additional arguments.
Returns:True if the action was performed.
- If called outside of an AccessibilityService.
setMovementGranularities
public void setMovementGranularities(int&granularities)
Sets the movement granularities for traversing the text of this node.
Note: Cannot be called from an
AccessibilityService.
This class is made immutable before being delivered to an AccessibilityService.
Parameters:granularities - The bit mask with granularities.
- If called from an AccessibilityService.
getMovementGranularities
public int getMovementGranularities()
Gets the movement granularities for traversing the text of this node.
Returns:The bit mask with granularities.
findAccessibilityNodeInfosByText
public && findAccessibilityNodeInfosByText(&text)
Finds AccessibilityNodeInfos by text. The match
is case insensitive containment. The search is relative to this info i.e. this
info is the root of the traversed tree.
Note: It is a client responsibility to recycle the
received info by calling AccessibilityNodeInfo.recycle()
to avoid creating of multiple instances.
Parameters:text - The searched text.
Returns:A list of node info.
getParent()
Gets the parent.
Note: It is a client responsibility to recycle the
received info by calling AccessibilityNodeInfo.recycle()
to avoid creating of multiple instances.
Returns:The parent.
public void setParent(android.view.View&parent)
Sets the parent.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:parent - The parent.
- If called from an AccessibilityService.
public void setParent(android.view.View&root,
int&virtualDescendantId)
Sets the parent to be a virtual descendant of the given root.
If virtualDescendantId equals to View.NO_ID the root
is set as the parent.
A virtual descendant is an imaginary View that is reported as a part of the view
hierarchy for accessibility purposes. This enables custom views that draw complex
content to report them selves as a tree of virtual views, thus conveying their
logical structure.
Note: Cannot be called from an
AccessibilityService.
This class is made immutable before being delivered to an AccessibilityService.
Parameters:root - The root of the virtual subtree.virtualDescendantId - The id of the virtual descendant.
getBoundsInParent
public void getBoundsInParent(android.graphics.Rect&outBounds)
Gets the node bounds in parent coordinates.
Parameters:outBounds - The output node bounds.
setBoundsInParent
public void setBoundsInParent(android.graphics.Rect&bounds)
Sets the node bounds in parent coordinates.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:bounds - The node bounds.
- If called from an AccessibilityService.
getBoundsInScreen
public void getBoundsInScreen(android.graphics.Rect&outBounds)
Gets the node bounds in screen coordinates.
Parameters:outBounds - The output node bounds.
setBoundsInScreen
public void setBoundsInScreen(android.graphics.Rect&bounds)
Sets the node bounds in screen coordinates.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:bounds - The node bounds.
- If called from an AccessibilityService.
isCheckable
public boolean isCheckable()
Gets whether this node is checkable.
Returns:True if the node is checkable.
setCheckable
public void setCheckable(boolean&checkable)
Sets whether this node is checkable.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:checkable - True if the node is checkable.
- If called from an AccessibilityService.
public boolean isChecked()
Gets whether this node is checked.
Returns:True if the node is checked.
setChecked
public void setChecked(boolean&checked)
Sets whether this node is checked.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:checked - True if the node is checked.
- If called from an AccessibilityService.
isFocusable
public boolean isFocusable()
Gets whether this node is focusable.
Returns:True if the node is focusable.
setFocusable
public void setFocusable(boolean&focusable)
Sets whether this node is focusable.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:focusable - True if the node is focusable.
- If called from an AccessibilityService.
public boolean isFocused()
Gets whether this node is focused.
Returns:True if the node is focused.
setFocused
public void setFocused(boolean&focused)
Sets whether this node is focused.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:focused - True if the node is focused.
- If called from an AccessibilityService.
isVisibleToUser
public boolean isVisibleToUser()
Sets whether this node is visible to the user.
Returns:Whether the node is visible to the user.
setVisibleToUser
public void setVisibleToUser(boolean&visibleToUser)
Sets whether this node is visible to the user.
Note: Cannot be called from an
AccessibilityService.
This class is made immutable before being delivered to an AccessibilityService.
Parameters:visibleToUser - Whether the node is visible to the user.
- If called from an AccessibilityService.
isAccessibilityFocused
public boolean isAccessibilityFocused()
Gets whether this node is accessibility focused.
Returns:True if the node is accessibility focused.
setAccessibilityFocused
public void setAccessibilityFocused(boolean&focused)
Sets whether this node is accessibility focused.
Note: Cannot be called from an
AccessibilityService.
This class is made immutable before being delivered to an AccessibilityService.
Parameters:focused - True if the node is accessibility focused.
- If called from an AccessibilityService.
isSelected
public boolean isSelected()
Gets whether this node is selected.
Returns:True if the node is selected.
setSelected
public void setSelected(boolean&selected)
Sets whether this node is selected.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:selected - True if the node is selected.
- If called from an AccessibilityService.
isClickable
public boolean isClickable()
Gets whether this node is clickable.
Returns:True if the node is clickable.
setClickable
public void setClickable(boolean&clickable)
Sets whether this node is clickable.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:clickable - True if the node is clickable.
- If called from an AccessibilityService.
isLongClickable
public boolean isLongClickable()
Gets whether this node is long clickable.
Returns:True if the node is long clickable.
setLongClickable
public void setLongClickable(boolean&longClickable)
Sets whether this node is long clickable.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:longClickable - True if the node is long clickable.
- If called from an AccessibilityService.
public boolean isEnabled()
Gets whether this node is enabled.
Returns:True if the node is enabled.
setEnabled
public void setEnabled(boolean&enabled)
Sets whether this node is enabled.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:enabled - True if the node is enabled.
- If called from an AccessibilityService.
isPassword
public boolean isPassword()
Gets whether this node is a password.
Returns:True if the node is a password.
setPassword
public void setPassword(boolean&password)
Sets whether this node is a password.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:password - True if the node is a password.
- If called from an AccessibilityService.
isScrollable
public boolean isScrollable()
Gets if the node is scrollable.
Returns:True if the node is scrollable, false otherwise.
setScrollable
public void setScrollable(boolean&scrollable)
Sets if the node is scrollable.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:scrollable - True if the node is scrollable, false otherwise.
- If called from an AccessibilityService.
getPackageName
getPackageName()
Gets the package this node comes from.
Returns:The package name.
setPackageName
public void setPackageName(&packageName)
Sets the package this node comes from.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:packageName - The package name.
- If called from an AccessibilityService.
getClassName
getClassName()
Gets the class this node comes from.
Returns:The class name.
setClassName
public void setClassName(&className)
Sets the class this node comes from.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:className - The class name.
- If called from an AccessibilityService.
Gets the text of this node.
Returns:The text.
public void setText(&text)
Sets the text of this node.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:text - The text.
- If called from an AccessibilityService.
getContentDescription
getContentDescription()
Gets the content description of this node.
Returns:The content description.
setContentDescription
public void setContentDescription(&contentDescription)
Sets the content description of this node.
Note: Cannot be called from an
AccessibilityService. This class is
made immutable before being delivered to an AccessibilityService.
Parameters:contentDescription - The content description.
- If called from an AccessibilityService.
public void recycle()
Return an instance back to be reused.
Note: You must not touch the object after calling this function.
- If the info is already recycled.
public int hashCode()
Overrides: in class
public boolean equals(&obj)
Overrides: in class
Copyright © 2013 . All Rights Reserved.

我要回帖

更多关于 nodejs api 的文章

 

随机推荐