本文整理匯總了Java中android.view.accessibility.AccessibilityEvent.TYPE_VIEW_SCROLLED屬性的典型用法代碼示例。如果您正苦於以下問題:Java AccessibilityEvent.TYPE_VIEW_SCROLLED屬性的具體用法?Java AccessibilityEvent.TYPE_VIEW_SCROLLED怎麽用?Java AccessibilityEvent.TYPE_VIEW_SCROLLED使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.view.accessibility.AccessibilityEvent
的用法示例。
在下文中一共展示了AccessibilityEvent.TYPE_VIEW_SCROLLED屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: sendAccessibilityEvent
@Override
public void sendAccessibilityEvent(int eventType) {
// Don't let the view send real scroll events.
if (eventType != AccessibilityEvent.TYPE_VIEW_SCROLLED) {
super.sendAccessibilityEvent(eventType);
}
}
示例2: onInitializeAccessibilityEvent
@Override
public void onInitializeAccessibilityEvent(AccessibilityEvent event) {
super.onInitializeAccessibilityEvent(event);
if (event.getEventType() == AccessibilityEvent.TYPE_VIEW_SCROLLED) {
event.setFromIndex(0);
event.setToIndex(0);
}
}
示例3: 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);
}
示例4: 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;
}