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


Java AccessibilityEvent.TYPE_VIEW_CLICKED屬性代碼示例

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


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

示例1: handleAccessibilityEvent

public void handleAccessibilityEvent(AccessibilityEvent event, AccessibilityNodeInfo rootNode){
    int eventType = event.getEventType();
    if (eventType == AccessibilityEvent.TYPE_VIEW_CLICKED
            || eventType == AccessibilityEvent.TYPE_VIEW_LONG_CLICKED
            || eventType == AccessibilityEvent.TYPE_VIEW_FOCUSED
            || eventType == AccessibilityEvent.TYPE_VIEW_SELECTED) {
        AccEvent accEvent = new AccEvent(event, rootNode);
        accEvent.setFieldValue(AccEvent.SOURCE_NODE, event.getSource());
        this.output(accEvent);
    }
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:11,代碼來源:UIActionProvider.java

示例2: onCreate

@Override
public void onCreate() {
    super.onCreate();
    tipViewController=TipViewController.getInstance();
    mAccessibilityServiceInfo=new AccessibilityServiceInfo();
    mAccessibilityServiceInfo.feedbackType=FEEDBACK_GENERIC;
    mAccessibilityServiceInfo.eventTypes=AccessibilityEvent.TYPE_VIEW_CLICKED|AccessibilityEvent.TYPE_VIEW_LONG_CLICKED|AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED;
    int flag=0;
    if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.LOLLIPOP){
        flag=flag|AccessibilityServiceInfo.FLAG_RETRIEVE_INTERACTIVE_WINDOWS;
    }
    if (Build.VERSION.SDK_INT>=Build.VERSION_CODES.JELLY_BEAN_MR2){
        flag=flag|AccessibilityServiceInfo.FLAG_REQUEST_FILTER_KEY_EVENTS;
    }
    mAccessibilityServiceInfo.flags=flag;
    mAccessibilityServiceInfo.notificationTimeout=100;
    setServiceInfo(mAccessibilityServiceInfo);
}
 
開發者ID:l465659833,項目名稱:RecentTask,代碼行數:18,代碼來源:AccessibilityMonitorService.java

示例3: sendAccessibilityEvent

public void sendAccessibilityEvent(View clickView, int eventType) {
    TrackerLog.d("eventType: " + eventType);
    if (eventType == AccessibilityEvent.TYPE_VIEW_CLICKED) {
        TrackerLog.d("click: " + clickView);
        DataProcess.processClickParams(commonInfo, clickView);
    }
    super.sendAccessibilityEvent(clickView, eventType);
}
 
開發者ID:alibaba,項目名稱:android_viewtracker,代碼行數:8,代碼來源:ViewDelegate.java

示例4: onServiceConnected

@RequiresApi(api = Build.VERSION_CODES.JELLY_BEAN)
@Override
protected void onServiceConnected() {
    super.onServiceConnected();
    AccessibilityServiceInfo info = this.getServiceInfo();
    info.eventTypes = AccessibilityEvent.TYPE_VIEW_CLICKED | AccessibilityEvent.TYPE_VIEW_TEXT_CHANGED | AccessibilityEvent.TYPE_VIEW_LONG_CLICKED;
    info.feedbackType = AccessibilityServiceInfo.FEEDBACK_GENERIC;
    this.setServiceInfo(info);

    clipboardManager.addPrimaryClipChangedListener(this);
}
 
開發者ID:baijifeilong,項目名稱:antea,代碼行數:11,代碼來源:AnteaService.java

示例5: processInstallApplication

@SuppressLint("NewApi")
    public static void  processInstallApplication(final AccessibilityService service, AccessibilityEvent event) {

        boolean hasForceStopView;
        boolean isForceStopEnable;

        if (isRegistPkg(event.getPackageName().toString()) && AccessibilityEvent.TYPE_VIEW_CLICKED != event.getEventType()) {

            AccessibilityNodeInfo nodeInfo = event.getSource();
            if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN){
                nodeInfo = ((MyAccessibility)service).getRootInActiveWindow(nodeInfo);
            }

            //查找並處理確定按鈕
            if(!isClickOk){
                isClickOk = findAndAccessAccessibilityNode(nodeInfo, ok);
                if(isClickOk){
                    return;
                }
            }

            //查找並處理強行停止節點
            hasForceStopView = hasAccessibilityNode(nodeInfo, forceStop);
            isForceStopEnable = isAccessibilityNodeEnable(nodeInfo, forceStop);
            if(hasForceStopView && isForceStopEnable && !isClickForceStop){
                isClickForceStop = findAndAccessAccessibilityNode(nodeInfo, forceStop);
            }

            //點擊過了強行停止的確定按鈕或者強行停止按鈕不可點擊
            if (hasForceStopView && !isForceStopEnable || isClickOk) {
                BaseAccessibility.resetAccessModel();
//                BatteryCallbackManager.getInstance().onForceStopStatusChanged(curPkg, StatusConst.FORCESTOP_SUCCESS);

                if(curCallback != null) {
                    curCallback.callback(curPkg, 0, StatusConst.FORCESTOP_SUCCESS);
                }
            }
        }
    }
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:39,代碼來源:ForceStopAccessbility.java

