當前位置: 首頁>>代碼示例>>Java>>正文


Java AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED屬性代碼示例

本文整理匯總了Java中android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED屬性的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED屬性的具體用法?Java AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED怎麽用?Java AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在android.view.accessibility.AccessibilityEvent的用法示例。


在下文中一共展示了AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED屬性的14個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: onAccessibilityEvent

@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    int eventType = event.getEventType();
    switch (eventType) {
        case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
        case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:
            for (String id : installBtnId) {
                AccessibilityNodeInfo node = AccessibilityNodeUtil.findNodeById(event.getSource(), id);
                if (node != null) {
                    AccessibilityNodeUtil.click(node);
                    Toast.makeText(this, "安裝成功", Toast.LENGTH_SHORT).show();
                    break;
                }
            }
            break;
        default:
            break;
    }
}
 
開發者ID:pengwei1024,項目名稱:adb-install-robot,代碼行數:20,代碼來源:AutoInstallAccessibilityService.java

示例2: openHongBao

private void openHongBao(AccessibilityEvent event){
	String className=event.getClassName().toString();
	Log.i(TAG,className);
       if(className.equals(QQ_CLASSNAME_WALLET)&&isNeedBack){
		performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
		isNeedBack=false;
	}else if(className.equals(QQ_CLASSNAME_CHAT)||(event.getEventType()==AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED&&windowState)) {
		//wakeAndUnlock(true);
		windowState=true;
		if(!runState){
			AccessibilityNodeInfo info = event.getSource();
			if(info == null)  return;
			getAllHongBao(info);
		}
       }else{
		windowState=false;
	}
}
 
開發者ID:qq1198,項目名稱:mtoolbox,代碼行數:18,代碼來源:HongBaoService.java

示例3: onAccessibilityEvent

@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    AccessibilityNodeInfo nodeInfo = event.getSource();
    if (nodeInfo != null) {
        int eventType = event.getEventType();
        if (eventType== AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED ||
                eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
            if (handledMap.get(event.getWindowId()) == null) {
                boolean handled = iterateNodesAndHandle(nodeInfo);
                if (handled) {
                    handledMap.put(event.getWindowId(), true);
                }
            }
        }
    }
}
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:16,代碼來源:fool.java

示例4: onAccessibilityEvent

@Override
public void onAccessibilityEvent(AccessibilityEvent event) {

    SharedPreferences settings = getSharedPreferences(data, 0);
    settingRoom = settings.getString(settingRoomField, "");
    settingDevices = settings.getString(settingDevicesField, "");

    if (settingRoom.equals("") || settingDevices.equals("")) {
        tellUser("配置檔不完整");
        return;
    }

    int eventType = event.getEventType();
    if (eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED) {
        preProcess(event);
        Log.i(TAG, "onAccessibilityEvent");
    }

}
 
開發者ID:qoli,項目名稱:MiHomePlus,代碼行數:19,代碼來源:MyAccessibility.java

示例5: eventToString

private String eventToString(AccessibilityEvent event) {
    StringBuilder builder = new StringBuilder();
    String eventType = "";
    switch (event.getEventType()){
        case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED: // 通知欄狀態變化
            eventType = "TYPE_NOTIFICATION_STATE_CHANGED";
            break;
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: // 窗口狀態變化
            eventType = "TYPE_WINDOW_STATE_CHANGED";
            break;
        case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:  // 窗口內容變化
            eventType = "TYPE_WINDOW_CONTENT_CHANGED";
            break;
    }
    builder.append("EventType: ").append(eventType);
    builder.append("; ClassName: ").append(event.getClassName());
    builder.append("; Text: ").append(event.getText());
    builder.append("; ContentDescription: ").append(event.getContentDescription());
    builder.append("; ItemCount: ").append(event.getItemCount());
    builder.append("; ParcelableData: ").append(event.getParcelableData());
    return builder.toString();
}
 
