Java Code Examples for android.view.View#onInitializeAccessibilityEvent()

The following examples show how to use android.view.View#onInitializeAccessibilityEvent() . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: holoaccent   File: SwitchPreference.java    License: Apache License 2.0 6 votes vote down vote up
/** As defined in TwoStatePreference source */
void sendAccessibilityEvent(View view) {
    // Since the view is still not attached we create, populate,
    // and send the event directly since we do not know when it
    // will be attached and posting commands is not as clean.
	AccessibilityManager accessibilityManager =
	        (AccessibilityManager)getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
	if (accessibilityManager == null)
		return;
    if (mSendClickAccessibilityEvent && accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain();
        event.setEventType(AccessibilityEvent.TYPE_VIEW_CLICKED);
        view.onInitializeAccessibilityEvent(event);
        view.dispatchPopulateAccessibilityEvent(event);
        accessibilityManager.sendAccessibilityEvent(event);
    }
    mSendClickAccessibilityEvent = false;
}
 
Example 2
public static void sendCustomAccessibilityEvent(View target, int type, String text) {
    AccessibilityManager accessibilityManager = (AccessibilityManager)
            target.getContext().getSystemService(Context.ACCESSIBILITY_SERVICE);
    if (accessibilityManager.isEnabled()) {
        AccessibilityEvent event = AccessibilityEvent.obtain(type);
        target.onInitializeAccessibilityEvent(event);
        event.getText().add(text);
        accessibilityManager.sendAccessibilityEvent(event);
    }
}
 
Example 3
Source Project: letv   File: ViewCompatICS.java    License: Apache License 2.0 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 4
Source Project: MiBandDecompiled   File: al.java    License: Apache License 2.0 4 votes vote down vote up
public static void b(View view, AccessibilityEvent accessibilityevent)
{
    view.onInitializeAccessibilityEvent(accessibilityevent);
}
 
Example 5
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 6
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 7
Source Project: V.FlyoutTest   File: ViewCompatICS.java    License: MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}
 
Example 8
Source Project: guideshow   File: ViewCompatICS.java    License: MIT License 4 votes vote down vote up
public static void onInitializeAccessibilityEvent(View v, AccessibilityEvent event) {
    v.onInitializeAccessibilityEvent(event);
}