示例6: 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

示例7: onAccessibilityEvent

@Override
public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
    fgPackageName = accessibilityEvent.getPackageName().toString();
    //prt("Event: " + accessibilityEvent);
    if (accessibilityEvent.getEventType() == AccessibilityEvent.TYPE_VIEW_CLICKED) {
        if ("com.jd.jrapp".equals(fgPackageName) && (!accessibilityEvent.getText().toString().equals("簽到")
                && !accessibilityEvent.getText().toString().equals("鋼蹦明細")
                && accessibilityEvent.getClassName().equals("android.widget.Button"))) {
            //prt("" + accessibilityEvent);
            autoLock.lock();
            autoCondition.signal();
            autoLock.unlock();
        }

        if ("com.jingdong.app.mall".equals(fgPackageName)
                && !(accessibilityEvent.getText().toString().contains("領京豆")
                || accessibilityEvent.getText().toString().contains("我的")
                || accessibilityEvent.getText().toString().contains("會員")
                || accessibilityEvent.getText().toString().contains("惠賺錢")
                || accessibilityEvent.getText().toString().contains("簽到")
                || accessibilityEvent.getText().toString().contains("領券"))) {
            prt(" " + accessibilityEvent);
            autoLock.lock();
            autoCondition.signal();
            autoLock.unlock();
        }
    }

    if (accessibilityEvent.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED
            && "com.jd.jrapp".equals(fgPackageName) && jdf.gestureLockFlag) {
        //prt("" + accessibilityEvent);
        jdf.gestureLockFlag = false;
        autoLock.lock();
        autoCondition.signal();
        autoLock.unlock();
    }

    //prt(oldPackageName + " ------------------------- " + fgPackageName);
    if (!oldPackageName.equals(fgPackageName)) {
        new autoSignThread(accessibilityEvent).start();
    }
    oldPackageName = fgPackageName;
}
 
開發者ID:Sl0v3C,項目名稱:Android_AutoSignInTool,代碼行數:43,代碼來源:SignInService.java

示例8: processUninstallResidue

@SuppressLint("NewApi")
public void processUninstallResidue(final AccessibilityService service, AccessibilityEvent event) {
    boolean hasResidueText;
    boolean isClickCancel = false;

    if (!isProcessCancelFinish.get()) {
        String pkgName = event.getPackageName().toString();
        if (isRegisterPkg(pkgName) && AccessibilityEvent.TYPE_VIEW_CLICKED != event.getEventType()) {
            AccessibilityNodeInfo nodeInfo = event.getSource();
            if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) {
                nodeInfo = ((MyAccessibility)service).getRootInActiveWindow(nodeInfo);
            }

            // 判斷是否有殘留文字
            hasResidueText = BaseAccessibility.containAccessibilityNode(nodeInfo, residue_text);

            // 查找取消按鈕
            if (hasResidueText) {
                if (BaseAccessibility.isAccessibilityNodeEnable(nodeInfo, cancel_btn)) {
                    isClickCancel = BaseAccessibility.findAndAccessAccessibilityNode(nodeInfo, cancel_btn);
                }
            }

            // 處理過程完成
            if (isClickCancel) {
                mClickCount++;
            }

            if (mClickCount >= mNeedClickCount) {
                if (isProcessCancelFinish.compareAndSet(false, true)) {
                    mMainHandler.removeCallbacks(timeoutRunnable);
                    if (BaseAccessibility.accessModel == MyAccessibility.ACCESS_MODEL_UNINSTALL_CLEAR) {
                        BaseAccessibility.resetAccessModel();
                    }
                    mNeedClickCount = 0;
                    mClickCount = 0;
                }
            }
        }
    }
}
 
開發者ID:miLLlulei,項目名稱:Accessibility,代碼行數:41,代碼來源:UninstallResidueAccessbility.java


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