開發者ID:A-Miracle,項目名稱:QiangHongBao,代碼行數:22,代碼來源:QHBService.java

示例6: onAccessibilityEvent

@Override
public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
    if (null == accessibilityEvent) {
        return;
    }
    switch (accessibilityEvent.getEventType()) {
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: {
            Log.i("AnalystService.onAccessibilityEvent # AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED");
            mLastEventClassName = StringUtil.toNb(accessibilityEvent.getClassName());
            postEvent();
        }
        break;
        case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED: {
            Log.i("AnalystService.onAccessibilityEvent # AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED");
            if (null != mLastEventClassName) {
                postEvent();
            }
        }
        break;
    }
}
 
開發者ID:littleRich,項目名稱:AutoInteraction-Library,代碼行數:21,代碼來源:AnalystService.java

示例7: watchList

private boolean watchList(AccessibilityEvent event) {
    if (mListMutex) return false;
    mListMutex = true;
    AccessibilityNodeInfo eventSource = event.getSource();
    // Not a message
    if (event.getEventType() != AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED || eventSource == null)
        return false;

    List<AccessibilityNodeInfo> nodes = eventSource.findAccessibilityNodeInfosByText(WECHAT_NOTIFICATION_TIP);
    //增加條件判斷currentActivityName.contains(WECHAT_LUCKMONEY_GENERAL_ACTIVITY)
    //避免當訂閱號中出現標題為“[微信紅包]拜年紅包”(其實並非紅包)的信息時誤判
    if (!nodes.isEmpty() && currentActivityName.contains(WECHAT_LUCKMONEY_GENERAL_ACTIVITY)) {
        AccessibilityNodeInfo nodeToClick = nodes.get(0);
        if (nodeToClick == null) return false;
        CharSequence contentDescription = nodeToClick.getContentDescription();
        if (contentDescription != null && !signature.getContentDescription().equals(contentDescription)) {
            nodeToClick.performAction(AccessibilityNodeInfo.ACTION_CLICK);
            signature.setContentDescription(contentDescription.toString());
            return true;
        }
    }
    return false;
}
 
開發者ID:KoreHuang,項目名稱:WeChatLuckyMoney,代碼行數:23,代碼來源:HongbaoService.java

示例8: handleAccessibilityEvent

public void handleAccessibilityEvent(AccessibilityEvent event, AccessibilityNodeInfo rootNode){
    int eventType = event.getEventType();
    if (eventType == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
            || eventType == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
            || eventType == AccessibilityEvent.TYPE_WINDOWS_CHANGED
            || eventType == AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED)
    {
        this.output(new AccEvent(event, rootNode));
    }

}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:11,代碼來源:WindowChangeEventProvider.java

示例9: openHongBao

private void openHongBao(AccessibilityEvent event)
   {
String className=event.getClassName().toString();
//Log.i(TAG, className);
       if (className.equals(QQ_CLASSNAME_WALLET) && isNeedBack)
{
    performGlobalAction(AccessibilityService.GLOBAL_ACTION_BACK);
    isNeedBack = false;
}
else if (className.equals(QQ_CLASSNAME_CHAT) || (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED && windowState))
{
    SharedPreferences haredPreferences = getSharedPreferences("nico.styTool_preferences", MODE_PRIVATE); 
    boolean sFirstRun = haredPreferences.getBoolean("ok_b", true); 
    //Editor editor = sharedPreferences.edit(); 
    if (sFirstRun) 
    { 
	wakeAndUnlock(true);
    }
    else 
    { 

    }
    windowState = true;
    if (!runState)
    {
	AccessibilityNodeInfo info = event.getSource();
	if (info == null)  return;
	getAllHongBao(info);
    }
       }
else
{
    windowState = false;
}
   }
 
開發者ID:stytooldex,項目名稱:stynico,代碼行數:35,代碼來源:dex_smali.java

示例10: onReceive

