本文整理匯總了Java中android.view.accessibility.AccessibilityEvent.getItemCount方法的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityEvent.getItemCount方法的具體用法?Java AccessibilityEvent.getItemCount怎麽用?Java AccessibilityEvent.getItemCount使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類android.view.accessibility.AccessibilityEvent
的用法示例。
在下文中一共展示了AccessibilityEvent.getItemCount方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: robNewRedMoney
import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
/**
* 搶新發的紅包
*
* @param event
*/
private void robNewRedMoney(AccessibilityEvent event) {
AccessibilityNodeInfo root = getRootInActiveWindow();
if (root == null) {
return;
}
if (WechatVersionUtils.canFindViewById(context) && WechatVersionUtils.canRobWechatVersion(context)) {
List<AccessibilityNodeInfo> exitNodeInfos = root.findAccessibilityNodeInfosByViewId(WechatVersionUtils.getWechatExitId(context));
if (exitNodeInfos != null && exitNodeInfos.size() > 0) {
// 是聊天界麵
List<AccessibilityNodeInfo> wechatList = root.findAccessibilityNodeInfosByViewId(WechatVersionUtils.getWechatListId(context));
if (wechatList != null && wechatList.size() > 0) {
AccessibilityNodeInfo accessibilityNodeInfo = wechatList.get(0);
int itemCount = event.getItemCount();
int oldCount = sharedPerferenceUtil.getInteger(Constant.WECHAT_UI_LIST_COUNT, itemCount);
S(itemCount+" "+oldCount);
sharedPerferenceUtil.putInteger(Constant.WECHAT_UI_LIST_COUNT, itemCount);
int i = itemCount - oldCount;
if (i <= 0) {
return;
}
S("走到這裏咯啊嗎?11111");
AccessibilityNodeInfo nodeInfo = accessibilityNodeInfo.getChild(accessibilityNodeInfo.getChildCount() - 3);
if (nodeInfo == null) {
return;
}
S("走到這裏咯啊嗎?2222");
List<AccessibilityNodeInfo> getRedMoneyList = nodeInfo.findAccessibilityNodeInfosByViewId(WechatVersionUtils.getWechatGetRedMoneyId(context));
if (getRedMoneyList != null && getRedMoneyList.size() > 0) {
try {
isNotDO = false;
S("走到這裏咯啊嗎?3333");
WeChatUIRobRedMoney(root);
} catch (Exception e) {
e.printStackTrace();
}
}
}
}
}
}