本文整理匯總了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;
}
}
示例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);
}
示例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();
}
}
示例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;
}
}
示例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;
}
}
示例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