@Override
public void onReceive(AccessibilityEvent event) {
    switch (event.getEventType()) {
        case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED: // 通知欄狀態變化
            notificationEvent(event);
            break;
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED: // 窗口狀態變化
            windowStateEvent(event);
            break;
        case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:  // 窗口內容變化
            windowContentEvent(event);
            break;
    }
}
 
開發者ID:A-Miracle,項目名稱:QiangHongBao,代碼行數:14,代碼來源:WeChatAccessibilityJob.java

示例11: onAccessibilityEvent

@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    int eventType = event.getEventType();
    CharSequence packageName = event.getPackageName();
    switch (eventType) {
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
            AccessibilityNodeInfo rootNode = getRootInActiveWindow();
            if (rootNode != null) {

                if (packageName.equals("com.android.settings")) {
                    AccessibilityNodeInfo settingNode = AceHelper.findNodeByText(rootNode,"WLAN");
                    AceHelper.performClick(settingNode);
                    rootNode.recycle();
                } else if (packageName.equals("com.android.wifisettings")) {
                    AccessibilityNodeInfo wifiNode = AceHelper.findNodeByText(rootNode, "TP-LINK_F770");
                    AccessibilityNodeInfo wifiNodeParent = wifiNode.getParent();
                    AccessibilityNodeInfo iconNode = AceHelper.findNodeById(wifiNodeParent, "com.android.wifisettings:id/advance_layout");
                    AceHelper.performClick(iconNode);
                }
            }
            break;
        case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:
            Toast.makeText(this, "Notify", Toast.LENGTH_SHORT).show();
            event.getSource().recycle();
            break;
        case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
            break;
        default:
            break;
    }
}
 
開發者ID:coding-dream,項目名稱:TPlayer,代碼行數:32,代碼來源:WifiProxyAccessibilityService.java

示例12: onServiceConnected

@Override
    public void onServiceConnected() {
        AccessibilityServiceInfo info = getServiceInfo();
        info.eventTypes = AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED |
                AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED
                | AccessibilityEvent.TYPE_VIEW_SCROLLED
                | AccessibilityEvent.TYPE_VIEW_CLICKED;

        info.packageNames = packages;

        info.feedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;

        info.notificationTimeout = 100;

        ReflectUtils.setFieldValue(info, "mCapabilities", info.getCapabilities() | AccessibilityServiceInfo.CAPABILITY_CAN_RETRIEVE_WINDOW_CONTENT);

        this.setServiceInfo(info);

        BaseAccessibility.isEnable.set(true);
        if (needClearTask) {
            InstallAccessibility.openSettingAccessibilityNeedTips(this);
            MyAccessibility.needClearTask = false;
            LocalAccessibilityManager.getInstance().notifyAccessibilityChanged(true);
        }

//        StatHelper.onSmartInstallEvent(StatFieldConst.SmartInstaller.Action.ACTION_SMARTINSC);
        LogUtils.d("BaseAccessibility", "onServiceConnected:" + BaseAccessibility.isEnable.get());

        SmartInstaller.logPrint("processAccessibilityEnvent onServiceConnected= " + BaseAccessibility.isEnable.get()
                + " autoClickNumber=" + BaseAccessibility.autoClickNumber);
    }
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:31,代碼來源:MyAccessibility.java

示例13: onAccessibilityEvent

