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


Java AccessibilityEvent.getPackageName方法代碼示例

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


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

示例1: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    int type=event.getEventType();
    switch (type){
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
            mWindowClassName = event.getClassName();
            mCurrentPackage = event.getPackageName()==null?"":event.getPackageName().toString();
            if (mCurrentPackage.equals(HIDE_FLOAT_VIEW_PACKAGE_NAME)){
                tipViewController.hide();
            }else {
                tipViewController.show(1,"");
            }
            break;
        case TYPE_VIEW_CLICKED:
        case TYPE_VIEW_LONG_CLICKED:
            break;
    }
}
 
開發者ID:l465659833,項目名稱:RecentTask,代碼行數:19,代碼來源:AccessibilityMonitorService.java

示例2: AccEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
AccEvent(AccessibilityEvent accessibilityEvent, AccessibilityNodeInfo rootNode) {
    this.setFieldValue(EVENT, accessibilityEvent);
    this.setFieldValue(EVENT_TIME, accessibilityEvent.getEventTime());
    this.setFieldValue(ROOT_NODE, rootNode);
    this.setFieldValue(EVENT_TYPE, accessibilityEvent.getEventType());
    CharSequence charSequence = accessibilityEvent.getPackageName();
    String packageName = charSequence == null ? "" : charSequence.toString();
    this.setFieldValue(PACKAGE_NAME, packageName);
}
 
開發者ID:PrivacyStreams,項目名稱:PrivacyStreams,代碼行數:10,代碼來源:AccEvent.java

示例3: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
@Override
public void onAccessibilityEvent(AccessibilityEvent accessibilityEvent) {
    if (accessibilityEvent.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) {
        foregroundPackageName = accessibilityEvent.getPackageName();
        foregroundClassName = accessibilityEvent.getClassName();
    }
}
 
開發者ID:Omico,項目名稱:CurrentActivity,代碼行數:8,代碼來源:CurrentActivityAccessibilityService.java

示例4: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
@Override
public void onAccessibilityEvent(AccessibilityEvent event) {
    //虛擬手機按鍵處理,優先級高於是否點擊分詞的判斷
    if ((event.getEventType() == TYPE_VIEW_LONG_CLICKED) && ("com.android.systemui".equals(event.getPackageName())))
    {
        if (TextUtils.isEmpty(event.getContentDescription())){
            return;
        }
        //長按虛擬機觸發的,需要轉到按鍵處理去
        if (!TextUtils.isEmpty(back) && event.getContentDescription().equals(back)){
            KeyPressedTipViewController.getInstance().onKeyLongPress(KeyEvent.KEYCODE_BACK);
        }else if (!TextUtils.isEmpty(home) && event.getContentDescription().equals(home)){
            KeyPressedTipViewController.getInstance().onKeyLongPress(KeyEvent.KEYCODE_HOME);
        }else if (!TextUtils.isEmpty(recent) && event.getContentDescription().equals(recent)){
            KeyPressedTipViewController.getInstance().onKeyLongPress(KeyEvent.KEYCODE_APP_SWITCH);
        }
    }
    if (!isRun){
        return;
    }
    LogUtil.d(TAG,"onAccessibilityEvent:"+event);
    int type=event.getEventType();
    switch (type){
        case AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED:
            mWindowClassName = event.getClassName();
            mCurrentPackage = event.getPackageName()==null?"":event.getPackageName().toString();
            Integer selectType=selections.get(mCurrentPackage);
            mCurrentType = selectType==null?TYPE_VIEW_NONE:(selectType+1);
            if ("com.tencent.mm.plugin.sns.ui.SnsTimeLineUI".equals(mWindowClassName)){
                setCapabilities(true);
            }else {
                setCapabilities(false);
            }
            break;
        case TYPE_VIEW_CLICKED:
        case TYPE_VIEW_LONG_CLICKED:
            getText(event);
            break;
    }
}
 
開發者ID:l465659833,項目名稱:Bigbang,代碼行數:41,代碼來源:BigBangMonitorService.java

示例5: onAccessibilityEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
@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,代碼行數:33,代碼來源:WifiProxyAccessibilityService.java

示例6: fromEvent

import android.view.accessibility.AccessibilityEvent; //導入方法依賴的package包/類
public static NotificationInfo fromEvent(AccessibilityEvent event) {
    return new NotificationInfo(event.getPackageName(), event.getText());
}
 
開發者ID:feifadaima,項目名稱:https-github.com-hyb1996-NoRootScriptDroid,代碼行數:4,代碼來源:NotificationListener.java


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