@Override
    public void onAccessibilityEvent(AccessibilityEvent event) {
        super.onAccessibilityEvent(event);
        AccessibilityNodeInfo rootInActiveWindow = getRootInActiveWindow();
        if (rootInActiveWindow == null) {
            L.d("openContactInfo nodeInfo is null");
            return;
        }

        L.d("得到當前包名 "+rootInActiveWindow.getPackageName() + " 類名 " + rootInActiveWindow.getClass());

        if (rootInActiveWindow.getPackageName() != null &&
                !(rootInActiveWindow.getPackageName() + "").equals("com.tencent.mm")) {
            L.e("不是 微信 返回");
            return;
        }

        if (mIsNeedCloseWeChat) {
            if (rootInActiveWindow.getPackageName() != null &&
                    (rootInActiveWindow.getPackageName() + "").equals(AccessUtil.WECHAT_PACKAGE_NAME)) {

                if (AccessUtil.isWeChatMain(rootInActiveWindow)) {
                    mIsNeedCloseWeChat = false;
                    L.d("ismain");

                    mActivity.startActivity(mIntent);
                } else {
                    AccessUtil.performBack(this, rootInActiveWindow);
                }
                return;
            } else {
//                mIsNeedCloseWeChat = false;

//                if (mIntent != null && mActivity != null) {
//                    mActivity.startActivity(mIntent);
//                }
            }
        }

        int eventType = event.getEventType();
        switch (eventType) {
            //第一步:監聽通知欄消息
            case AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED:
                WeChatMsg.sendNotify(event);
                break;
            //第二步:監聽是否進入微信聊天界麵
            case AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED:
//                WeChatNearly.nearly(this, getRootInActiveWindow(), this, "你好");
                L.d("type " + type);
                switch (type) {
                    case Mode.autoHello://自動打招呼
                        mWeChatNearly.change(this, rootInActiveWindow, this, "你好");
                        break;
                    case Mode.group://群發
                        mWeChatGroup.change(this, rootInActiveWindow, this, "你好");
                        break;
                    case Mode.autoChat://自動聊天
                        mWeChatAutoReply.change(this, rootInActiveWindow, this, "你好");
                        break;
                    case Mode.closeService://無法實現
                        AccessUtil.openNext(rootInActiveWindow, "測試");
                        break;
                }
                break;
            default:
                break;
        }
    }
 
開發者ID:kaixuanluo,項目名稱:pc-android-controller-android,代碼行數:68,代碼來源:WeChatAccessService.java

示例14: setDynamicContent

/**
     * Set the content this service should be receiving
     */
    private void setDynamicContent() {
        if (DEBUG) {
            MyLog.i(CLS_NAME, "setDynamicContent: interceptGoogle: " + initInterceptGoogle);
            MyLog.i(CLS_NAME, "setDynamicContent: announceNotifications: " + initAnnounceNotifications);
        }

        if (!initInterceptGoogle && !initAnnounceNotifications) {
            if (DEBUG) {
                MyLog.i(CLS_NAME, "setDynamicContent: none required: finishing");
            }

//            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {
//                this.disableSelf();
//            }
//
//            this.stopSelf();

        } else {
            if (DEBUG) {
                MyLog.i(CLS_NAME, "setDynamicContent: updating content");
            }

            final AccessibilityServiceInfo serviceInfo = new AccessibilityServiceInfo();

            serviceInfo.feedbackType = AccessibilityServiceInfo.FEEDBACK_SPOKEN;
            serviceInfo.flags = AccessibilityServiceInfo.FLAG_INCLUDE_NOT_IMPORTANT_VIEWS;
            serviceInfo.notificationTimeout = UPDATE_TIMEOUT;

            if (initInterceptGoogle && initAnnounceNotifications) {
                serviceInfo.eventTypes = AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
                        | AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED
                        | AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
            } else if (initInterceptGoogle) {
                serviceInfo.packageNames = new String[]{Installed.PACKAGE_NAME_GOOGLE_NOW};
                serviceInfo.eventTypes = AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED
                        | AccessibilityEvent.TYPE_VIEW_TEXT_SELECTION_CHANGED;
            } else {
                serviceInfo.eventTypes = AccessibilityEvent.TYPE_NOTIFICATION_STATE_CHANGED;
            }

            this.setServiceInfo(serviceInfo);
        }
    }
 
開發者ID:brandall76,項目名稱:Saiy-PS,代碼行數:46,代碼來源:SaiyAccessibilityService.java


注:本文中的android.view.accessibility.AccessibilityEvent.TYPE_WINDOW_CONTENT_CHANGED屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。